diff --git a/插件库/Lskj.PubBill/BillModule.cs b/插件库/Lskj.PubBill/BillModule.cs index 2ff7e8b..660e9e3 100644 --- a/插件库/Lskj.PubBill/BillModule.cs +++ b/插件库/Lskj.PubBill/BillModule.cs @@ -201,11 +201,11 @@ namespace Lskj.PubBill /// /// 来源明细的页面名字后缀(设置成全局变量,更好的处理语言翻译的情况) /// - public string DetailedSuffix = Business.Impl.LanguageTranslation.Translatable ?"-"+ Business.Impl.LanguageTranslation.GetTranslatedText("明细") : "-明细"; + public string DetailedSuffix = Business.Impl.LanguageTranslation.Translatable ? "-" + Business.Impl.LanguageTranslation.GetTranslatedText("明细") : "-明细"; /// /// 数量后缀 /// - public string QuantitySuffix = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("条")+")" : "条)"; + public string QuantitySuffix = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("条") + ")" : "条)"; /// /// 新增 /// @@ -788,6 +788,12 @@ namespace Lskj.PubBill this.BillModel.BillSourceIds = menuRow.Table.Columns.Contains("BillSourceIds") ? (menuRow["BillSourceIds"] + "").Trim(',') : string.Empty; this.BillModel.BillFlag = menuRow.Table.Columns.Contains("BillFlag") && !string.IsNullOrEmpty(menuRow["BillFlag"] + "") ? Convert.ToInt32(menuRow["BillFlag"] + "") : -1; } + if (this.SysModel.HideSource) + { + this.BillModel.PanelWidth = 0; + this.BillModel.PanelHeight = 0; + } + //获取打印其他参数 GetPrintOtherParam(); @@ -1031,7 +1037,7 @@ namespace Lskj.PubBill DataRow rowItem = btn.Tag as DataRow; GridRightMenuModel model = new GridRightMenuModel(rowItem); - if (!string.IsNullOrWhiteSpace(model.ClickCond)) + if (!string.IsNullOrWhiteSpace(model.ClickCond)) { string clickCond = this.ControlObj.ReplaceControlValue(model.ClickCond) + ""; bool condResult = ValidateCond(clickCond, null); @@ -1055,7 +1061,7 @@ namespace Lskj.PubBill menu.DynamicLinkAfter += new CommonToolAfterDynamicLinkEventHandler(OnDynamicLinkAfter); menu.Apply(rowItem); - if (StaticControl.ReturnRowLisy.Count > 0) + if (StaticControl.ReturnRowLisy.Count > 0) { DataRow[] dataRows = StaticControl.ReturnRowLisy.ToArray(); foreach (DataRow item in dataRows) @@ -1064,7 +1070,7 @@ namespace Lskj.PubBill { this.AddRowToTreeGridControl(item, "0"); } - else + else { this.AddRowToGridView(item); } @@ -1123,6 +1129,7 @@ namespace Lskj.PubBill { this.ControlObj = new MyControl() { Model = SysModel };//主表控件 } + //this.ControlObj = new MyControl();//// 主表控件 this.ControlObj.OpenDocumentSource += OpenTheSourcePopup; this.ControlObj.OtherParams = this.SysModel.OtherParams(); @@ -2694,6 +2701,9 @@ namespace Lskj.PubBill } } + //设置打印按钮状态 + this.btnPrint.Enabled = this.SetPrintButton(rowItem); + this._waterMark = new WaterMark(this.BillModel.MasterPreFix, rowItem); this.lbTitle.Invalidate(); @@ -3520,8 +3530,8 @@ namespace Lskj.PubBill /// private void RefreshSelectedSource() { - if (this.xtc_left_container.SelectedTabPage==null) return;//来源选择为null(不显示左侧来源)。不执行下方刷新 - + if (this.xtc_left_container.SelectedTabPage == null) return;//来源选择为null(不显示左侧来源)。不执行下方刷新 + XtraTabPage tabPage = this.xtc_left_container.SelectedTabPage; BillSourceUnionModel model = tabPage.Tag as BillSourceUnionModel; if (model.GridControlObj != null) this.RefreshSource(model); @@ -3606,7 +3616,7 @@ namespace Lskj.PubBill BillSourceUnionModel unionModel = tabPage.Tag as BillSourceUnionModel; if (unionModel.ModelObj.SourceType != 2) { - + int Handle = 0; string sql = ReplaceHelper.ReplaceUserInfo(unionModel.ModelObj.SourceSql); if (unionModel.GridControlObj != null) Handle = unionModel.GridControlObj.GridView.FocusedRowHandle; @@ -3620,8 +3630,8 @@ namespace Lskj.PubBill if (!string.IsNullOrWhiteSpace(item.DefaultValue) && RefreshName.Equals(item.DefaultValue.Replace("{", "").Replace("}", ""))) { unionModel.SearchObj.SetControlValue(item, baseControl.EditText); - } - else if (RefreshName.Equals(item.FieldName)) + } + else if (RefreshName.Equals(item.FieldName)) { unionModel.SearchObj.SetControlValue(item, baseControl.EditText); } @@ -4727,7 +4737,7 @@ namespace Lskj.PubBill //return false; } // 检测是否为提交或者终审模块 - string text = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("已终审") : "已终审"; + string text = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("已终审") : "已终审"; if (_waterMark.Text.Contains(text)) { MessageUtil.Show(ResourceKeys.AddBillDetailed); @@ -4991,7 +5001,8 @@ namespace Lskj.PubBill StringBuilder fieldBuilder = new StringBuilder(); StringBuilder valueBuilder = new StringBuilder(); - DataTable DetailedProperties = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", BillModel.MasterTable)); + //DataTable DetailedProperties = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", BillModel.MasterTable)); + DataTable DetailedProperties = MainImpl.GetDatabaseProperty(BillModel.MasterTable); string errorMessage = string.Empty;//数据不符合数据库规范的信息 foreach (ControlModel model in this.ControlObj.ControlModels) @@ -5000,7 +5011,7 @@ namespace Lskj.PubBill model.FieldName.Equals(BillModel.PrimaryKey, StringComparison.OrdinalIgnoreCase) || model.FieldName.Equals(BillModel.RtagidKey, StringComparison.OrdinalIgnoreCase) || model.FieldType == ControlType.LabPic || - model.FieldType == ControlType.LabPicEx|| + model.FieldType == ControlType.LabPicEx || model.FieldType == ControlType.LabPrompt) continue; @@ -5046,8 +5057,8 @@ namespace Lskj.PubBill StringBuilder updateBuilder = new StringBuilder(); - DataTable DetailedProperties = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", BillModel.MasterTable)); - + //DataTable DetailedProperties = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", BillModel.MasterTable)); + DataTable DetailedProperties = MainImpl.GetDatabaseProperty(BillModel.MasterTable); string errorMessage = string.Empty;//数据不符合数据库规范的信息 // 修改单据 @@ -5056,8 +5067,8 @@ namespace Lskj.PubBill if (!model.IsSave || model.FieldName.Equals(BillModel.RtagidKey, StringComparison.OrdinalIgnoreCase) || model.FieldType == ControlType.LabPic || - model.FieldType == ControlType.LabPicEx|| - model.FieldType == ControlType.LabPrompt ) + model.FieldType == ControlType.LabPicEx || + model.FieldType == ControlType.LabPrompt) continue; if (string.IsNullOrWhiteSpace(model.FieldName)) continue; @@ -5101,8 +5112,11 @@ namespace Lskj.PubBill detailTable = ((this.gcMain as TreeGridControlEx).TreeListObj.DataSource as DataTable).TrimDeleteRows(); } - string Autogrowcolumn = SqlHelper.ExecuteScalar(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", BillModel.DetailTable)) + ""; ;//自增长列 - DataTable DetailedProperties = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", BillModel.DetailTable + "_temp"));//单据明细性表 + //string Autogrowcolumn = SqlHelper.ExecuteScalar(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", BillModel.DetailTable)) + ""; ;//自增长列 + //DataTable DetailedProperties = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", BillModel.DetailTable + "_temp"));//单据明细性表 + + string Autogrowcolumn = MainImpl.GetAutogrowcolumn(BillModel.DetailTable); + DataTable DetailedProperties = MainImpl.GetDatabaseProperty(BillModel.DetailTable + "_temp");//单据明细性表 //主键 //DataTable primaryKeydt = BaseImpl.GetDataTableResult(string.Format("SELECT TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME='{0}'", BillModel.DetailTable)); @@ -5131,7 +5145,7 @@ namespace Lskj.PubBill string errorMessage = string.Empty;//数据不符合数据库规范的信息 StringBuilder fields = new StringBuilder(); StringBuilder values = new StringBuilder(); - string detailSql = @"insert into " + BillModel.DetailTable + "_temp" + "({0}) values({1})"; + string detailSql = @"insert into " + BillModel.DetailTable + "_temp" + "({0}) values({1});"; fields.Append("sysstr,"); values.Append("'" + guid + "',"); @@ -5440,8 +5454,10 @@ namespace Lskj.PubBill apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleDataChange, Interface.Api.ActionType.Update);//更新 break; } - if (!string.IsNullOrEmpty(apiHelper.apiResutMsg) && canTipMsg) + if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels) && canTipMsg) + { MessageUtil.Show(apiHelper.apiResutMsg); + } } #endregion this.lblOrderNo.Text = billNo; @@ -5624,8 +5640,10 @@ namespace Lskj.PubBill { ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, billNo, this.BillModel.PrimaryKey, this.BillModel.MasterTable, 0); apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleAuditStateChange, Interface.Api.ActionType.Submit);//提交 - if (!string.IsNullOrEmpty(apiHelper.apiResutMsg)) + if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels)) + { MessageUtil.Show(apiHelper.apiResutMsg); + } } #endregion #region 提交审核成功后是否直接调用新增 @@ -6641,7 +6659,7 @@ namespace Lskj.PubBill XtraTabPage tabPage = this.xtc_left_container.SelectedTabPage; BillSourceUnionModel unionModel = tabPage.Tag as BillSourceUnionModel; DataRow rowItem = unionModel.GridDetailControlObj.GridView.GetFocusedDataRow(); - if (rowItem != null) + if (rowItem != null) { if (!this.BillModel.IsFastDragAddDetail) { @@ -6861,11 +6879,11 @@ namespace Lskj.PubBill // 绘制单据状态文本 if (!string.IsNullOrEmpty(this._waterMark.Text)) { - + if (Business.Impl.LanguageTranslation.Translatable) { - graphicsText.DrawString(this._waterMark.Text, new Font("宋体", 12, FontStyle.Bold), new SolidBrush(Color.Red), new PointF(50, 21), format,0f); + graphicsText.DrawString(this._waterMark.Text, new Font("宋体", 12, FontStyle.Bold), new SolidBrush(Color.Red), new PointF(50, 21), format, 0f); // 测量文本实际尺寸(含字体和格式影响) SizeF textSize = e.Graphics.MeasureString(this._waterMark.Text, new Font("宋体", 12, FontStyle.Bold), new SizeF(float.MaxValue, float.MaxValue), format); int rectWidth = (int)textSize.Width + 10; @@ -6884,14 +6902,14 @@ namespace Lskj.PubBill e.Graphics.RotateTransform(-15f); e.Graphics.DrawRectangle(new Pen(Color.Red, 2f), new Rectangle(14, 20, 55, 21)); } - + } // 绘制打印次数文本 e.Graphics.ResetTransform(); if (!string.IsNullOrEmpty(this._waterMark.Print)) { - + if (Business.Impl.LanguageTranslation.Translatable) { @@ -6913,14 +6931,14 @@ namespace Lskj.PubBill e.Graphics.RotateTransform(-15f); e.Graphics.DrawRectangle(new Pen(Color.Red, 2f), new Rectangle(-35, -14, 70, 21)); } - + } // 绘制收款文本 e.Graphics.ResetTransform(); if (!string.IsNullOrEmpty(this._waterMark.Collect)) { - + if (Business.Impl.LanguageTranslation.Translatable) { @@ -6944,7 +6962,7 @@ namespace Lskj.PubBill e.Graphics.DrawRectangle(new Pen(Color.Red, 2f), new Rectangle(-100, -32, 55, 21)); } - + } } } @@ -6961,7 +6979,7 @@ namespace Lskj.PubBill /// The e. private void OnDragDetailGridCompleted(object sender, GridDragGridArgs e) { - if (this.CanAddDetailRow()) + if (this.CanAddDetailRow()) { List dragRows = new List(); int[] rowHandles = e.SourceGridViewObj.GetSelectedRows(); @@ -6988,7 +7006,7 @@ namespace Lskj.PubBill } } - + } /// @@ -8431,7 +8449,7 @@ namespace Lskj.PubBill /// private void DragDetailGrid_OnDragComplete(object sender, GridDragTreeGridArgs e) { - if (this.CanAddTreeDetailRow()) + if (this.CanAddTreeDetailRow()) { string Pid = "0";//必须父节点必须有默认值,不然如果新增后没有值的话,无法自动展开当前节点 if (e.SelectTreeNode != null) @@ -9764,4 +9782,35 @@ namespace Lskj.PubBill /// /// 说明:删除附件 /// 创建人:龚宇超 - /// 创 \ No newline at end of file + /// 创建日期:2018-02-27 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The sender. + protected void OnImageDeleteEvent(object sender) + { + try + { + LabelImageEdit imageEdit = sender as LabelImageEdit; + if (imageEdit != null) + { + int result = BaseModuleImpl.UpdateRecord(this.BillModel.MasterTable, imageEdit.Model.FieldName, "", this.BillModel.PrimaryKey, this.lblOrderNo.Text); + MessageUtil.Show(result > 0 ? ResourceKeys.OperSuccess : ResourceKeys.OperFault); + } + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + + } + + /// + /// 设置打印按钮条件 + /// + /// + public bool SetPrintButton(DataRow rowItem) + \ No newline at end of file