コード例 #1
0
        /// <summary>
        /// 品檢問題列表記錄選擇
        /// </summary>
        private void lvwQualityProblemList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.m_frmProjectQualityCheckBase.ListViewQCRecords.SelectedItems.Count > 0)
            {
                //this.m_iQCIssueRowIdx = lvwQualityProblemList.SelectedItems[0].Index;

                AbstractProjectQCManager.QCPloblemViewInfo viewInfo = this.m_frmProjectQualityCheckBase.ListViewQCRecords.SelectedItems[0].Tag as AbstractProjectQCManager.QCPloblemViewInfo;
                this.m_CurrentQCViewInfo = viewInfo;

                if (!this.m_IsInputingQCQty)
                {
                    if (viewInfo != null)// 品檢問題記錄信息轉換成功
                    {
                        this.m_frmProjectQualityCheckBase.UCNumericUpDownProdQty.Value = viewInfo.pqc_iProdQTY;//打卡數量
                        this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value = viewInfo.pqc_iQCQTY;//抽檢數量
                        this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.MaxValue = m_frmProjectQualityCheckBase.UCNumericUpDownProdQty.Value;//抽檢數量的最大值為打卡數量
                        this.m_frmProjectQualityCheckBase.LabelQCTimes.Text = viewInfo.pqc_iQCTimes.ToString();//品檢次數
                        this.m_frmProjectQualityCheckBase.UCNumericUpDownWasteQty.Value = viewInfo.WasteQty;//廢品數量
                        this.m_frmProjectQualityCheckBase.UCNumericUpDownDefectiveQty.Value = viewInfo.DefectiveQty;//次品數量
                        this.m_frmProjectQualityCheckBase.TextBoxDealMethod.Text = string.Empty;
                        this.m_frmProjectQualityCheckBase.ComboBoxQCName.SelectedValue = viewInfo.ProblemID.ToString();//問題列表選擇

                        SetStatus();

                        return;
                    }
                }
            }
            else
            {
                this.EditStatus = EnmEditStatus.Normal;
            }
        }
コード例 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.m_frmProjectQualityCheckBase.ComboBoxQCName.SelectedValue == null && this.m_frmProjectQualityCheckBase.ComboBoxQCName.SelectedIndex < 0)
            {
                this.ShowWarningMessage("請選擇品檢問題。");
                return;
            }

            AbstractProjectQCManager.QCPloblemViewInfo currentQCRecord = this.m_CurrentQCViewInfo;
            if (currentQCRecord != null)
            {
                int iCheckQty = this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value;
                int iWasteQty = this.m_frmProjectQualityCheckBase.UCNumericUpDownWasteQty.Value;
                int iDefectiveQty = this.m_frmProjectQualityCheckBase.UCNumericUpDownDefectiveQty.Value;
                string strProblem = this.m_frmProjectQualityCheckBase.ComboBoxQCName.SelectedValue.ToString();
                int iProblem = int.Parse(strProblem);

                if (iWasteQty == 0 && iDefectiveQty == 0)
                {
                    this.ShowWarningMessage("QC廢品數量和次品數量不能同時為0。");
                    return;
                }

                if (iWasteQty + iDefectiveQty > iCheckQty)
                {
                    this.ShowWarningMessage("廢品數量+次品數量不能大於抽查數量。");
                    return;
                }

                if (this.m_CurrentProblemID == Guid.Empty)
                {
                    #region 新增

                    this.m_ProjectQCManager.AddQCIssueRecord(currentQCRecord.RecordID, iCheckQty, iWasteQty, iDefectiveQty, iProblem);
                    this.EditStatus = EnmEditStatus.Problem;

                    #endregion

                }
                else
                {
                    #region 修改

                    this.m_ProjectQCManager.SaveQCIssueRecord(currentQCRecord.RecordID, currentQCRecord.SubRecordID, iWasteQty, iDefectiveQty, iProblem);
                    this.EditStatus = EnmEditStatus.Normal;
                    this.m_CurrentProblemID = Guid.Empty;

                    #endregion
                }

                this.m_frmProjectQualityCheckBase.ComboBoxQCName.SelectedIndex = -1;
                this.m_frmProjectQualityCheckBase.TextBoxDealMethod.Text = string.Empty;
                this.m_frmProjectQualityCheckBase.UCNumericUpDownWasteQty.Value = 0;
                this.m_frmProjectQualityCheckBase.UCNumericUpDownDefectiveQty.Value = 0;
            }
        }
コード例 #3
0
 /// <summary>
 /// 初始化參數
 /// </summary>
 private void InitParams()
 {
     this.m_CurrentQCRecList = null;
     this.m_CurrentListQCViewInfos = null;
     this.EditStatus = EnmEditStatus.Normal;
     //this.m_iQCIssueRowIdx = 0;
 }
コード例 #4
0
        private void btnExistProblem_Click(object sender, EventArgs e)
        {
            if (this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value < 1)
            {
                this.ShowWarningMessage("抽查數量不能為零。");
                return;
            }

            if (this.m_CurrentQCViewInfo != null)
            {
                this.EditStatus = EnmEditStatus.Problem;

                this.m_CurrentProblemID = Guid.Empty;

                this.m_frmProjectQualityCheckBase.UCNumericUpDownWasteQty.MaxValue = this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value;//廢品數量不能超過抽檢數量
                this.m_frmProjectQualityCheckBase.UCNumericUpDownDefectiveQty.MaxValue = this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value;//次品數量不能超過抽檢數量

                //this.m_IsInputingQCQty = true;
            }
        }
コード例 #5
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            AbstractProjectQCManager.QCPloblemViewInfo currentQCViewInfo = this.m_CurrentQCViewInfo;
            if (currentQCViewInfo != null)
            {
                if (currentQCViewInfo.pqc_dQCEndTime != null)
                {
                    base.ShowWarningMessage("本條品檢紀錄已結束,不能進行修改操作。");
                    return;
                }
                if (currentQCViewInfo.SubRecordID != Guid.Empty)//修改問題
                {
                    this.m_CurrentProblemID = currentQCViewInfo.SubRecordID;//設置當前品檢問題記錄ID

                    this.m_frmProjectQualityCheckBase.ListViewQCRecords.Enabled = false;
                    this.m_frmProjectQualityCheckBase.ButtonSave.Enabled = true;
                    this.m_frmProjectQualityCheckBase.ButtonCancel.Enabled = true;
                    this.m_frmProjectQualityCheckBase.UCNumericUpDownWasteQty.Enabled = true;
                    this.m_frmProjectQualityCheckBase.UCNumericUpDownDefectiveQty.Enabled = true;
                    this.m_frmProjectQualityCheckBase.ComboBoxQCName.Enabled = true;

                    this.m_frmProjectQualityCheckBase.UCNumericUpDownProdQty.Text = currentQCViewInfo.pqc_iProdQTY.ToString();
                    this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value = currentQCViewInfo.pqc_iQCQTY;
                    this.m_frmProjectQualityCheckBase.UCNumericUpDownWasteQty.Value = currentQCViewInfo.WasteQty;
                    this.m_frmProjectQualityCheckBase.UCNumericUpDownDefectiveQty.Value = currentQCViewInfo.DefectiveQty;
                    this.m_frmProjectQualityCheckBase.ComboBoxQCName.SelectedValue = currentQCViewInfo.ProblemID.ToString();
                }
                else
                {
                    this.EditStatus = EnmEditStatus.End;
                }
            }
        }
コード例 #6
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     AbstractProjectQCManager.QCPloblemViewInfo currentQCViewInfo = this.m_CurrentQCViewInfo;
     if (currentQCViewInfo == null)
     {
         this.ShowInformationMessage("請先選中需要刪除的記錄。");
         return;
     }
     if (this.ShowQuestionMessage("確認要刪除本條記錄?"))
     {
         string strDesc = this.m_ProjectQCManager.DeleteQCIssueRecord(currentQCViewInfo.RecordID, currentQCViewInfo.SubRecordID);
         if (!string.IsNullOrEmpty(strDesc))
         {
             this.ShowWarningMessage(strDesc);
         }
         else
         {
             this.EditStatus = EnmEditStatus.Normal;
         }
     }
 }
コード例 #7
0
        private void btnEnd_Click(object sender, EventArgs e)
        {
            AbstractProjectQCManager.QCPloblemViewInfo currentQCRecord = this.m_CurrentQCViewInfo;
            if (this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value == 0)
            {
                this.ShowWarningMessage("抽查數量不能為零。");
                return;
            }

            if (currentQCRecord != null)
            {
                string strDesc = this.m_ProjectQCManager.SaveEndQCRecord(currentQCRecord.RecordID, DateTime.Now, this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.Value);
                if (!string.IsNullOrEmpty(strDesc))
                {
                    base.ShowWarningMessage(strDesc);
                }
                else
                {
                    this.EditStatus = EnmEditStatus.Finish;
                }
            }

            //this.m_IsInputingQCQty = false;
        }
コード例 #8
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     if (this.ShowQuestionMessage("確認取消錄入嗎?"))
     {
         this.EditStatus = EnmEditStatus.Normal;
     }
 }
コード例 #9
0
        private void btnCancelAdd_Click(object sender, EventArgs e)
        {
            if (this.m_CurrentQCViewInfo == null)
            {
                return;
            }

            if (base.ShowQuestionMessage("確認要刪除本條記錄?"))
            {
                string strDesc = this.m_ProjectQCManager.DeleteQCIssueRecord(this.m_CurrentQCViewInfo.RecordID, null);
                if (!string.IsNullOrEmpty(strDesc))
                {
                    base.ShowWarningMessage(strDesc);
                }
                else
                {
                    this.EditStatus = EnmEditStatus.Normal;
                }
            }
        }
コード例 #10
0
        private void btnBegin_Click(object sender, EventArgs e)
        {
            if (this.m_CurrentQCViewInfo == null)
            {
                ShowWarningMessage("請選擇開始QC的記錄。");
                return;
            }
            else
            {
                int iTotalQty = 0;
                int iProdQty = this.m_frmProjectQualityCheckBase.UCNumericUpDownProdQty.Value;
                try
                {
                    iTotalQty = int.Parse(this.m_frmProjectQualityCheckBase.LabelCurrentOutput.Text.Trim());
                }
                catch (Exception)
                {
                    iTotalQty = this.m_ProjectQCManager.RealTimeProductionQty;
                }

                this.m_frmProjectQualityCheckBase.UCNumericUpDownCheckQty.MaxValue = iProdQty;

                if (iProdQty <= 0 || iProdQty > iTotalQty)
                {
                    base.ShowWarningMessage("[打卡數量]必須>0且不能大於[總生產數量]。");
                    return;
                }
                this.m_ProjectQCManager.SaveBeginQCRecord(this.m_CurrentQCViewInfo.RecordID, DateTime.Now, m_frmProjectQualityCheckBase.UCNumericUpDownProdQty.Value);

                this.EditStatus = EnmEditStatus.End;
                //this.m_IsInputingQCQty = true;
            }
        }
コード例 #11
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     string strDesc = this.m_ProjectQCManager.AddNewQCRecord();
     if (!string.IsNullOrEmpty(strDesc))
     {
         ShowInformationMessage(strDesc);
     }
     else
     {
         this.EditStatus = EnmEditStatus.AddRecord;
     }
 }
コード例 #12
0
        /// <summary>
        /// 設置版面狀態
        /// </summary>
        private void SetStatus()
        {
            AbstractProjectQCManager.QCPloblemViewInfo currentQCViewInfo = this.m_CurrentQCViewInfo;
            if (currentQCViewInfo == null)
            {
                this.EditStatus = EnmEditStatus.Normal;
                return;
            }

            //判斷是否已開始或已結束
            if (currentQCViewInfo.pqc_dQCBeginTime != null)
            {
                if (currentQCViewInfo.pqc_dQCEndTime != null)
                {
                    this.EditStatus = EnmEditStatus.Finish;
                }
                else
                {
                    this.EditStatus = EnmEditStatus.End;
                }
            }
            else
            {
                this.EditStatus = EnmEditStatus.Begin;
            }
        }