lu
2025-02-06 3fb5533f30f178dcdf5965a41c39fb62c61da4d8
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
@@ -67,8 +67,6 @@
                frm.ShowDialog();
            };
            btnSave.Click += BtnSave_Click;
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
@@ -227,15 +225,20 @@
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            toolBarMenu1.isSetBtn = false;
            string _ItemId = txt_ItemId.GetId();
            string _ItemId = txt_itemId.GetId();
            if (string.IsNullOrEmpty(_ItemId))
            {
                MsgHelper.Warning("请选择物料!");
                txt_ItemId.Focus();
                txt_itemId.Focus();
                return;
            }
            gvMx1.CloseEditor();
            gvMx1.UpdateCurrentRow();
            if (gvMx1.DataRowCount <= 0)
            {
                MsgHelper.Warning("项目明细不能为空!");
                return;
            }
            try
            {
                var lst = new List<MesQmCheckitemDt>();
@@ -243,11 +246,68 @@
                {
                    var row = gvMx1.GetDataRow(i);
                    if (row != null)
                    {
                        if (string.IsNullOrEmpty(row["forder"].ToString()))
                        {
                            MsgHelper.ShowError("顺序不能为空!");
                            return;
                        }
                        if (string.IsNullOrEmpty(row["FcheckItem"].ToString()))
                        {
                            MsgHelper.ShowError("检验项目不能为空!");
                            return;
                        }
                        if (string.IsNullOrEmpty(row["FcheckTool"].ToString()))
                        {
                            MsgHelper.ShowError("检验工具不能为空!");
                            return;
                        }
                        if (string.IsNullOrEmpty(row["SampleSizeNo"].ToString()))
                        {
                            MsgHelper.ShowError("检验标准不能为空!");
                            return;
                        }
                        if (string.IsNullOrEmpty(row["FcheckLevel"].ToString()))
                        {
                            MsgHelper.ShowError("检验水平不能为空!");
                            return;
                        }
                        if (string.IsNullOrEmpty(row["FacLevel"].ToString()))
                        {
                            MsgHelper.ShowError("接受水平不能为空!");
                            return;
                        }
                        string _Fstand = row["Fstand"].ToString();
                        string _FupAllow = row["FupAllow"].ToString();
                        string _FdownAllow = row["FdownAllow"].ToString();
                        //假如三个都为空通过
                        if (string.IsNullOrEmpty(_Fstand) && string.IsNullOrEmpty(_FupAllow) && string.IsNullOrEmpty(_FdownAllow))
                        {
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(_Fstand) && !string.IsNullOrEmpty(_FupAllow) && !string.IsNullOrEmpty(_FdownAllow))
                            {
                                decimal _Fstand_f = Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_Fstand);
                                decimal _FupAllow_f = Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_FupAllow);
                                decimal _FdownAllow_f = Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_FdownAllow);
                                if (_Fstand_f >= _FdownAllow_f && _Fstand_f <= _FupAllow_f) { }
                                else {
                                    MsgHelper.ShowError("标准值必须在上限和下限之间!");
                                    return;
                                }
                            }
                            else
                            {
                                MsgHelper.ShowError("请填写正确的上限,标准值,下限!");
                                return;
                            }
                        }
                        lst.Add(new MesQmCheckitemDt
                        {
                            Guid = UtilityHelper.ToGuid(row["guid"].ToString()),
                           // Forder = int.Parse(row["forder"].ToString()),
                            Forder = 0,
                            Forder = int.Parse(row["forder"].ToString()),
                            FcheckItem = row["FcheckItem"].ToString(),
                            SampleSizeNo = row["SampleSizeNo"].ToString(),
                            FcheckTool = row["FcheckTool"].ToString(),
@@ -259,6 +319,7 @@
                            FupAllow = row["FupAllow"].ToString(),
                            FdownAllow = row["FdownAllow"].ToString(),
                        });
                    }
                }
                var _obj = new MesQmCheckitem
                {
@@ -451,9 +512,11 @@
                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                {
                    if (xtraTabControl1.SelectedTabPageIndex == 1)
                    {
                        getModel(lbGuid.Text.Trim());
                    else
                        getPageList(this.pageBar1.CurrentPage);
                    }
                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                    gridView1.FocusedRowHandle = rowHandle;
                    UtilityHelper.SetCheckIco(gridView1, "foneChecked", "foneCheckor", "foneCheckdate", picCheckBox, this, _inFieldValue.ToString());
                }
            }
@@ -466,12 +529,22 @@
        #region 以下为种种下拉
        private void _setIno()
        {
            txt_ItemId.EditChanged += (s, e) =>
            this.txt_fSubsidiary.EditChanged += (s, e) =>
            {
                txt_itemModel.Text = this.txt_ItemId.GetModel();
                txt_itemNo.Text = this.txt_ItemId.GetCode();
                string _orgId = txt_fSubsidiary.GetId();
                if (string.IsNullOrEmpty(_orgId))
                    return;
                txt_itemId.getSuppler(_orgId);
                //txt_gg.Text ="";
                //txt_itemNo.Text = "";
            };
            txt_itemId.EditChanged += (s, e) =>
            {
                if (!string.IsNullOrEmpty(this.txt_itemId.GetModel()))
                    txt_gg.Text = this.txt_itemId.GetModel();
                if (!string.IsNullOrEmpty(this.txt_itemId.GetCode()))
                    txt_itemNo.Text = this.txt_itemId.GetCode();
            };
            _getListJyxm();
            _getListJygj();
            _getListJybz();