Exemple #1
0
        private void BindLevel()
        {
            this.lueLevel.EditValue = string.Empty;
            IVTestDataEntity IVTestDateObject = new IVTestDataEntity();
            DataSet          dsLeve           = IVTestDateObject.GetBasicData("ProductGrade", "", "", "");

            if (string.IsNullOrEmpty(IVTestDateObject.ErrorMsg))
            {
                if (dsLeve != null)
                {
                    this.lueLevel.Properties.DataSource    = dsLeve.Tables[0];
                    this.lueLevel.Properties.DisplayMember = "COLUMN_NAME";
                    this.lueLevel.Properties.ValueMember   = "COLUMN_CODE";
                    this.lueLevel.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("COLUMN_NAME"));
                }
                else
                {
                    this.lueLevel.Properties.DataSource = null;
                }
            }
            else
            {
                MessageService.ShowError(IVTestDateObject.ErrorMsg);
                this.lueLevel.Properties.DataSource = null;
                return;
            }
        }
Exemple #2
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            string sSN, sRCodeName, sRCodeKey, sRCategoryCode, sRCategoryKey, sRoomKey, sLevelCode, sLevelName, sRemark;
            string sFactoryV, sFccode2V, sCustomCodeV, sCheckTimeV, sWorkNumV, sProIDV, sLotColorV, sGradCodeV, sGradV, sWorkStationV, sShiftKey;

            sSN            = "";
            sRCodeName     = "";
            sRCodeKey      = "";
            sRCategoryCode = "";
            sRCategoryKey  = "";
            sRoomKey       = "";
            sLevelCode     = "";
            sLevelName     = "";
            sRemark        = "";
            sFactoryV      = "";
            sFccode2V      = "";
            sCustomCodeV   = "";
            sCheckTimeV    = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
            sWorkNumV      = "";
            sProIDV        = "";
            sLotColorV     = "";
            sGradV         = "";
            sWorkStationV  = "";
            sGradCodeV     = "";
            sShiftKey      = "";
            sRoomKey       = lueFactoryRoom.EditValue.ToString();
            sSN            = txtLotNumber.Text.Trim();
            sRCategoryCode = lueRCategory.Text.Trim();
            if (lueRCategory.EditValue != null)
            {
                sRCategoryKey = lueRCategory.EditValue.ToString();
            }
            sRCodeName = lue_NG_Code.Text.Trim();
            if (lue_NG_Code.EditValue != null)
            {
                sRCodeKey = lue_NG_Code.EditValue.ToString();
            }
            if (lueLevel.EditValue != null)
            {
                sLevelCode = lueLevel.EditValue.ToString();
            }
            sLevelName = lueLevel.Text.Trim();
            sRemark    = cobRemark.Text.Trim();

            if (string.IsNullOrEmpty(sRoomKey))
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotOutQuantityAssurance.Msg001}"));//厂别未选择,请确认!
                //MessageService.ShowMessage("厂别未选择,请确认!");
                return;
            }
            if (string.IsNullOrEmpty(sSN))
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotOutQuantityAssurance.Msg002}"));//组件序号为空,请确认!
                //MessageService.ShowMessage("组件序号为空,请确认!");
                return;
            }

            IVTestDataEntity IVTestDateObject = new IVTestDataEntity();
            DataSet          dsCustCheck      = new DataSet();

            if (chCustomCode.Checked == true)
            {
                dsCustCheck = IVTestDateObject.GetCustCheckData("", sSN, sRoomKey);
            }
            else
            {
                dsCustCheck = IVTestDateObject.GetCustCheckData(sSN, "", sRoomKey);
            }
            if (string.IsNullOrEmpty(IVTestDateObject.ErrorMsg))
            {
                if (dsCustCheck.Tables[0].Rows.Count < 1)
                {
                    MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotOutQuantityAssurance.Msg003}"));//组件未过终检,不能抽检,请确认!
                    //MessageService.ShowMessage("组件未过终检,不能抽检,请确认!");
                    return;
                }
                else
                {
                    sFactoryV     = lueFactoryRoom.Text.Trim();
                    sFccode2V     = dsCustCheck.Tables[0].Rows[0]["CC_FCODE2"].ToString();
                    sCustomCodeV  = dsCustCheck.Tables[0].Rows[0]["CUSTOMCODE"].ToString();
                    sWorkNumV     = dsCustCheck.Tables[0].Rows[0]["WORKNUMBER"].ToString();
                    sProIDV       = dsCustCheck.Tables[0].Rows[0]["PRO_ID"].ToString();
                    sLotColorV    = dsCustCheck.Tables[0].Rows[0]["LOT_COLOR"].ToString();
                    sGradCodeV    = dsCustCheck.Tables[0].Rows[0]["PRO_LEVEL"].ToString();
                    sShiftKey     = dsCustCheck.Tables[0].Rows[0]["SHIFT_KEY"].ToString();
                    sWorkStationV = dsCustCheck.Tables[0].Rows[0]["SHIFT_NAME"].ToString();
                }
            }
            else
            {
                MessageService.ShowError(IVTestDateObject.ErrorMsg);
                return;
            }
            DataSet dsGraed = IVTestDateObject.GetBasicData("ProductGrade", sGradCodeV, "", "");

            sGradV = dsGraed.Tables[0].Rows[1]["COLUMN_NAME"].ToString();

            DataSet dsConsigmentData = new DataSet();

            if (chCustomCode.Checked == true)
            {
                dsConsigmentData = IVTestDateObject.GetConsigmentDataBySN("", "", sSN, sRoomKey);
            }
            else
            {
                dsConsigmentData = IVTestDateObject.GetConsigmentDataBySN(sSN, "", "", sRoomKey);
            }
            if (string.IsNullOrEmpty(IVTestDateObject.ErrorMsg))
            {
                if (dsConsigmentData.Tables[0].Rows.Count > 0)
                {
                    MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotOutQuantityAssurance.Msg004}"));//组件已包装,不能抽检,请确认!
                    //MessageService.ShowMessage("组件已包装,不能抽检,请确认!");
                    return;
                }
            }
            else
            {
                MessageService.ShowError(IVTestDateObject.ErrorMsg);
                return;
            }

            string sql = string.Empty;

            sql  = "UPDATE WIP_CUSTCHECK SET ISFLAG='0'";
            sql += " WHERE ISFLAG='1' AND CC_DATA_GROUP='O'";
            sql += " AND ROOM_KEY='" + sRoomKey + "'";
            if (chCustomCode.Checked == true)
            {
                sql += " AND CUSTOMCODE='" + sSN + "'";
            }
            else
            {
                sql += " AND CC_FCODE1='" + sSN + "'";
            }
            DataSet dsUOQA = IVTestDateObject.UpdateData(sql, "UpdateOQA");

            if (!string.IsNullOrEmpty(IVTestDateObject.ErrorMsg))
            {
                MessageService.ShowError(IVTestDateObject.ErrorMsg);
                return;
            }

            DataSet dsSEQ = new DataSet();

            if (chCustomCode.Checked == true)
            {
                dsSEQ = IVTestDateObject.GetCustCheckSEQ("", sSN, sRoomKey);
            }
            else
            {
                dsSEQ = IVTestDateObject.GetCustCheckSEQ(sSN, "", sRoomKey);
            }
            if (!string.IsNullOrEmpty(IVTestDateObject.ErrorMsg))
            {
                MessageService.ShowError(IVTestDateObject.ErrorMsg);
                return;
            }
            int nSEQ = int.Parse(dsSEQ.Tables[0].Rows[0]["SEQ"].ToString());

            string sUID = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);
            string key  = FanHai.Hemera.Share.Common.CommonUtils.GenerateNewKey(0);

            sql  = "INSERT INTO WIP_CUSTCHECK(CUSTCHECK_KEY,CC_DATA_GROUP,CUSTOMCODE,l_ID,CHECK_TIME,CC_FCODE1,WORKNUMBER,PRO_ID,LOT_COLOR,PRO_LEVEL,CREATER,CREATE_TIME,ISFLAG,ROOM_KEY,SHIFT_KEY,SHIFT_NAME,REMARK,REASON_CODE_NAME,REASON_CODE_KEY,REASON_CODE_CATEGORY_NAME,REASON_CODE_CATEGORY_KEY)";
            sql += " VALUES('" + key + "','O','" + sCustomCodeV + "','" + nSEQ.ToString() + "',GETDATE(),'" + sFccode2V + "','" + sWorkNumV + "'";
            sql += ",'" + sProIDV + "','" + sLotColorV + "','" + sGradCodeV + "','" + sUID + "',GETDATE(),'1','" + sRoomKey + "','" + sShiftKey + "'";
            sql += ",'" + sWorkStationV + "','" + sRemark + "','" + sRCodeName + "','" + sRCategoryKey + "','" + sRCategoryCode + "','" + sRCategoryKey + "')";
            DataSet dsAddOQA = IVTestDateObject.AddData(sql, "AddOQA");

            if (!string.IsNullOrEmpty(IVTestDateObject.ErrorMsg))
            {
                MessageService.ShowError(IVTestDateObject.ErrorMsg);
                return;
            }
            int nAddOQA = int.Parse(dsAddOQA.ExtendedProperties["rows"].ToString());

            if (nAddOQA < 1)
            {
                MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotOutQuantityAssurance.Msg005}"));//添加OQA数据失败!
                //MessageService.ShowMessage("添加OQA数据失败!", "提示");
                return;
            }

            txtLotNumber.SelectAll();
            txtLotNumber.Focus();

            dsOQA.Tables[0].Rows.Add(sFactoryV, sFccode2V, sCustomCodeV, sCheckTimeV, sWorkNumV, sProIDV, sLotColorV, sGradV, sWorkStationV, sRCategoryCode, sRCodeName, sUID, sRemark);
            gcOQAData.DataSource = null;
            gcOQAData.DataSource = dsOQA.Tables[0];
            lblTot.Text          = "TOT:" + dsOQA.Tables[0].Rows.Count.ToString();

            //清除查询数据集
            dsQueryOQA.Clear();
        }