Beispiel #1
0
        private void btCreat_Click(object sender, EventArgs e)
        {
            if (txtReason.Text.Trim() == "")
            {
                MessageDialog.ShowPromptMessage("请填写隔离原因");
                return;
            }
            else if (txtMeansAndAsk.Text.Trim() == "")
            {
                MessageDialog.ShowPromptMessage("请填写处理方法和要求");
                return;
            }


            合格品处理部门 form = new  合格品处理部门();

            form.ShowDialog();

            if (!form.BlFlag)
            {
                MessageDialog.ShowPromptMessage("请选择要求的处理部门");
                return;
            }
            else
            {
                m_strCLBM = form.StrCLBM;
            }

            GetMessage();

            DataTable dt = (DataTable)dataGridView1.DataSource;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["选"].ToString() != "0")
                {
                    m_lnqIslation.DJH      = m_billNoControl.GetNewBillNo();
                    m_lnqIslation.BatchNo  = dt.Rows[i]["批次号"].ToString();
                    m_lnqIslation.Amount   = Convert.ToDecimal(dt.Rows[i]["库存数量"]);
                    m_lnqIslation.Provider = dt.Rows[i]["供货单位"].ToString();

                    if (m_serverIsolation.UpdateBill(m_lnqIslation, false, out m_err))
                    {
                        m_billMessageServer.DestroyMessage(m_lnqIslation.DJH);
                        m_billMessageServer.SendNewFlowMessage(m_lnqIslation.DJH,
                                                               string.Format("{0}号不合格品隔离处置单已提交,请等待主管审核", m_lnqIslation.DJH),
                                                               BillFlowMessage_ReceivedUserType.角色, m_billMessageServer.GetSuperior(CE_RoleStyleType.级领导, BasicInfo.LoginID));
                    }
                    else
                    {
                        MessageDialog.ShowErrorMessage(m_err);
                        return;
                    }
                }
            }

            this.Close();
        }
        private void 编制信息提交ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lbDJZT.Text == "新建单据" || lbDJZT.Text == "等待主管审核" || lbDJZT.Text == "等待仓管调出")
            {
                合格品处理部门 form = new  合格品处理部门();
                form.ShowDialog();

                if (!form.BlFlag)
                {
                    MessageDialog.ShowPromptMessage("请选择要求的处理部门");
                    return;
                }
                else
                {
                    lbCLBM.Tag  = form.StrCLBM;
                    lbCLBM.Text = m_serverDepartment.GetDepartmentName(form.StrCLBM);
                }

                GetMessage();

                if (m_lnqIslation.GoodsID.ToString().Trim() == "" ||
                    m_lnqIslation.StorageID.ToString().Trim() == "")
                {
                    MessageBox.Show("请完整填写信息区的信息", "提示");
                    return;
                }

                if (m_serverIsolation.UpdateBill(m_lnqIslation, true, out m_err))
                {
                    MessageBox.Show("成功提交!", "提示");

                    m_billMessageServer.DestroyMessage(m_lnqIslation.DJH);
                    m_billMessageServer.SendNewFlowMessage(m_lnqIslation.DJH,
                                                           string.Format("{0}号不合格品隔离处置单已提交,请等待质量工程师",
                                                                         m_lnqIslation.DJH), CE_RoleEnum.质量工程师);
                }
                else
                {
                    MessageDialog.ShowErrorMessage(m_err);
                }

                RefreshDataGirdView(m_serverIsolation.GetAllBill(null));
            }
            else
            {
                MessageBox.Show("请重新确认单据状态!", "提示");
            }

            PositioningRecord(m_lnqIslation.DJH);
        }