using DevExpress.XtraEditors; using DevExpress.XtraEditors.Controls; using DevExpress.XtraGrid.Views.Base.ViewInfo; using DevExpress.XtraGrid.Views.Grid; using Gs.DevApp.DevFrm.Rk; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Threading.Tasks; using System.Windows.Forms; namespace Gs.DevApp.DevFrm { public partial class Frm_MesInvItemArn : XtraForm { private List _filterList = new List(); private readonly string _webServiceName = "MesInvItemArnManager/"; string _ucCk = "";//仓库 string _ucGys = "";//供应商 public Frm_MesInvItemArn() { InitializeComponent(); this.txt_chkAllUrgent.CheckedChanged += ChkAllUrgent_CheckedChanged; toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick; toolBarMenu1.btnRefuseClick += ToolBarMenu1_btnRefuseClick; this.toolBarMenu1.getXmlConfig(); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); }, tips); Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => { getModel(value); }, (value) => { getPageList(this.pageBar1.CurrentPage); }, lbGuid, toolBarMenu1 , () => { ucRptCgdhd1.Initialize(); }); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; //设置组织 this.txt_receiveOrgId.EditChanged += (s, e) => { string _orgId = txt_receiveOrgId.GetId(); if (string.IsNullOrEmpty(_orgId)) return; txt_suppId.getSuppler(_orgId, _ucGys); }; //设置供应商选择 this.txt_suppId.EditChanged += (s, e) => { txtSupplierCode.Text = this.txt_suppId.GetCode(); }; //选择需要入库的明细 btnSelect.Click += (s, e) => { if (string.IsNullOrEmpty(this.txt_receiveOrgId.GetId())) { MsgHelper.Warning("请选择收料组织!"); txt_receiveOrgId.Focus(); return; } if (string.IsNullOrEmpty(this.txt_suppId.GetId())) { Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择供应商,才能选择来料明细!"); return; } var frm = new SelectCgMx(this.txt_suppId.GetId(), txt_receiveOrgId.GetId()); //赋值给明细表 frm.UpdateParent += (ss, ee) => { try { var lst = new List(); lst = ee.StringList; string strReturn = ""; ReturnModel dt; DataTable _oldTable = (DataTable)gcMx1.DataSource; #region 这是Srm来的单子 if (lst == null) { string strSrmNo = ""; List lstSrm = new List(); lstSrm = ee.DynamicList; strSrmNo = lstSrm[0].guid; txt_paperBillNo.Text = strSrmNo; var _obj = new { inShdh = strSrmNo, inP1 = "", inP2 = "" }; strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectSrmTo", JsonConvert.SerializeObject(_obj)); dt = UtilityHelper.ReturnToList(strReturn); //禁止修改数量 gvMx1quantity.OptionsColumn.ReadOnly = true; txt_paperBillNo.ReadOnly = true; txt_isSrm.Checked = true; DataTable _newTable = dt.rtnData; _oldTable = _newTable; } #endregion #region 这是普通的单 else { txt_paperBillNo.Text = ""; var _obj = lst; strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectFormTo", JsonConvert.SerializeObject(_obj)); dt = UtilityHelper.ReturnToList(strReturn); //修改数量 gvMx1quantity.OptionsColumn.ReadOnly = false; txt_paperBillNo.ReadOnly = false; txt_isSrm.Checked = false; DataTable _newTable = dt.rtnData; DataRow[] sourceRows = _newTable.Select(); for (int i = 0; i < sourceRows.Length; i++) { _oldTable.ImportRow(sourceRows[i]); } } #endregion gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = _oldTable; gcMx1.ForceInitialize(); gvMx1.PostEditor(); gvMx1.UpdateCurrentRow(); gvMx1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); } catch (Exception ex) { MessageBox.Show(ex.Message); } }; frm.ShowDialog(); }; } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); Task.Delay(100); getPageList(1); } /// /// 全单急料开关切换事件 /// private void ChkAllUrgent_CheckedChanged(object sender, EventArgs e) { if (gvMx1.DataRowCount == 0) return; if (txt_chkAllUrgent.Properties.ReadOnly) return; bool isUrgent = txt_chkAllUrgent.Checked; string targetTxt = isUrgent ? "1:急料" : "0:普通"; gvMx1.BeginDataUpdate(); try { for (int i = 0; i < gvMx1.DataRowCount; i++) { // 注意:SetRowCellValue 会触发 Grid 的 CellValueChanged 事件(如果有的话) gvMx1.SetRowCellValue(i, "urgentFlagTxt", targetTxt); } } finally { gvMx1.EndDataUpdate(); // 强制刷新视图,确保文字变了 gvMx1.RefreshData(); } } /// /// 分页事件 /// /// /// private void PageBar1_PagerEvent(int curPage, int pageSize) { getPageList(curPage); } /// /// 查询事件 /// /// /// private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e) { if (xtraTabControl1.SelectedTabPageIndex == 0) { gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; gridView1.ActiveFilter.Clear(); gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName); frm.UpdateParent += Frm_UpdateParent; frm.ShowDialog(); return; } ucRptCgdhd1.ToolBarMenu1_btnQueryClick(sender, e); } /// /// 查询回调 /// /// /// private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) { _filterList = e.FilterList; getPageList(1); } /// /// 日志 /// /// /// private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) { toolBarMenu1.guidKey = ""; string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); toolBarMenu1.guidKey = rowGuid; } private void ToolBarMenu1_btnRefuseClick(object sender, EventArgs e) { string _billNo = txt_billNo.Text.Trim(); var frm = new SelectCgDhMx(_billNo); frm.ShowDialog(); } private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) { _toolCk("EditModelSubmit"); } private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) { _toolCk("EditModelSubmitF"); } /// /// 取消事件 /// /// /// private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); } /// /// 删除事件 /// /// /// private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) { string rowGuid = "", rowName = ""; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo"); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.Warning("请先选择你要操作的行!"); return; } if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?")) return; var _obj = new { guid = rowGuid, mxGuid = Guid.Empty.ToString(), }; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModelOrMx", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 0) { } else Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); getPageList(this.pageBar1.CurrentPage); MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); } else MsgHelper.ShowError("提示:" + _rtn.rtnMsg); } catch (Exception ex) { MsgHelper.ShowError("提示:" + ex.Message); } } /// /// 刷新事件 /// /// /// private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) { if (xtraTabControl1.SelectedTabPageIndex == 1) getModel(lbGuid.Text.Trim()); else { //_filterList.Clear(); //if (gridView1.ActiveFilter.Count > 0) //{ // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; // gridView1.ActiveFilter.Clear(); // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; //} //getPageList(1); getPageList(this.pageBar1.CurrentPage); } } /// /// 修改事件 /// /// /// private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) { string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.ShowError("请先选择你要操作的行!"); return; } Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); if (xtraTabControl1.SelectedTabPageIndex == 1) { getModel(rowGuid); } else { List gvList = new List(); gvList.Add(gvMx1); UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); } //2025/07/12加上修改状态下不能修改供应商和组织srm,禁用 setSrm(); txt_receiveOrgId.IsReadly = true; txt_suppId.IsReadly = true; if (txt_chkAllUrgent != null) { // 1. 确保控件启用 txt_chkAllUrgent.Enabled = true; txt_chkAllUrgent.Properties.ReadOnly = false; } } /// /// 新增事件 /// /// /// private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) { lbGuid.Text = ""; Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); List gridViews = new List(); gridViews.Add(gvMx1); UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); //增加时,默认组织 string deftOrg = UtilityHelper.GetFirstOrg(txt_receiveOrgId); txt_isSrm.Checked = false; setSrm(); } /// /// 保存事件 /// /// /// private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) { toolBarMenu1.isSetBtn = false; string _orgId = txt_receiveOrgId.GetId(); string _gysId = txt_suppId.GetId(); //供应商编号 if (string.IsNullOrEmpty(_orgId)) { MsgHelper.ShowError("请选择收料组织!"); txt_receiveOrgId.Focus(); return; } if (string.IsNullOrEmpty(_gysId)) { MsgHelper.ShowError("请选择供应商!"); txt_suppId.Focus(); return; } var _obj = new { Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()), //到货单主键 PaperBillNo = txt_paperBillNo.Text.Trim(), //送货单号; Remark = txt_remark.Text.Trim(), //备注 SuppId = _gysId, //供应商 OrgId = _orgId, IsSrm = (txt_isSrm.Checked ? 1 : 0), list = new List(), }; gvMx1.CloseEditor(); gvMx1.PostEditor(); gvMx1.UpdateCurrentRow(); if (gvMx1.DataRowCount <= 0) { MsgHelper.ShowError("明细不能为空,请选择你的收料明细!"); return; } for (var i = 0; i < gvMx1.DataRowCount; i++) { var row = gvMx1.GetDataRow(i); if (row != null) { Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString()); string _msl = row["quantity"].ToString(); if (string.IsNullOrEmpty(_msl)) { MsgHelper.ShowError("数量不能为空!"); return; } _obj.list.Add(new { Guid = _guid, AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["aboutGuid"].ToString()), ItemId = int.Parse(row["itemId"].ToString()), Quantity = decimal.Parse(row["quantity"].ToString()), // 这段保存代码不用动,它能自动识别上面设置的文字 UrgentFlag = (row["urgentFlagTxt"] != null && row["urgentFlagTxt"].ToString().Contains("急料")) ? "1" : "0", Remark = row["memo"].ToString(), }); } } try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); lbGuid.Text = _rtn.rtnData.outGuid; txt_billNo.Text = _rtn.rtnData.outNo; toolBarMenu1.isSetBtn = true; List gvList = new List(); gvList.Add(gvMx1); UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false); toolBarMenu1.currentAction = ""; Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); } else MsgHelper.ShowError("提示:" + _rtn.rtnMsg); } catch (Exception ex) { MsgHelper.ShowError("提示:" + ex.Message); } } /// /// /// 第几页 /// 每页几条 private void getPageList(int curPage) { gcMain1.DataSource = null; System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); _sbSqlWhere.Append(" and a.ReceiveOrgId in"); _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); var json = JsonConvert.SerializeObject(pgq); try { var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json); var dd = UtilityHelper.ReturnToTablePage(strReturn); if (dd.rtnCode > 0) { DataTable dt = dd.rtnData.list; gcMain1.BindingContext = new BindingContext(); gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; if (dt.Rows.Count > 0) { gcMain1.DataSource = dt; gcMain1.ForceInitialize(); gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); } else UtilityHelper.SetDefaultTable(gcMain1, gridView1); gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; pageBar1.TotalPages = dd.rtnData.pages;//总页 pageBar1.CurrentPage = curPage;//当前页 pageBar1.RecordCount = dd.rtnData.total;//总记录数 } else { ToolBox.MsgHelper.ShowError("提示:" + dd.rtnMsg); } } catch (Exception ex) { MsgHelper.Warning("提示:" + ex.Message); } } private void getModel(string strGuid) { bool isEdit = false; if (toolBarMenu1.currentAction == "add") return; if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { MsgHelper.Warning("请先选择你要操作的行!"); return; } var _obj = new { guid = strGuid //主建 }; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { var dy = _rtn.rtnData; _ucGys = dy.suppId; _ucCk = dy.depotsId; lbGuid.Text = strGuid; var gvList = new List(); gvList.Add(gvMx1); gvList.Add(gvMx2); UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList); _ucGys = ""; _ucCk = ""; var _job = JObject.Parse(strJson); var array = new JArray(); foreach (var a in _job["rtnData"]["list"]) array.Add(a); var dt = JsonConvert.DeserializeObject( array.ToString()); if (dt.Rows.Count > 0) { gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); gvMx1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); if (txt_chkAllUrgent != null) { txt_chkAllUrgent.CheckedChanged -= ChkAllUrgent_CheckedChanged; bool allUrgent = true; foreach (DataRow dr in dt.Rows) { // 假设字段名是 urgentFlagTxt,值是 "1:急料" string val = dr["urgentFlagTxt"]?.ToString() ?? ""; if (!val.Contains("1:急料")) { allUrgent = false; break; } } // 3. 设置开关状态 txt_chkAllUrgent.Checked = allUrgent; //4.根据当前模式(编辑 / 查看)决定是否可用 //如果是 add 或 edit 模式,且有权限,则允许点击 txt_chkAllUrgent.Enabled = isEdit || toolBarMenu1.currentAction == "add"; txt_chkAllUrgent.Properties.ReadOnly = !(isEdit || toolBarMenu1.currentAction == "add"); txt_chkAllUrgent.CheckedChanged += ChkAllUrgent_CheckedChanged; } } else { UtilityHelper.SetDefaultTable(gcMx1, gvMx1); } JArray array2 = new JArray(); foreach (var a in dy["list2"]) { array2.Add(a); } DataTable dt2 = JsonConvert.DeserializeObject(array2.ToString()); if (dt2.Rows.Count > 0) { gcMx2.BindingContext = new BindingContext(); gcMx2.DataSource = dt2; gcMx2.ForceInitialize(); gvMx2.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2); } else { Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); } } else { MsgHelper.Warning("提示:" + _rtn.rtnMsg); } } catch (Exception ex) { MsgHelper.Warning("提示:" + ex.Message); } } /// /// 明细删除 /// /// /// private void repositoryItemButtonEdit1_ButtonClick(object sender, ButtonPressedEventArgs e) { var rowhandle = gvMx1.FocusedRowHandle; if (rowhandle < 0) return; if (e.Button.Index == 0) { var dr = gvMx1.GetDataRow(rowhandle); var mxGuid = dr["guid"].ToString(); if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?")) return; if (string.IsNullOrEmpty(mxGuid)) { gvMx1.DeleteRow(rowhandle); return; } var _obj = new { guid = lbGuid.Text.Trim(), mxGuid = mxGuid, }; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModelOrMx", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { if (_rtn.rtnCode > 0) getModel(lbGuid.Text); } MsgHelper.Warning("提示:" + _rtn.rtnMsg); } catch (Exception ex) { MsgHelper.Warning("提示:" + ex.Message); } } } /// /// 明细退货 /// /// /// private void repositoryItemButtonEdit2_ButtonClick(object sender, ButtonPressedEventArgs e) { var rowhandle = gvMx1.FocusedRowHandle; if (rowhandle < 0) return; if (e.Button.Index == 0) { var dr = gvMx1.GetDataRow(rowhandle); var mxGuid = dr["guid"].ToString(); if (!MsgHelper.AskQuestion("你选择了1条数据,确定退货吗?")) return; if (string.IsNullOrEmpty(mxGuid)) { Gs.DevApp.ToolBox.MsgHelper.ShowError("暂未保存,不能退货!"); return; } var lst = new List(); lst.Add(mxGuid); var _obj = lst; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "TuiMx", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); } else MsgHelper.ShowError("提示:" + _rtn.rtnMsg); } catch (Exception ex) { MsgHelper.ShowError("提示:" + ex.Message); } } } /// /// 检验和反检验 /// /// private void _toolCk(string _meth) { string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo"); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.Warning("请先选择你要操作的行!"); return; } if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定操作吗?")) return; var _obj = new { guid = rowGuid, }; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + _meth, JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) { MsgHelper.ShowInformation("提示:" + _rtn.rtnData.outMsg); if (xtraTabControl1.SelectedTabPageIndex == 1) { getModel(lbGuid.Text.Trim()); } int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); gridView1.FocusedRowHandle = rowHandle; int _inFieldValue = (_meth == "EditModelSubmit" ? 1 : -1); UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString()); } else MsgHelper.ShowError("提示:" + _rtn.rtnData.outMsg); } catch (Exception ex) { MsgHelper.ShowError("提示:" + ex.Message); } } /// /// 查看到货记录,根据采购明细guid /// /// /// private void rptHistory_ButtonClick(object sender, ButtonPressedEventArgs e) { var rowhandle = gvMx1.FocusedRowHandle; if (rowhandle < 0) return; var dr = gvMx1.GetDataRow(rowhandle); var mxGuid = dr["aboutGuid"].ToString(); HistoryDhmxcs frm = new HistoryDhmxcs(mxGuid); frm.ShowDialog(); } private void setSrm() { bool isSrm = (txt_isSrm.Checked); if (isSrm == true) { gvMx1quantity.OptionsColumn.ReadOnly = true; txt_paperBillNo.ReadOnly = true; txt_isSrm.Checked = true; txt_receiveOrgId.IsReadly = true; txt_suppId.IsReadly = true; btnSelect.Enabled = false; } else { gvMx1quantity.OptionsColumn.ReadOnly = false; txt_paperBillNo.ReadOnly = false; txt_isSrm.Checked = false; txt_receiveOrgId.IsReadly = false; txt_suppId.IsReadly = false; btnSelect.Enabled = true; } } /// /// 这是打印 /// /// /// private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e) { //guidKey, rptParameter string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo"); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.ShowError("请先选择你要操作的行!"); return; } this.toolBarMenu1.rptParameter = "rpt_CGRK{" + "100" + "," + "" + "," + "" + "," + "" + "," + "" + "}"; this.toolBarMenu1.guidKey = rowGuid; } } }