| | |
| | | using Gs.DevApp.DevFrm.QC.Models; |
| | | 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.Drawing; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace Gs.DevApp.DevFrm.QC |
| | |
| | | public Frm_MesQmAql1() |
| | | { |
| | | InitializeComponent(); |
| | | object[] _objAry = { "A", |
| | | "B", |
| | | "C", |
| | | "D", |
| | | "E", |
| | | "F", |
| | | "G", |
| | | "H", |
| | | "I", |
| | | "J", |
| | | "K", |
| | | "L", |
| | | "M", |
| | | "N", |
| | | "O", |
| | | "P", |
| | | "Q", |
| | | "R", |
| | | "S", |
| | | "T"}; |
| | | this.repositoryItemComboBox1.Items.AddRange(_objAry); |
| | | this.repositoryItemComboBox2.Items.AddRange(_objAry); |
| | | this.repositoryItemComboBox3.Items.AddRange(_objAry); |
| | | this.repositoryItemComboBox4.Items.AddRange(_objAry); |
| | | this.repositoryItemComboBox5.Items.AddRange(_objAry); |
| | | this.repositoryItemComboBox6.Items.AddRange(_objAry); |
| | | this.repositoryItemComboBox7.Items.AddRange(_objAry); |
| | | this.repositoryItemComboBox8.Items.AddRange(_objAry); |
| | | this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; |
| | | this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; |
| | | this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; |
| | | this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | toolBarMenu1.btnPiZhunClick += ToolBarMenu1_btnPiZhunClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "foneChecked", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }); |
| | | { |
| | | 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); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | } |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); |
| | | Task.Delay(100); |
| | | getPageList(1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 批准 |
| | | /// </summary> |
| | |
| | | { |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_sampleSizeNo, gridView1); |
| | | lbGuid, txt_sampleSizeNo, gridView1, "sampleSizeNo"); |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "Approval", JsonConvert.SerializeObject(rowGuid)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(lbGuid.Text.Trim()); |
| | | } |
| | | int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | gridView1.SetFocusedRowCellValue("ftwoChecked", true); |
| | | gridView1.SetFocusedRowCellValue("isenabled", true); |
| | | gridView1.SetFocusedRowCellValue("ftwoCheckor", "已批准"); |
| | | gridView1.SetFocusedRowCellValue("ftwoCheckdate", DateTime.Now.ToString()); |
| | | } |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_sampleSizeNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | _toolCk(0); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_sampleSizeNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | _toolCk(1); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 分页事件 |
| | | /// </summary> |
| | |
| | | { |
| | | getPageList(curPage); |
| | | } |
| | | /// <summary> |
| | | /// 查询事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e) |
| | | { |
| | | gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | gridView1.ActiveFilter.Clear(); |
| | | gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | var frm = new ShowFilter(gridView1.Columns, _filterList); |
| | | frm.UpdateParent += Frm_UpdateParent; |
| | | frm.ShowDialog(); |
| | | } |
| | | /// <summary> |
| | | /// 查询回调 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) |
| | | { |
| | | _filterList = e.FilterList; |
| | | getPageList(1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 取消事件 |
| | | /// </summary> |
| | |
| | | private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) |
| | | { |
| | | string rowGuid = "", rowName = ""; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1); |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1, "sampleSizeNo"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("请先选择你要操作的行!"); |
| | |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 0) |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | { } |
| | | else |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | ToolBox.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> |
| | |
| | | return; |
| | | } |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); |
| | | UtilityHelper.ChangeEnableByControl(panel1.Controls, true); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(rowGuid); |
| | | } |
| | | else |
| | | { |
| | | List<GridView> gridViews = new List<GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | gridViews.Add(gvMx2); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gridViews); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 新增事件 |
| | |
| | | List<GridView> gridViews = new List<GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | gridViews.Add(gvMx2); |
| | | UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews); |
| | | UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); |
| | | UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | UtilityHelper.SetDefaultTable(gcMx2, gvMx2); |
| | | txt_createDate.Text = DateTime.Now.ToString("G"); |
| | | txt_fversion.Text = "1"; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 保存事件 |
| | |
| | | return; |
| | | } |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | gvMx2.CloseEditor(); |
| | | gvMx2.PostEditor(); |
| | | gvMx2.UpdateCurrentRow(); |
| | | var qmaql2 = new List<MesQmAql2>(); |
| | | for (var i = 0; i < gvMx1.DataRowCount; i++) |
| | | { |
| | | var row = gvMx1.GetDataRow(i); |
| | | if (row != null) |
| | | qmaql2.Add(new MesQmAql2 |
| | | { |
| | | Guid = UtilityHelper.ToGuid(row["Guid"].ToString()), |
| | | LotFrom = Convert.ToInt32(row["LotFrom"].ToString()), |
| | | LotTo = Convert.ToInt32(row["LotTo"].ToString()), |
| | | FlevelS1 = row["FlevelS1"].ToString(), |
| | | FlevelS2 = row["FlevelS2"].ToString(), |
| | | FlevelS3 = row["FlevelS3"].ToString(), |
| | | FlevelS4 = row["FlevelS4"].ToString(), |
| | | FlevelI = row["FlevelI"].ToString(), |
| | | FlevelIi = row["FlevelIi"].ToString(), |
| | | FlevelIii = row["FlevelIii"].ToString(), |
| | | Memo = row["Memo"].ToString() |
| | | }); |
| | | } |
| | | var qmaql3 = new List<MesQmAql3>(); |
| | | for (var i = 0; i < gvMx2.DataRowCount; i++) |
| | | { |
| | | var row = gvMx2.GetDataRow(i); |
| | | if (row != null) |
| | | qmaql3.Add(new MesQmAql3 |
| | | { |
| | | Guid = UtilityHelper.ToGuid(row["Guid"].ToString()), |
| | | FsampleSizeWord = Convert.ToInt32(row["FsampleSizeWord"].ToString()), |
| | | SampleSizeWord = row["SampleSizeWord"].ToString(), |
| | | Aql00010 = Convert.ToInt32(row["Aql00010"].ToString()), |
| | | Aql00015 = Convert.ToInt32(row["Aql00015"].ToString()), |
| | | Aql00025 = Convert.ToInt32(row["Aql00025"].ToString()), |
| | | Aql00040 = Convert.ToInt32(row["Aql00040"].ToString()), |
| | | Aql00065 = Convert.ToInt32(row["Aql00065"].ToString()), |
| | | Aql0010 = Convert.ToInt32(row["Aql0010"].ToString()), |
| | | Aql0015 = Convert.ToInt32(row["Aql0015"].ToString()), |
| | | Aql0025 = Convert.ToInt32(row["Aql0025"].ToString()), |
| | | Aql0040 = Convert.ToInt32(row["Aql0040"].ToString()), |
| | | Aql0065 = Convert.ToInt32(row["Aql0065"].ToString()), |
| | | Aql0100 = Convert.ToInt32(row["Aql0100"].ToString()), |
| | | Aql0150 = Convert.ToInt32(row["Aql0150"].ToString()), |
| | | Aql0250 = Convert.ToInt32(row["Aql0250"].ToString()), |
| | | Aql0400 = Convert.ToInt32(row["Aql0400"].ToString()), |
| | | Aql0650 = Convert.ToInt32(row["Aql0650"].ToString()), |
| | | Aql1000 = Convert.ToInt32(row["Aql1000"].ToString()), |
| | | Memo = row["Memo"].ToString() |
| | | }); |
| | | } |
| | | if (qmaql2.Count <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("样本量子码不能为空!"); |
| | | return; |
| | | } |
| | | if (qmaql3.Count <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("抽样方案不能为空!"); |
| | | return; |
| | | } |
| | | var _obj = new MesQmAql1 |
| | | { |
| | | Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), |
| | | SampleSizeNo = txt_sampleSizeNo.Text.Trim(), |
| | | SampleSizeName = txt_sampleSizeName.Text.Trim(), |
| | | Memo = txt_memo.Text.Trim(), |
| | | CreateDate = DateTime.Now, |
| | | FtwoChecked = false, |
| | | Isenabled = false, |
| | | FoneChecked = false, |
| | | Fversion = Convert.ToInt32(txt_fversion.Text.Trim()), |
| | | MesQmAql2s = qmaql2, |
| | | MesQmAql3s = qmaql3 |
| | | }; |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | var qmaql2 = new List<MesQmAql2>(); |
| | | for (var i = 0; i < gvMx1.DataRowCount; i++) |
| | | { |
| | | lbGuid.Text = _rtn.rtnData; |
| | | toolBarMenu1.isSetBtn = true; |
| | | List<GridView> gridViews = new List<GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | gridViews.Add(gvMx2); |
| | | UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gridViews); |
| | | var row = gvMx1.GetDataRow(i); |
| | | if (row != null) |
| | | { |
| | | if (string.IsNullOrEmpty(row["LotFrom"].ToString())) |
| | | { |
| | | MsgHelper.ShowError("批量开始不能为空!"); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(row["LotTo"].ToString())) |
| | | { |
| | | MsgHelper.ShowError("批量结束不能为空!"); |
| | | return; |
| | | } |
| | | qmaql2.Add(new MesQmAql2 |
| | | { |
| | | Guid = UtilityHelper.ToGuid(row["Guid"].ToString()), |
| | | LotFrom = Convert.ToInt32(row["LotFrom"].ToString()), |
| | | LotTo = Convert.ToInt32(row["LotTo"].ToString()), |
| | | FlevelS1 = row["FlevelS1"].ToString(), |
| | | FlevelS2 = row["FlevelS2"].ToString(), |
| | | FlevelS3 = row["FlevelS3"].ToString(), |
| | | FlevelS4 = row["FlevelS4"].ToString(), |
| | | FlevelI = row["FlevelI"].ToString(), |
| | | FlevelIi = row["FlevelIi"].ToString(), |
| | | FlevelIii = row["FlevelIii"].ToString(), |
| | | Memo = row["Memo"].ToString() |
| | | }); |
| | | } |
| | | } |
| | | var qmaql3 = new List<MesQmAql3>(); |
| | | for (var i = 0; i < gvMx2.DataRowCount; i++) |
| | | { |
| | | var row = gvMx2.GetDataRow(i); |
| | | if (row != null) |
| | | { |
| | | if (string.IsNullOrEmpty(row["FsampleSizeWord"].ToString())) |
| | | { |
| | | MsgHelper.ShowError("样本大小不能为空!"); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(row["SampleSizeWord"].ToString())) |
| | | { |
| | | MsgHelper.ShowError("样本字码不能为空!"); |
| | | return; |
| | | } |
| | | qmaql3.Add(new MesQmAql3 |
| | | { |
| | | Guid = UtilityHelper.ToGuid(row["Guid"].ToString()), |
| | | FsampleSizeWord = Convert.ToInt32(row["FsampleSizeWord"].ToString()), |
| | | SampleSizeWord = row["SampleSizeWord"].ToString(), |
| | | Aql00010 = Convert.ToInt32(row["Aql00010"].ToString()), |
| | | Aql00015 = Convert.ToInt32(row["Aql00015"].ToString()), |
| | | Aql00025 = Convert.ToInt32(row["Aql00025"].ToString()), |
| | | Aql00040 = Convert.ToInt32(row["Aql00040"].ToString()), |
| | | Aql00065 = Convert.ToInt32(row["Aql00065"].ToString()), |
| | | Aql0010 = Convert.ToInt32(row["Aql0010"].ToString()), |
| | | Aql0015 = Convert.ToInt32(row["Aql0015"].ToString()), |
| | | Aql0025 = Convert.ToInt32(row["Aql0025"].ToString()), |
| | | Aql0040 = Convert.ToInt32(row["Aql0040"].ToString()), |
| | | Aql0065 = Convert.ToInt32(row["Aql0065"].ToString()), |
| | | Aql0100 = Convert.ToInt32(row["Aql0100"].ToString()), |
| | | Aql0150 = Convert.ToInt32(row["Aql0150"].ToString()), |
| | | Aql0250 = Convert.ToInt32(row["Aql0250"].ToString()), |
| | | Aql0400 = Convert.ToInt32(row["Aql0400"].ToString()), |
| | | Aql0650 = Convert.ToInt32(row["Aql0650"].ToString()), |
| | | Aql1000 = Convert.ToInt32(row["Aql1000"].ToString()), |
| | | Memo = row["Memo"].ToString() |
| | | }); |
| | | } |
| | | } |
| | | if (qmaql2.Count <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("样本量子码不能为空!"); |
| | | return; |
| | | } |
| | | if (qmaql3.Count <= 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("抽样方案不能为空!"); |
| | | return; |
| | | } |
| | | var _obj = new MesQmAql1 |
| | | { |
| | | Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), |
| | | SampleSizeNo = txt_sampleSizeNo.Text.Trim(), |
| | | SampleSizeName = txt_sampleSizeName.Text.Trim(), |
| | | Memo = txt_memo.Text.Trim(), |
| | | CreateDate = DateTime.Now, |
| | | FtwoChecked = false, |
| | | Isenabled = false, |
| | | FoneChecked = false, |
| | | Fversion = Convert.ToInt32(txt_fversion.Text.Trim()), |
| | | MesQmAql2s = qmaql2, |
| | | MesQmAql3s = qmaql3 |
| | | }; |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | lbGuid.Text = _rtn.rtnData; |
| | | toolBarMenu1.isSetBtn = true; |
| | | List<GridView> gridViews = new List<GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | gridViews.Add(gvMx2); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gridViews); |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (dd.rtnCode > 0) |
| | | { |
| | | DataTable dt = dd.rtnData.list; |
| | | gcMain.BindingContext = new BindingContext(); |
| | | gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; |
| | | gcMain1.BindingContext = new BindingContext(); |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMain.DataSource = dt; |
| | | gcMain.ForceInitialize(); |
| | | gcMain1.DataSource = dt; |
| | | gcMain1.ForceInitialize(); |
| | | gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); |
| | | } |
| | | else |
| | | UtilityHelper.SetDefaultTable(gcMain, gridView1); |
| | | gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; |
| | | UtilityHelper.SetDefaultTable(gcMain1, gridView1); |
| | | pageBar1.TotalPages = dd.rtnData.pages;//总页 |
| | | pageBar1.CurrentPage = curPage;//当前页 |
| | | pageBar1.RecordCount = dd.rtnData.total;//总记录数 |
| | |
| | | List<GridView> gvList = new List<GridView>(); |
| | | gvList.Add(gvMx1); |
| | | gvList.Add(gvMx2); |
| | | UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); |
| | | UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList); |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | | JArray mesQmAql3s = new JArray(); |
| | |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | //gvMx1.BestFitColumns(); |
| | | } |
| | | else |
| | | { |
| | |
| | | gcMx2.BindingContext = new BindingContext(); |
| | | gcMx2.DataSource = dt1; |
| | | gcMx2.ForceInitialize(); |
| | | // gvMx2.BestFitColumns(); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除字码 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | var rowhandle = gvMx1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除方案 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | gvMx2.CloseEditor(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 工具条事件 |
| | | /// </summary> |
| | | /// <param name="inFieldValue"></param> |
| | | private void _toolCk(int _inFieldValue) |
| | | { |
| | | string strMsg = ""; |
| | | switch (_inFieldValue) |
| | | { |
| | | case 1: |
| | | strMsg = "审核"; |
| | | break; |
| | | case 0: |
| | | strMsg = "反审核"; |
| | | break; |
| | | }; |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1, "sampleSizeNo"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?")) |
| | | return; |
| | | |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | | ckValue = _inFieldValue, |
| | | parameter = "MES_QM_AQL1,FONE_CHECKDATE,FONE_CHECKED,FONE_CHECKOR,chk_mesQmAql1" |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(lbGuid.Text.Trim()); |
| | | } |
| | | int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); |
| | | gridView1.FocusedRowHandle = rowHandle; |
| | | UtilityHelper.SetCheckIco(gridView1, "foneChecked", "foneCheckor", "foneCheckdate", picCheckBox, this, _inFieldValue.ToString()); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |