| | |
| | | using DevExpress.Utils.MVVM.Services; |
| | | using DevExpress.XtraGrid.Views.Base.ViewInfo; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using DevExpress.XtraLayout.Customization; |
| | | using DevExpress.XtraPivotGrid.Data; |
| | | using DevExpress.XtraRichEdit.Model; |
| | | using Gs.DevApp.DevFrm.Rpt; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | InitializeComponent(); |
| | | toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "docStusTxt", "", (value) => |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fgCheckStatusChk", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }, tips); |
| | |
| | | }, lbGuid); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | btnZsm.Click += (s, e) => |
| | | //这是打印,这和其它页面是不一样的,不能复制这里 |
| | | this.ucBtnPrint98.SetPrintButton(false); |
| | | this.ucBtnPrint98.btnAllClick += (s, e) => |
| | | { |
| | | if (!MsgHelper.AskQuestion("确定生成新的追溯码吗?")) |
| | | string rowGuid = txt_aboutGuid.Text.Trim(); |
| | | if (rowGuid.Length < 36) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择你要打印的行!"); |
| | | this.ucBtnPrint98.rptParameter = "return false"; |
| | | return; |
| | | var _obj = new |
| | | } |
| | | SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "追溯码", lbGuid.Text.Trim()); |
| | | string strCodeList = ""; |
| | | string strAction = ""; |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | guid = lbGuid.Text.Trim(), |
| | | strCodeList = ee.StringSingle; |
| | | strAction = ee.Data; |
| | | }; |
| | | try |
| | | frm.ShowDialog(); |
| | | if (string.IsNullOrEmpty(strCodeList)) |
| | | return; |
| | | if (strAction == "print") |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "CreateTrace", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | try |
| | | { |
| | | MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); |
| | | getModel(lbGuid.Text.Trim()); |
| | | string rptParameter = "rpt_trace{" |
| | | + "100" |
| | | + "," + "" |
| | | + "," + "" |
| | | + "," + "" |
| | | + "," + "" |
| | | + "," + strCodeList |
| | | + "}"; |
| | | using (Form rpt = new RptPreview(rowGuid, rptParameter)) |
| | | { |
| | | rpt.ShowDialog(); |
| | | } |
| | | frm.Close(); |
| | | } |
| | | else |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.ShowError(ex.Message); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | }; |
| | | |
| | | //这是追溯码 |
| | | this.ucBtnPrint98.btnPrintClick += (s, e) => |
| | | { |
| | | _print98(); |
| | | |
| | | }; |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) |
| | | { |
| | | string strMsg = "审核"; |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.ShowError("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?")) |
| | | return; |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "CreateTrace", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | MsgHelper.ShowInformation(_rtn.rtnMsg); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(lbGuid.Text.Trim()); |
| | | } |
| | | int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | UtilityHelper.SetCheckIco(gridView1, "fgCheckStatusChk", "fgCheckBy", "fgCheckDatet", picCheckBox, this, 1.ToString()); |
| | | } |
| | | else |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | if (toolBarMenu1.currentAction == "edit") isEdit = true; |
| | | if (string.IsNullOrEmpty(strGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | MsgHelper.ShowError("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | var _obj = new |
| | |
| | | { |
| | | UtilityHelper.SetDefaultTable(gcMx2, gvMx2); |
| | | } |
| | | |
| | | JArray array7 = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list3"]) |
| | | { |
| | | array7.Add(a); |
| | | } |
| | | DataTable dt7 = JsonConvert.DeserializeObject<DataTable>(array7.ToString()); |
| | | if (dt7.Rows.Count > 0) |
| | | { |
| | | gcMx7.BindingContext = new BindingContext(); |
| | | gcMx7.DataSource = dt7; |
| | | gcMx7.ForceInitialize(); |
| | | gvMx7.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx7); |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx7, gvMx7); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 这是追溯码 |
| | | /// </summary> |
| | | private void _print98() |
| | | { |
| | | string rowGuid = txt_daa001.Text.Trim(); |
| | | if (rowGuid.Length < 36) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择你要打印的行!"); |
| | | this.ucBtnPrint98.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_98.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请输入正确的条码数量!"); |
| | | txt_iCount_98.Focus(); |
| | | this.ucBtnPrint98.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | this.ucBtnPrint98.rptParameter = "rpt_trace{" |
| | | + "" |
| | | + "," + txt_printRemark98.Text.Trim() |
| | | + "," + "" |
| | | + "," + txt_iCount_98.Text.Trim() |
| | | + "," + 1 |
| | | + "}"; |
| | | } |
| | | |
| | | } |
| | | } |