| | |
| | | }, lbGuid); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | } |
| | | _getListDepotSections(); |
| | | ; } |
| | | |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | |
| | | UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); |
| | | UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | gvMx1.BestFitColumns(); |
| | | gvMx1.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True; |
| | | gvMx1.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom; |
| | | gvMx1.OptionsBehavior.Editable = true; |
| | | gvMx1.OptionsBehavior.ReadOnly = false; |
| | |
| | | var array = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list"]) array.Add(a); |
| | | var dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | } |
| | | else |
| | | { |
| | | UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | } |
| | | gvMx1.OptionsBehavior.Editable = isEdit; |
| | | gvMx1.OptionsBehavior.ReadOnly = !isEdit; |
| | | gvMx1.OptionsView.NewItemRowPosition = isEdit ? NewItemRowPosition.Bottom : NewItemRowPosition.None; |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.BestFitColumns(); |
| | | } |
| | | else |
| | | { |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | } |
| | | gvMx1.OptionsBehavior.Editable = isEdit; |
| | | gvMx1.OptionsBehavior.ReadOnly = !isEdit; |
| | | gvMx1.OptionsBehavior.AllowAddRows = isEdit ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False; |
| | | gvMx1.OptionsView.NewItemRowPosition = isEdit ? NewItemRowPosition.Bottom : NewItemRowPosition.None; |
| | | } |
| | | else |
| | | { |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private void rptDepotSections_SelectedIndexChanged(object sender, EventArgs e) |
| | | { |
| | | ComboBoxEdit comboBox = sender as ComboBoxEdit; |
| | | if (comboBox != null) |
| | | { |
| | | CboItemEntity _itm = comboBox.EditValue as CboItemEntity; |
| | | if (_itm == null) return; |
| | | string sectionCode = _itm.Text.ToString(); |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.SetRowCellValue(gvMx1.FocusedRowHandle, "location", sectionCode); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读取库位 |
| | | /// </summary> |
| | | private void _getListDepotSections() |
| | | { |
| | | try |
| | | { |
| | | |
| | | var pgq = new PageQueryModel(1, 999999, "b.xh", "asc", "", " and is_ng='A'"); |
| | | var json = JsonConvert.SerializeObject(pgq); |
| | | var strReturn = UtilityHelper.HttpPost("", "MesDepotSectionsManager/GetListPage", json); |
| | | var rtn = UtilityHelper.ReturnToTablePage(strReturn); |
| | | var dt = rtn.rtnData.list; |
| | | this.rptDepotSections.Items.Clear(); |
| | | foreach (System.Data.DataRow dr in dt.Rows) |
| | | { |
| | | this.rptDepotSections.Items.Add(new CboItemEntity(dr["depotSectionCode"].ToString(), dr["depotSectionCode"].ToString())); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |