Пример #1
0
 private void edtOperatorCode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Return)
     {
         if (edtOperatorCode.Text.Trim() != "")
         {
             currentOperator = GetUserInfoWithIDCode(edtOperatorCode.Text.Trim());
             if (currentOperator != null)
             {
                 edtOperatorCode.Text =
                     string.Format(
                         "{0}[{1}]",
                         currentOperator.UserName,
                         currentOperator.UserCode);
             }
             else
             {
                 edtOperatorCode.Text = "";
             }
         }
         else
         {
             edtOperatorCode.Text = "";
             currentOperator      = null;
         }
     }
 }
Пример #2
0
        public void ClearAll()
        {
            currentOperator      = null;
            edtOperatorCode.Text = "";

            Clear();
        }
Пример #3
0
        private void ucPrdtParams_Ionitriding_Load(object sender, EventArgs e)
        {
            grdPWOs.DataSource = pwos;

            BatchProductInfo data = GetWorkUnitProductionInfo();

            if (data != null)
            {
                if (data.InProduction == 0)
                {
                    prdtStatus = ProductionStatus.Idle;

                    pwos = LoadFromFile(stationInfo.T133Code);
                    grdPWOs.DataSource = pwos;
                    grdvPWOs.BestFitColumns();

                    GetMethodStandards(0, 0, "");
                }
                else
                {
                    prdtStatus = ProductionStatus.Busy;

                    pwos = data.GetPWOsFromXML();
                    grdPWOs.DataSource = pwos;
                    grdvPWOs.BestFitColumns();

                    currentOperator = new STB006()
                    {
                        UserCode = data.OperatorCode,
                        UserName = data.OperatorName,
                    };
                    currentBatchNo = data.BatchNumber;
                    startDatetime  = data.BatchStartDate;

                    if (pwos.Count > 0)
                    {
                        GetMethodStandards(0, stationInfo.T216LeafID, currentBatchNo);
                    }
                }

                edtOperatorCode.Text =
                    string.Format(
                        "{0}[{1}]",
                        currentOperator.UserName,
                        currentOperator.UserCode);
                lblBatchNo.Text = currentBatchNo;
            }
            else
            {
                pwos = LoadFromFile(stationInfo.T133Code);
                grdPWOs.DataSource = pwos;
                grdvPWOs.BestFitColumns();
            }

            RefreshForm();
        }
Пример #4
0
        private void ucFurnacePrdtParams_Load(object sender, EventArgs e)
        {
            grdPWOs.DataSource = pwos;

            BatchProductInfo data = GetWorkUnitProductionInfo();

            if (data != null)
            {
                currentOperator = new STB006()
                {
                    UserCode = data.OperatorCode,
                    UserName = data.OperatorName,
                };
                currentBatchNo = data.BatchNumber;
                startDatetime  = data.BatchStartDate;
                if (data.InProduction == 0)
                {
                    prdtStatus = ProductionStatus.Idle;
                    GetMethodStandards(0, 0, "");
                }
                else
                {
                    prdtStatus = ProductionStatus.Busy;

                    pwos = GetPWOWithBatchNo(currentBatchNo);
                    grdPWOs.DataSource = pwos;
                    grdvPWOs.BestFitColumns();
                    if (pwos.Count > 0)
                    {
                        DateTime dt;
                        if (DateTime.TryParse(pwos[0].BatchStartDate, out dt))
                        {
                            startDatetime = dt;
                        }

                        GetMethodStandards(0, stationInfo.T216LeafID, currentBatchNo);
                    }
                }

                edtOperatorCode.Text =
                    string.Format(
                        "{0}[{1}]",
                        currentOperator.UserName,
                        currentOperator.UserCode);
                lblBatchNo.Text   = currentBatchNo;
                lblStartTime.Text = startDatetime.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                GetDevices();
            }

            RefreshForm();
        }
Пример #5
0
        private void edtOperatorCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                if (currentFurnace != null && currentFurnace.InProduction != 1)
                {
                    if (edtOperatorCode.Text.Trim() != "")
                    {
                        STB006 currentOperator =
                            GetUserInfoWithIDCode(edtOperatorCode.Text.Trim());
                        if (currentOperator != null)
                        {
                            edtOperatorCode.Text =
                                string.Format(
                                    "{0}[{1}]",
                                    currentOperator.UserName,
                                    currentOperator.UserCode);
                            currentFurnace.OperatorCode = currentOperator.UserCode;
                            currentFurnace.OperatorName = currentOperator.UserName;
                        }
                        else
                        {
                            edtOperatorCode.Text        = "";
                            currentFurnace.OperatorCode = "";
                            currentFurnace.OperatorName = "";

                            edtOperatorCode.Focus();
                        }
                    }
                    else
                    {
                        edtOperatorCode.Text        = "";
                        currentFurnace.OperatorCode = "";
                        currentFurnace.OperatorName = "";

                        edtOperatorCode.Focus();
                    }
                }
                else
                {
                    edtOperatorCode.Text = "";

                    edtOperatorCode.Focus();
                }
            }
        }
Пример #6
0
        private void edtOperatorCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                if (edtOperatorCode.Text.Trim() != "")
                {
                    currentOperator = GetUserInfoWithIDCode(edtOperatorCode.Text.Trim());
                    if (currentOperator != null)
                    {
                        edtOperatorCode.Text =
                            string.Format(
                                "{0}[{1}]",
                                currentOperator.UserName,
                                currentOperator.UserCode);
                    }
                    else
                    {
                        edtOperatorCode.Text = "";
                    }
                }
                else
                {
                    edtOperatorCode.Text = "";
                    currentOperator      = null;
                }

                Clear();

                if (currentOperator != null)
                {
                    GetBatchsFromEquipment(station);

                    grdBatchNos.DataSource = batchs;
                    grdvBatchNos.UpdateCurrentRow();
                    grdvBatchNos.BestFitColumns();
                }

                RefreshCtrlInForm();
            }
        }
