| | |
| | | { |
| | | string _webServiceName = "MesItemTblManager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | string _ucGg = ""; |
| | | public Frm_MesItemTbl() |
| | | { |
| | | InitializeComponent(); |
| | |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "tbl013", "", (value) => |
| | |
| | | }, (value) => |
| | | { |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | }); |
| | | }, lbGuid); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | //设置组织 |
| | |
| | | { |
| | | string orgdId = txt_tbl023.GetId(); |
| | | if (string.IsNullOrEmpty(orgdId)) return; |
| | | txt_tbl002.getSuppler(orgdId); |
| | | txt_tbl002.getSuppler(orgdId, _ucGg); |
| | | }; |
| | | //设置工单子 |
| | | txt_tbl002.EditChanged += (s, e) => |
| | |
| | | if (string.IsNullOrEmpty(daaId)) return; |
| | | txt_rwd.Text = txt_tbl002.GetRwd(); |
| | | txt_workName.Text = txt_tbl002.GetWorkName(); |
| | | txt_lineName.Text = txt_tbl002.GetPrdName(); |
| | | txt_itemName.Text = txt_tbl002.GetPrdModel(); |
| | | }; |
| | | //选择需要入库的明细 |
| | |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = _oldTable; |
| | | gcMx1.ForceInitialize(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | + "}"; |
| | | }; |
| | | } |
| | | |
| | | private async void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); |
| | | await Task.Delay(100); |
| | | getPageList(1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 日志 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | 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; |
| | | } |
| | | /// <summary> |
| | | /// 分页事件 |
| | | /// </summary> |
| | |
| | | gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | gridView1.ActiveFilter.Clear(); |
| | | gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | var frm = new ShowFilter(gridView1.Columns, _filterList); |
| | | var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName); |
| | | frm.UpdateParent += Frm_UpdateParent; |
| | | frm.ShowDialog(); |
| | | } |
| | |
| | | _filterList = e.FilterList; |
| | | getPageList(1); |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | |
| | | + "," + txt_psnQty_1.Text.Trim() |
| | | + "}"; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 审核事件 |
| | |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | getPageList(1); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 0) |
| | | { } |
| | | else |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | |
| | | 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); |
| | | //_filterList.Clear(); |
| | | //if (gridView1.ActiveFilter.Count > 0) |
| | | //{ |
| | | // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | // gridView1.ActiveFilter.Clear(); |
| | | // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | //} |
| | | //getPageList(1); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | gvList.Add(gvMx2); |
| | | UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); |
| | | } |
| | | |
| | | } |
| | |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 1); |
| | | lbGuid.Text = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | gridViews.Add(gvMx2); |
| | | UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews); |
| | | UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); |
| | | } |
| | | /// <summary> |
| | | /// 保存事件 |
| | |
| | | list = new List<dynamic>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | if (gvMx1.DataRowCount <= 0) |
| | | { |
| | |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | lbGuid.Text = _rtn.rtnData; |
| | | lbGuid.Text = _rtn.rtnData.outGuid; |
| | | txt_billNo.Text = _rtn.rtnData.outNo; |
| | | toolBarMenu1.isSetBtn = true; |
| | | UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false); |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | gvList.Add(gvMx2); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList); |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | if (dd.rtnCode > 0) |
| | | { |
| | | DataTable dt = dd.rtnData.list; |
| | | gcMain.BindingContext = new BindingContext(); |
| | | gcMain1.BindingContext = new BindingContext(); |
| | | gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMain.DataSource = dt; |
| | | gcMain.ForceInitialize(); |
| | | gridView1.BestFitColumns(); |
| | | gcMain1.DataSource = dt; |
| | | gcMain1.ForceInitialize(); |
| | | gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); |
| | | } |
| | | else |
| | | UtilityHelper.SetDefaultTable(gcMain, gridView1); |
| | | UtilityHelper.SetDefaultTable(gcMain1, gridView1); |
| | | gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | pageBar1.TotalPages = dd.rtnData.pages;//总页 |
| | | pageBar1.CurrentPage = curPage;//当前页 |
| | |
| | | { |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | private void getModel(string strGuid) |
| | | { |
| | | gcMx1.DataSource = null; |
| | | bool isEdit = false; |
| | | if (toolBarMenu1.currentAction == "add") return; |
| | | if (toolBarMenu1.currentAction == "edit") isEdit = true; |
| | |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | dynamic dy = _rtn.rtnData; |
| | | _ucGg= dy.tbl002; |
| | | lbGuid.Text = strGuid; |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | gvList.Add(gvMx2); |
| | | UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); |
| | | UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList); |
| | | _ucGg = ""; |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list"]) |
| | |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); |
| | | } |
| | | else |
| | | { |
| | |
| | | gcMx2.DataSource = dt2; |
| | | gcMx2.ForceInitialize(); |
| | | gvMx2.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 移出条码 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx2.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | var dr = gvMx2.GetDataRow(rowhandle); |
| | | var mxGuid = dr["guid"].ToString(); |
| | | if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?")) |
| | | return; |
| | | var _obj = new |
| | | { |
| | | mxGuid = mxGuid, |
| | | inType = "dhtm" |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | "VArrivalBarcodeManager/DeleteBarcode", |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 工具条事件 |
| | | /// </summary> |
| | | /// <param name="inFieldValue"></param> |
| | |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?")) |
| | | return; |
| | | |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); |
| | | if (_rtn.rtnCode > 0) |
| | | if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(lbGuid.Text.Trim()); |
| | | else |
| | | getPageList(1); |
| | | } |
| | | int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | Form parentForm = this.FindForm(); |
| | | UtilityHelper.SetCheckIco(gridView1, "isChk", "tbl011", "tbl012", picCheckBox, parentForm, _inFieldValue.ToString()); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) |
| | |
| | | txtWlid.Text = row["tld002"].ToString(); |
| | | txtWlgg.Text = row["tld004"].ToString(); |
| | | txtWlmc.Text = row["tld003"].ToString(); |
| | | txtQuantity.Text = row["tld004"].ToString();//申请总量 |
| | | //txtYdy.Text = row["YDYNUM"].ToString();//已打印总量 |
| | | //kyPrtQty.Text = row["KDYNUM"].ToString();//可打印总量 |
| | | txtYdy.Text = "";//已打印总量 |
| | | kyPrtQty.Text = "";//可打印总量 |
| | | txtQuantity.Text = row["tld005"].ToString();//申请总量 |
| | | txtYdy.Text = row["ydy"].ToString();//已打印总量 |
| | | txtKdy.Text = row["kdy"].ToString();//可打印总量 |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移出条码 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gvMx2.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | var dr = gvMx2.GetDataRow(rowhandle); |
| | | var mxGuid = dr["guid"].ToString(); |
| | | if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?")) |
| | | return; |
| | | var _obj = new |
| | | { |
| | | mxGuid = mxGuid, |
| | | inType = "dhtm" |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | _webServiceName + "DeleteBarcode", |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |