diff --git a/插件库/Lskj.Control/FrmBackSelectEx.cs b/插件库/Lskj.Control/FrmBackSelectEx.cs index 1cccd8e..2df61be 100644 --- a/插件库/Lskj.Control/FrmBackSelectEx.cs +++ b/插件库/Lskj.Control/FrmBackSelectEx.cs @@ -53,6 +53,10 @@ namespace Lskj.Control /// public string StepCode; /// + /// 意见框 + /// + public LabelRemarkEdit LabelAdvice { get { return this.txt_advice; } } + /// /// 说明:审批表格双击弹出模块审批回调 /// 创建人:龚宇超 /// 创建日期:2017-12-21 @@ -115,32 +119,4 @@ namespace Lskj.Control catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); - MessageUtil.Show("选择反退步骤确定操作出错!" + Message); - } - - } - /// - /// 说明:取消操作/para> - /// 创建人:龚宇超 - /// 创建日期:2017-01-23 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The source of the event. - /// The instance containing the event data. - private void btnCancel_Click(object sender, EventArgs e) - { - try { - if (BtnCancelCallBack != null) BtnCancelCallBack(sender, e); - } - catch (Exception ex) - { - string Message = ErrorMessage.PromptErrorMessage(ex); - MessageUtil.Show(Message,ex.Message); - } - - } - } -} + MessageUtil.Show("选择 \ No newline at end of file diff --git a/插件库/Lskj.Control/GridControlEx.cs b/插件库/Lskj.Control/GridControlEx.cs index 4705d00..451abdd 100644 --- a/插件库/Lskj.Control/GridControlEx.cs +++ b/插件库/Lskj.Control/GridControlEx.cs @@ -51,6 +51,7 @@ using DevExpress.XtraPrinting.BarCode.Native; using Spire.Barcode; using System.Threading.Tasks; using System.Collections; +using Newtonsoft.Json; namespace Lskj.Control { @@ -1073,7 +1074,7 @@ namespace Lskj.Control foreach (GridColumnModel item in mControlList) { if (this.DisableFieldSources && item.isVislble) continue; - if(ControlType.IsNotLoadData(item.FieldType)) continue; + if (ControlType.IsNotLoadData(item.FieldType)) continue; if (!string.IsNullOrWhiteSpace(item.SqlSource)) { DataTable dataTable = new DataTable(); @@ -1795,8 +1796,8 @@ namespace Lskj.Control calcExpr = ReplaceHelper.ReplaceRowParam(rowItem, calcExpr); //EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr)) + "" - - result = EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr)) + ""; + object evalResult = EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr)); + result = JsonConvert.SerializeObject(evalResult); if (result.Contains("E") || result.Contains("e")) @@ -1940,17 +1941,22 @@ namespace Lskj.Control public void UpperChange(GridColumnModel model, GridColumnModel gridModel, int RowHandle) { DataTable Table = this.gridControl.DataSourceTable(); - DataRow rowItem = Table.Rows[RowHandle]; + DataRow rowItem = this.GridView.GetDataRow(RowHandle); string UpperFieldName = ReplaceHelper.GetParamFields(gridModel.DefaultValue)[0]; UpperFieldName = UpperFieldName.Replace("}", "").Replace("{", ""); UpperFieldName = UpperFieldName.Substring(UpperFieldName.IndexOf('_') + 1); if (string.IsNullOrWhiteSpace(rowItem[gridModel.FieldName] + "") || this.gridView.FocusedRowHandle != RowHandle) { - if (RowHandle != 0 && Table.Columns.Contains(ERPInfo.Instance.isAddRows)) + if (Table.Rows.Count > 0 && Table.Columns.Contains(ERPInfo.Instance.isAddRows)) { + DataRow lastRow = Table.Rows[Table.Rows.Count - 1]; + if (RowHandle > 0) + { + lastRow = Table.Rows[RowHandle - 1]; + } if (rowItem[ERPInfo.Instance.isAddRows] + "" != "1") { - rowItem[gridModel.FieldName] = gridModel.DefaultValue.StartsWith("@") ? BaseImpl.GetDefaultValue(ReplaceHelper.ReplaceParamToValue(gridModel.DefaultValue, Table.Rows[RowHandle - 1][UpperFieldName] + "")) : rowItem[gridModel.FieldName] = Table.Rows[RowHandle - 1][UpperFieldName] + ""; + rowItem[gridModel.FieldName] = gridModel.DefaultValue.StartsWith("@") ? BaseImpl.GetDefaultValue(ReplaceHelper.ReplaceParamToValue(gridModel.DefaultValue, lastRow[UpperFieldName] + "")) : rowItem[gridModel.FieldName] = lastRow[UpperFieldName] + ""; } rowItem[ERPInfo.Instance.isAddRows] = "1"; } @@ -1963,7 +1969,7 @@ namespace Lskj.Control this.SetCalcValue(model, rowItem[gridModel.FieldName] + "", RowHandle); } string[] fields = !string.IsNullOrEmpty(gridModel.UnionFields) ? gridModel.UnionFields.Trim(',').Split(',') : new string[] { }; - if (RowHandle < Table.Rows.Count - 1 && ((fields.Contains(model.FieldName)) || model.FieldName == UpperFieldName || model.FieldName == gridModel.FieldName)) + if (RowHandle >= 0 && RowHandle < Table.Rows.Count - 1 && ((fields.Contains(model.FieldName)) || model.FieldName == UpperFieldName || model.FieldName == gridModel.FieldName)) { if (Table.Columns.Contains(ERPInfo.Instance.isAddRows)) { @@ -2053,7 +2059,7 @@ namespace Lskj.Control int.TryParse(rowItem["fieldWidth"] + "", out int fieldWidth); //int.TryParse(rowItem["orderid"] + "", out int index); //2025-02-20 依米康把orderid字段类型改成了decimal(18, 2),不能int.TryParse直接转换 - int index =Convert.ToInt32(Math.Round(double.Parse(rowItem["orderid"] + ""))); + int index = Convert.ToInt32(Math.Round(double.Parse(rowItem["orderid"] + ""))); bool visible = "1".Equals(rowItem["isVisible"] + "") && fieldWidth > 0; bool isFix = "True".Equals(rowItem["IfFixColumn"] + "", StringComparison.OrdinalIgnoreCase); string FilterInfo = rowItem.Table.Columns.Contains("FilterInfo") ? rowItem["FilterInfo"] + "" : "";//列筛选条件 @@ -5456,7 +5462,7 @@ namespace Lskj.Control { if (e.Column.Tag == null) return; GridColumnModel model = e.Column.Tag as GridColumnModel; - + DataRow rowHandleRow = this.GridView.GetDataRow(e.RowHandle); //值改变时,如果是验证是否重复的列报错就清除 if (RepeatedVerificationNames.Count > 0) @@ -5464,9 +5470,9 @@ namespace Lskj.Control DataColumn[] datas = this.GridView.GetDataRow(e.RowHandle).GetColumnsInError(); foreach (DataColumn item in datas) { - if (this.GridView.GetDataRow(e.RowHandle).GetColumnError(item.ColumnName).Equals("数据重复")) + if (rowHandleRow.GetColumnError(item.ColumnName).Equals("数据重复")) { - this.GridView.GetDataRow(e.RowHandle).ClearErrors(); + rowHandleRow.ClearErrors(); break; } } @@ -5480,7 +5486,6 @@ namespace Lskj.Control GridView gridView = this.gridControl.MainView as GridView; - int rowHandle = gridView.GetDataSourceRowIndex(e.RowHandle); DataTable dataTable = this.gridControl.DataSourceTable(); //根据某一列的值自动填充对应值 if (this.AutoPadDataReleColList.Count > 0) @@ -5489,7 +5494,7 @@ namespace Lskj.Control { if (!string.IsNullOrEmpty(selectColumnModel.AutoPadDataReleColName)) { - string value = dataTable.Rows[rowHandle][selectColumnModel.FieldName] + ""; + string value = rowHandleRow[selectColumnModel.FieldName] + ""; string[] dataReleColNames = selectColumnModel.AutoPadDataReleColName.TrimEnd(',').Split(','); if (dataReleColNames.Contains(e.Column.FieldName)) { @@ -5517,18 +5522,17 @@ namespace Lskj.Control this.SetUnionValue(model, e.Value + "", e.RowHandle); } //计算规则配置在结果字段上,所以无需验证当前操作控件 - this.SetCalcValue(model, e.Value + "", rowHandle); + this.SetCalcValue(model, e.Value + "", e.RowHandle); this.SetUpperValue(model, e.RowHandle, e.Value + ""); this.SetDisableColumn(model, e.RowHandle, e.Value + ""); //验证数据长度 if (model.LimitLength > 0 && e.Value != null) { - DataRow HandleRow = this.gridView.GetDataRow(e.RowHandle); int MaxInputLength = System.Text.Encoding.Default.GetBytes(e.Value.ToString()).Length; if (model.LimitLength < MaxInputLength) - HandleRow.SetColumnError(HandleRow.Table.Columns[e.Column.ColumnHandle], "当前输入文本超过设定长度!");//满足条件设置错误信息 + rowHandleRow.SetColumnError(rowHandleRow.Table.Columns[e.Column.ColumnHandle], "当前输入文本超过设定长度!");//满足条件设置错误信息 else - HandleRow.ClearErrors();//清除错误信息 + rowHandleRow.ClearErrors();//清除错误信息 } //var rows = this.gridControl.DataSourceTable().Select().ToList().Where(n => n[e.Column.FieldName].Equals(Convert.ChangeType(e.Value, e.Column.ColumnType))); diff --git a/插件库/Lskj.Control/LabelImageEdit.Designer.cs b/插件库/Lskj.Control/LabelImageEdit.Designer.cs index f229a59..6fe615d 100644 --- a/插件库/Lskj.Control/LabelImageEdit.Designer.cs +++ b/插件库/Lskj.Control/LabelImageEdit.Designer.cs @@ -32,19 +32,18 @@ this.cmsMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.tsmi_cut = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_copy = new System.Windows.Forms.ToolStripMenuItem(); - this.tsmi_paste = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_delete = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.tsmi_load = new System.Windows.Forms.ToolStripMenuItem(); this.tsmi_Preview = new System.Windows.Forms.ToolStripMenuItem(); - this.plLeft = new System.Windows.Forms.Panel(); - this.lblText = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.imgFile = new DevExpress.XtraEditors.PictureEdit(); + this.plLeft = new System.Windows.Forms.Panel(); + this.lblText = new System.Windows.Forms.Label(); this.cmsMenu.SuspendLayout(); - this.plLeft.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.imgFile.Properties)).BeginInit(); + this.plLeft.SuspendLayout(); this.SuspendLayout(); // // cmsMenu @@ -54,7 +53,6 @@ this.cmsMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsmi_cut, this.tsmi_copy, - this.tsmi_paste, this.tsmi_delete, this.toolStripSeparator2, this.tsmi_load, @@ -79,14 +77,6 @@ this.tsmi_copy.Text = "拷贝"; this.tsmi_copy.Click += new System.EventHandler(this.tsmi_copy_Click); // - // tsmi_paste - // - this.tsmi_paste.Image = global::Lskj.Control.Properties.Resources.paste; - this.tsmi_paste.Name = "tsmi_paste"; - this.tsmi_paste.Size = new System.Drawing.Size(184, 26); - this.tsmi_paste.Text = "粘贴"; - this.tsmi_paste.Click += new System.EventHandler(this.tsmi_paste_Click); - // // tsmi_delete // this.tsmi_delete.Image = global::Lskj.Control.Properties.Resources.delete; @@ -116,24 +106,6 @@ this.tsmi_Preview.Text = "预览"; this.tsmi_Preview.Click += new System.EventHandler(this.tsmi_Preview_Click); // - // plLeft - // - this.plLeft.Controls.Add(this.lblText); - this.plLeft.Dock = System.Windows.Forms.DockStyle.Left; - this.plLeft.Location = new System.Drawing.Point(0, 0); - this.plLeft.Name = "plLeft"; - this.plLeft.Size = new System.Drawing.Size(40, 135); - this.plLeft.TabIndex = 4; - // - // lblText - // - this.lblText.AutoSize = true; - this.lblText.Location = new System.Drawing.Point(5, 4); - this.lblText.Name = "lblText"; - this.lblText.Size = new System.Drawing.Size(29, 12); - this.lblText.TabIndex = 0; - this.lblText.Text = "名称"; - // // panel1 // this.panel1.Controls.Add(this.imgFile); @@ -156,6 +128,24 @@ this.imgFile.TabIndex = 1; this.imgFile.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.imgFile_MouseDoubleClick); // + // plLeft + // + this.plLeft.Controls.Add(this.lblText); + this.plLeft.Dock = System.Windows.Forms.DockStyle.Left; + this.plLeft.Location = new System.Drawing.Point(0, 0); + this.plLeft.Name = "plLeft"; + this.plLeft.Size = new System.Drawing.Size(40, 135); + this.plLeft.TabIndex = 4; + // + // lblText + // + this.lblText.AutoSize = true; + this.lblText.Location = new System.Drawing.Point(5, 4); + this.lblText.Name = "lblText"; + this.lblText.Size = new System.Drawing.Size(29, 12); + this.lblText.TabIndex = 0; + this.lblText.Text = "名称"; + // // LabelImageEdit // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -164,28 +154,4 @@ this.Controls.Add(this.plLeft); this.Name = "LabelImageEdit"; this.Size = new System.Drawing.Size(191, 135); - this.cmsMenu.ResumeLayout(false); - this.plLeft.ResumeLayout(false); - this.plLeft.PerformLayout(); - this.panel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.imgFile.Properties)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ContextMenuStrip cmsMenu; - private System.Windows.Forms.ToolStripMenuItem tsmi_cut; - private System.Windows.Forms.ToolStripMenuItem tsmi_copy; - private System.Windows.Forms.ToolStripMenuItem tsmi_paste; - private System.Windows.Forms.ToolStripMenuItem tsmi_delete; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripMenuItem tsmi_load; - private System.Windows.Forms.Panel plLeft; - private System.Windows.Forms.Label lblText; - private System.Windows.Forms.Panel panel1; - private DevExpress.XtraEditors.PictureEdit imgFile; - private System.Windows.Forms.ToolStripMenuItem tsmi_Preview; - } -} + this.cmsMenu.ResumeLayou \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelImageEdit.cs b/插件库/Lskj.Control/LabelImageEdit.cs index 2c9afa8..2882cba 100644 --- a/插件库/Lskj.Control/LabelImageEdit.cs +++ b/插件库/Lskj.Control/LabelImageEdit.cs @@ -632,7 +632,7 @@ namespace Lskj.Control //tsmi_union.Enabled = true; //tsmi_upload.Enabled = !isImage; - tsmi_paste.Enabled = ClipboardHelper.ContainsImage(); + //tsmi_paste.Enabled = ClipboardHelper.ContainsImage(); } catch (Exception ex) { @@ -673,31 +673,4 @@ namespace Lskj.Control /// The name. private void InvokeMenuMethod(PictureMenu menu, string name) { - MethodInfo mi = typeof(PictureMenu).GetMethod(name, BindingFlags.NonPublic | BindingFlags.Instance); - if (mi != null && menu != null) - mi.Invoke(menu, new object[] { menu, new EventArgs() }); - } - /// - /// 说明:获取右键菜单 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The edit. - /// PictureMenu. - /// - private PictureMenu getMenu(PictureEdit edit) - { - PropertyInfo pi = typeof(PictureEdit).GetProperty("Menu", BindingFlags.NonPublic | BindingFlags.Instance); - if (pi != null) - return pi.GetValue(edit, null) as PictureMenu; - return null; - } - #endregion - - - } -} + MethodInfo mi = typeof(PictureM \ No newline at end of file diff --git a/插件库/Lskj.Control/Model/MyControl.cs b/插件库/Lskj.Control/Model/MyControl.cs index 105c0b5..6b41c25 100644 --- a/插件库/Lskj.Control/Model/MyControl.cs +++ b/插件库/Lskj.Control/Model/MyControl.cs @@ -10,6 +10,7 @@ using Lskj.Core; using Lskj.Data; using Lskj.Model; using Lskj.Util; +using Newtonsoft.Json; using Qhzd.Control; using System; using System.Collections; @@ -4692,7 +4693,9 @@ namespace Lskj.Control.Model { if (string.IsNullOrWhiteSpace(fieldValue)) fieldValue = "0"; calcExpr = ReplaceControlValue(calcExpr.Replace("{" + model.FieldName + "}", fieldValue)); - calcValue = EvalHelper.Eval(ReplaceHelper.ReplaceEvalCond(calcExpr)) + ""; + object evalResult = EvalHelper.Eval(ReplaceHelper.ReplaceEvalCond(calcExpr)); + calcValue = JsonConvert.SerializeObject(evalResult); + //calcValue = EvalHelper.Eval(ReplaceHelper.ReplaceEvalCond(calcExpr)) + ""; } if (isTruncate) { @@ -5234,6 +5237,32 @@ namespace Lskj.Control.Model /// The instance containing the event data. protected void OnSimpleButtonClick(object sender, EventArgs e) { + try + { + bool allowBefore = ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeSearchBtnClick, Model.ModuleCode, 0); + //查询前调用Api接口 + if (allowBefore) + { + DataRow dataRow = this.GetAllControlValueRow(); + ApiHelper apiHelper = new ApiHelper(Model.ModuleCode, 0, dataRow); + apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeSearchBtnClick, Interface.Api.ActionType.None); + if (apiHelper.apiHandlerModels.Count > 0) + { + Hashtable hashtable = apiHelper.apiHandlerModels[apiHelper.apiHandlerModels.Count - 1].resultPmsHashtables[0]; + if (hashtable.ContainsKey("result")) + { + string jsonResult = hashtable["result"] + ""; + DataTable dataTable = JsonConvert.DeserializeObject(jsonResult); + this._mainGridEx.SetGridViewDataSource(dataTable); + return; + } + } + } + } + catch (Exception ex) + { + MessageUtil.Show(ex.Message); + } SearchArgs args = new SearchArgs(); // 查询之前 if (OnSearchBeforeCallBack != null) @@ -5553,30 +5582,4 @@ namespace Lskj.Control.Model LabelDateEdit dateEdit = controlObj as LabelDateEdit; value = dateEdit.TextEdit.EditValue == null ? dateEdit.EditText : dateEdit.TextEdit.DateTime.ToString("yyyy-MM-dd"); } - else if (controlObj is LabelCheckEdit) - { - LabelCheckEdit checkEdit = controlObj as LabelCheckEdit; - value = checkEdit.EditText; - } - else if (controlObj is LabelComboxEdit) - { - LabelComboxEdit autoEdit = controlObj as LabelComboxEdit; - value = autoEdit.EditValue; - } - else if (controlObj is LabelTextEdit) - { - LabelTextEdit textIntEdit = controlObj as LabelTextEdit; - if (textIntEdit != null) value = string.IsNullOrEmpty(textIntEdit.EditText) ? "0" : textIntEdit.EditText; - } - - defaultValue = defaultValue.Replace(item, value); - } - - } - } - return defaultValue; - } - - - } -} \ No newline at end of file + else if \ No newline at end of file diff --git a/插件库/Lskj.Control/ModuleEx.cs b/插件库/Lskj.Control/ModuleEx.cs index e8f6ed5..669231d 100644 --- a/插件库/Lskj.Control/ModuleEx.cs +++ b/插件库/Lskj.Control/ModuleEx.cs @@ -248,7 +248,6 @@ namespace Lskj.Control this.treeLeft.Visible = false; this.treeGridLeft.Expansion = this.SysModel.TreeTableExpand; this.ModuleGridObj.TreeExactQuery = this.SysModel.TreeExactQuery; - } this.ModuleGridObj.LeftGridEx = this.SysModel.IsTreeTable ? this.treeGridLeft : this.gridLeft; @@ -1084,7 +1083,7 @@ namespace Lskj.Control //设置上一次选中节点,没有保存的节点就默认选中第一个 this.treeGridLeft.TreeListObj.FocusedNode = treeListNode != null ? treeListNode : this.treeGridLeft.TreeListObj.Nodes[0]; //保存右侧主表 - this.ModuleGridObj.SaveGridRecord(false); + this.ModuleGridObj.SaveWhenSwitching(); //恢复点击节点 //this.treeGridLeft.TreeListObj.FocusedNode = currentNode; this.treeGridLeft.TreeListObj.FocusedNode = this.treeGridLeft.TreeListObj.GetNodeByVisibleIndex(lastNodeIndex); @@ -1525,32 +1524,4 @@ namespace Lskj.Control using (BinaryReader r = new BinaryReader(fs)) { byte[] buffer = r.ReadBytes((int)fs.Length); - int Result = BaseModuleImpl.SaveImage(this.SysModel.MenuTable, _labPicName, this.SysModel.ParmaryKey, this._currentRow[this.SysModel.ParmaryKey] + "", buffer); - MessageUtil.Show(Result > 0 ? ResourceKeys.SaveSuccess : ResourceKeys.SaveFault); - } - } - } - catch (Exception ex) - { - - string Message = ErrorMessage.PromptErrorMessage(ex); - MessageUtil.Show(Message, ex.Message); - } - - } - - /// - /// 判断是否是selete开头(可以处理sql前方有注释和空格的情况) - /// - /// - /// - public static bool IsSelectAtStart(string sqlText) - { - // Remove comments and whitespace at the start of the text - string cleanedText = Regex.Replace(sqlText, @"^(\s*--.*?(\r\n|\n)|\s*)*", ""); - // Check if the remaining text starts with 'select' - return cleanedText.StartsWith("select", StringComparison.OrdinalIgnoreCase); - } - - } -} \ No newline at end of file + int Result = BaseModuleImpl.SaveImage(this.SysModel.MenuTable, _labPicName, this.SysModel.ParmaryKey, this._currentRow[this.SysModel.ParmaryK \ No newline at end of file diff --git a/插件库/Lskj.Control/ModuleGridEx.cs b/插件库/Lskj.Control/ModuleGridEx.cs index 0c8fcfe..5a0fd8d 100644 --- a/插件库/Lskj.Control/ModuleGridEx.cs +++ b/插件库/Lskj.Control/ModuleGridEx.cs @@ -444,6 +444,7 @@ namespace Lskj.Control if (!Model.DataCaches.GetValue(this, "SearchObj", out MyControl searchObj)) { searchObj = new MyControl(ReplaceBmpField(this.SysModel.MenuSql), gcMain, LeftTreeViewEx, LeftGridEx, _leftGridSearchObj);//替换sql语句中的bmp字段 + searchObj.Model = Model; } this.SearchObj = searchObj; @@ -1411,7 +1412,7 @@ namespace Lskj.Control //Tips = "条件判断错误:\r\n" + Tips; //string Message = ErrorMessage.PromptErrorMessage(ex, "", Tips); ////MessageUtil.Show("条件判断错误:\r\n" + Tips); - if(!ex.Message.Equals("该字符串未被识别为有效的布尔值。")) LogHelper.Instance.WriteError(ex); + if (!ex.Message.Equals("该字符串未被识别为有效的布尔值。")) LogHelper.Instance.WriteError(ex); } return result; } @@ -1740,7 +1741,6 @@ namespace Lskj.Control { view.SetRowCellValue(view.FocusedRowHandle, column, fieldValue); } - } else { @@ -1768,17 +1768,18 @@ namespace Lskj.Control } // 右键调用赋值 if (this.DetailKeyField == model.FieldName) + { view.SetRowCellValue(view.FocusedRowHandle, column, ParentKeyValue); + } } // 右键菜单调用时赋值sql语句 if (controlRowItem != null && controlRowItem.Table.Columns.Contains(column.FieldName)) { - - //if (dt.Rows[view.FocusedRowHandle][ERPInfo.Instance.isAddRows] != "1") - //{ - // view.SetRowCellValue(view.FocusedRowHandle, column, controlRowItem[column.FieldName]); - //} - view.SetRowCellValue(view.FocusedRowHandle, column, controlRowItem[column.FieldName]); + DataRow dataRow = view.GetDataRow(view.FocusedRowHandle); + if (dataRow != null && !(dataRow[ERPInfo.Instance.isAddRows] + "").Equals("1")) + { + view.SetRowCellValue(view.FocusedRowHandle, column, controlRowItem[column.FieldName]); + } } } } @@ -2630,7 +2631,7 @@ namespace Lskj.Control { if (MessageUtil.Show(mList[0].FaultMsg, MessageBoxButtons.YesNo) == DialogResult.Yes) { - if (BaseModuleImpl.SaveBaseGridData(mList)) + if (BaseModuleImpl.SaveBaseGridData(mList, "1")) { (gcMain.GridControl.DataSource as DataTable).AcceptChanges(); if (this.SearchObj != null) @@ -4132,7 +4133,7 @@ namespace Lskj.Control { LogUtil.WriteError("基础档案明细保存失败", ex); } - IsApi: if (isExec) + IsApi: if (isExec) { this.SaveGridRecord(); if (OnSaveGridCallBack != null) @@ -5063,4 +5064,4 @@ namespace Lskj.Control int focusedRowHandle = this.gcMain.GridView.FocusedRowHandle; GridColumn[] Columns = this.gcMain.GridView.GetSelectedCells(focusedRowHandle);//当前选中的单元格 //判断是否为最后一行,最后一列 - if (Columns.Length > 0 && Columns[0].VisibleIndex == this.gcMain.GridView.Columns. \ No newline at end of file + if (Columns.Length > 0 && Columns[0].VisibleIndex == this.gcMain.GridView.Columns.C \ No newline at end of file