Пример #7
0
        private void btnEnd_Click(object sender, EventArgs e)
        {
            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                int    errCode = 0;
                string errText = "";

                IRAPMESClient.Instance.usp_SaveFact_BatchProductionEnd(
                    IRAPUser.Instance.CommunityID,
                    stationInfo.T216LeafID,
                    stationInfo.T107LeafID,
                    currentBatchNo,
                    IRAPUser.Instance.SysLogID,
                    out errCode,
                    out errText);
                WriteLog.Instance.Write(
                    string.Format("({0}){1}", errCode, errText),
                    strProcedureName);
                if (errCode != 0)
                {
                    XtraMessageBox.Show(
                        string.Format("在生产结束时发生错误:[{0}]", errText),
                        "系统信息",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    currentOperator = null;
                    currentBatchNo  = "";
                    startDatetime   = DateTime.Now;
                    pwos.Clear();
                    ppp.Clear();
                    InitMethodParamsGrid(ppp);

                    edtOperatorCode.Text      = "";
                    cboPrdtType.SelectedIndex = -1;
                    lblBatchNo.Text           = "";
                    lblProductTimeSpan.Text   = "";
                    lblStartTime.Text         = "";

                    grdParams.RefreshDataSource();
                    grdPWOs.RefreshDataSource();

                    prdtStatus = ProductionStatus.Idle;
                    RefreshForm();
                }
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }
Пример #8
0
        private void ucBatchSysProduction_Load(object sender, EventArgs e)
        {
            grdPWOs.DataSource = pwos;

            BatchProductInfo data = GetWorkUnitProductionInfo();

            if (data != null)
            {
                currentOperator = new STB006()
                {
                    UserCode = data.OperatorCode,
                    UserName = data.OperatorName,
                };
                currentBatchNo = data.BatchNumber;
                startDatetime  = data.BatchStartDate;
                if (data.InProduction == 0)
                {
                    prdtStatus = ProductionStatus.Idle;
                }
                else
                {
                    prdtStatus = ProductionStatus.Busy;
                }

                pwos = data.GetPWOsFromXML();
                #region 遍历所有生产工单,获取生产工单的在制品的材质
                //foreach (EntityBatchPWO pwo in pwos)
                //{
                //    int errCode = 0;
                //    string errText = "";

                //    string texture =
                //        GetTextureCodeFromMaterialCode(
                //            pwo.T102Code,
                //            out errCode,
                //            out errText);
                //    if (errCode == 0)
                //        pwo.Texture = texture;
                //    else
                //        pwo.Texture = "";
                //}
                #endregion
                grdPWOs.DataSource = pwos;
                grdvPWOs.BestFitColumns();

                edtOperatorCode.Text =
                    string.Format(
                        "{0}[{1}]",
                        currentOperator.UserName,
                        currentOperator.UserCode);
                lblBatchNo.Text   = currentBatchNo;
                lblStartTime.Text = startDatetime.ToString("yyyy-MM-dd HH:mm:ss");

                cboPrdtType.SelectedIndex = -1;
                for (int i = 0; i < cboPrdtType.Properties.Items.Count; i++)
                {
                    BatchRingCategory prdtType =
                        (BatchRingCategory)cboPrdtType.Properties.Items[i];
                    if (prdtType.T131LeafID == data.T131LeafID)
                    {
                        cboPrdtType.SelectedIndex = i;
                        break;
                    }
                }

                //GetMethodStandards(data.T131LeafID, stationInfo.T216LeafID, data.BatchNumber);
            }

            RefreshForm();
        }
Пример #9
0
        private void btnTerminate_Click(object sender, EventArgs e)
        {
            if (
                IRAPMessageBox.Instance.Show(
                    $"是否要终止当前炉次【{currentBatchNo}】的生产?",
                    "生产终止",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question,
                    MessageBoxDefaultButton.Button2) != DialogResult.Yes)
            {
                return;
            }

            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                int    errCode = 0;
                string errText = "";

                IRAPMESClient.Instance.usp_SaveFact_BatchBreakProduction(
                    IRAPUser.Instance.CommunityID,
                    stationInfo.T216LeafID,
                    stationInfo.T107LeafID,
                    currentBatchNo,
                    IRAPUser.Instance.SysLogID,
                    out errCode,
                    out errText);
                WriteLog.Instance.Write(
                    string.Format("({0}){1}", errCode, errText),
                    strProcedureName);
                if (errCode != 0)
                {
                    XtraMessageBox.Show(
                        string.Format("在生产终止时发生错误:[{0}]", errText),
                        "系统信息",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    currentOperator = null;
                    currentBatchNo  = "";
                    startDatetime   = DateTime.Now;
                    pwos.Clear();
                    ppp.Clear();
                    InitMethodParamsGrid(ppp);

                    edtOperatorCode.Text    = "";
                    lblBatchNo.Text         = "";
                    lblProductTimeSpan.Text = "";
                    lblStartTime.Text       = "";

                    GetDevices();
                    grdPWOs.RefreshDataSource();

                    GetMethodStandards(0, 0, "");

                    prdtStatus = ProductionStatus.Idle;
                    RefreshForm();
                }
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }