| | |
| | | using DevExpress.Utils.About; |
| | | using DevExpress.XtraGrid.Views.Grid.ViewInfo; |
| | | using DevExpress.XtraRichEdit.Model; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | { |
| | | public partial class Frm_MesQaItemsDetect01 : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | int _currentHandle5 =0; |
| | | string _webServiceName = "MesQaItemsDetect01Manager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | public Frm_MesQaItemsDetect01() |
| | |
| | | e.Info.DisplayText = (e.RowHandle + 1).ToString(); |
| | | } |
| | | }; |
| | | this.gvMx1.IndicatorWidth = 50; |
| | | gvMx1.CustomDrawRowIndicator += (s, e) => |
| | | { |
| | | if (e.Info.IsRowIndicator && e.RowHandle >= 0) |
| | | { |
| | | e.Info.DisplayText = (e.RowHandle + 1).ToString(); |
| | | } |
| | | }; |
| | | this.gvMx2.IndicatorWidth = 50; |
| | | gvMx2.CustomDrawRowIndicator += (s, e) => |
| | | { |
| | | if (e.Info.IsRowIndicator && e.RowHandle >= 0) |
| | | { |
| | | e.Info.DisplayText = (e.RowHandle + 1).ToString(); |
| | | } |
| | | }; |
| | | gridView1.CustomDrawEmptyForeground += (s, e) => |
| | | { |
| | | string str = "暂未查找到匹配的数据!"; |
| | |
| | | gvMx2.OptionsView.ShowGroupPanel = false; |
| | | gvMx3.OptionsFind.ShowSearchNavButtons = false; |
| | | gvMx3.OptionsView.ShowGroupPanel = false; |
| | | txt_itemId.KeyFile = "id"; |
| | | txt_suppId.KeyFile = "id"; |
| | | txt_itemId.EditChanged += (s, e) => |
| | | { |
| | | txt_itemModel.Text = this.txt_itemId.GetModel(); |
| | |
| | | this.btnLoad.Click += BtnLoad_Click; |
| | | ucUpFile1.UpChanged += UcUpFile1_UpChanged; |
| | | xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; |
| | | |
| | | } |
| | | |
| | | private void GcMx1_MouseClick(object sender, MouseEventArgs e) |
| | |
| | | string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | return; |
| | | var info = gvMx1.CalcHitInfo(e.Location); |
| | | this._currentHandle5 = info.RowHandle; |
| | | getList12(rowGuid); |
| | | } |
| | | |
| | |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "ReloadModel5", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | dynamic dy = _rtn.rtnData; |
| | | lbGuid.Text = strGuid; |
| | | JObject _job = JObject.Parse(strJson); |
| | | JArray array = new JArray(); |
| | | foreach (var a in _job["rtnData"]["list5"]) |
| | | { |
| | | array.Add(a); |
| | | } |
| | | DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | getList12(dt.Rows[0]["guid"].ToString()); |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | } |
| | | getModel(lbGuid.Text.Trim(), false, 999); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | string _strCmd = txtJianYan.Text.Trim().ToUpper(); |
| | | string _strOK = "OK"; |
| | | string _strNG = "NG"; |
| | | if (!(_strCmd.StartsWith(_strOK) || _strCmd.StartsWith(_strNG))) |
| | | int n = 0; |
| | | if ((_strCmd.StartsWith(_strOK) || _strCmd.StartsWith(_strNG))) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | if (!_strCmd.Contains("-")) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:缺少 中画线!"); |
| | | return; |
| | | } |
| | | string[] _ary = _strCmd.Split('-'); |
| | | if (_ary.Length != 2) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误::请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | string _str1 = _ary[0]; |
| | | if (!(_str1 == _strOK || _str1 == _strNG)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | string _str2 = _ary[1]; |
| | | int n; |
| | | if (int.TryParse(_str2, out n)) |
| | | { |
| | | if (!_strCmd.Contains("-")) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | string[] _ary = _strCmd.Split('-'); |
| | | if (_ary.Length != 2) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误::请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | string _str1 = _ary[0]; |
| | | if (!(_str1 == _strOK || _str1 == _strNG)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | string _str2 = _ary[1]; |
| | | if (int.TryParse(_str2, out n)) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | if (int.TryParse(_strCmd, out n)) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("命令输入错误:请正确使用OK 或 NG 命令!"); |
| | | return; |
| | | } |
| | | } |
| | | for (int i = 0; i < gvMx2.DataRowCount; i++) |
| | | var _obj = new |
| | | { |
| | | gvMx2.SetRowCellValue(i, "fcheckResu", _str1); |
| | | gvMx2.SetRowCellValue(i, "fstand", _str1); |
| | | } |
| | | List<MesQaItemsDetectDetail12> lst = new List<MesQaItemsDetectDetail12>(); |
| | | for (var i = 0; i < gvMx2.DataRowCount; i++) |
| | | { |
| | | var row = gvMx2.GetDataRow(i); |
| | | if (row != null) |
| | | lst.Add(new MesQaItemsDetectDetail12() |
| | | { |
| | | ParentGuid = UtilityHelper.ToGuid(guid5), |
| | | Guid = UtilityHelper.ToGuid(row["guid"].ToString()), |
| | | FcheckResu = row["fcheckResu"].ToString(), |
| | | GrandpaGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), |
| | | }); |
| | | } |
| | | var _obj = lst; |
| | | inOrderGuid1 = UtilityHelper.ToGuid(lbGuid.Text.Trim()), ////这是检验单guid |
| | | inOrderGuid5 = guid5,//这是抽样的guid |
| | | inP1 = _strCmd,//这是9,有可能是19,或者0k-19,或者ng-19 |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | txtJianYan.Text = ""; |
| | | getModel(lbGuid.Text.Trim(), false, 999); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | /// <summary> |
| | | ///检验事件 |
| | | ///提交检验事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) |
| | | private async void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_releaseNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定提交检验吗?")) |
| | | return; |
| | | UcLoading _loading = new UcLoading(); |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | | }; |
| | | try |
| | | { |
| | | var strJson = await UtilityHelper.HttpPostAsync("", |
| | | _webServiceName + "EditModelSubmit", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning("提示:" + _rtn.rtnData.outMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | getModel(lbGuid.Text.Trim(), false, 999); |
| | | else |
| | | getPageList(1, UtilityHelper.GetPageSize()); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | _loading.Stop(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = dt; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.FocusedRowHandle = _currentHandle5; |
| | | ucUpFile1.parentGuid = lbGuid.Text.Trim(); |
| | | getList12(dt.Rows[0]["guid"].ToString()); |
| | | var row = gvMx1.GetDataRow(_currentHandle5); |
| | | if (row != null) |
| | | { |
| | | var rowGuid = row["guid"].ToString(); |
| | | getList12(rowGuid); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | _loading.Stop(); |
| | | } |
| | | |
| | |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |