Ejemplo n.º 1
0
        private void btnCheck_Click(object sender, EventArgs e)
        {
            if (dgvMaster.CurrentRow != null)
            {
                DataRow masterRow = ((DataRowView)dgvMaster.CurrentRow.DataBoundItem).Row;
                try
                {
                    BillDal billDal = new BillDal();
                    if (masterRow["STATE"].ToString() == "1")//�ѱ���
                    {
                        billDal.CheckBill(masterRow["BILLNO"].ToString(), "2", UserID, SysDate);
                        masterRow["STATE"] = "2";
                        masterRow["STATEDESC"] = "���";
                        masterRow["CHECKER"] = UserName;
                        masterRow["CHECKDATE"] = SysDate;
                        btnCheck.Text = "����";
                        THOKUtil.ShowInfo("������˲����ɹ���");
                    }
                    else if (masterRow["STATE"].ToString() == "2")//�����
                    {
                        billDal.CheckBill(dgvMaster.CurrentRow.Cells["BILLNO"].Value.ToString(), "1", "", "");
                        masterRow["STATE"] = "1";
                        masterRow["STATEDESC"] = "����";
                        masterRow["CHECKER"] = "";
                        masterRow["CHECKDATE"] = "";
                        btnCheck.Text = "���";
                        THOKUtil.ShowInfo("���ݷ�������ɹ���");
                    }

                    SetButtonState(masterRow);
                }
                catch (Exception exp)
                {
                    THOKUtil.ShowInfo(btnCheck.Text + "����ʧ�ܣ�ԭ��" + exp.Message);
                }
            }
        }
Ejemplo n.º 2
0
        private void btnCheck_Click(object sender, EventArgs e)
        {
            if (dgvMaster.CurrentRow != null)
            {
                DataRow masterRow = ((DataRowView)dgvMaster.CurrentRow.DataBoundItem).Row;
                try
                {
                    BillDal billDal = new BillDal();

                    if (masterRow["STATE"].ToString().Trim() == "1")//�ѱ���
                    {
                        billDal.VerifyQuantity(detailTable, null);

                        if (new ProductStateDal().GetUnmixCount(masterRow["BILLNO"].ToString()) != 0)
                            throw new Exception("������Ҫ��װ�IJ�Ʒ�����Ƚ��л�װ����");

                        billDal.CheckBill(masterRow["BILLNO"].ToString(),"2", UserID, SysDate);

                        masterRow["STATE"] = "2";
                        masterRow["STATEDESC"] = "���";
                        masterRow["CHECKER"] = UserName;
                        masterRow["CHECKDATE"] = SysDate;
                        btnCheck.Text = "����";

                        SetButtonState(masterRow["STATE"].ToString());

                        THOKUtil.ShowInfo("������˲����ɹ���");
                    }
                    else if (masterRow["STATE"].ToString() == "2")//�����
                    {
                        billDal.CheckBill(masterRow["BILLNO"].ToString(), "1", "", "");
                        masterRow["STATE"] = "1";
                        masterRow["STATEDESC"] = "����";
                        masterRow["CHECKER"] = "";
                        masterRow["CHECKDATE"] = "";
                        btnCheck.Text = "���";
                        THOKUtil.ShowInfo("���ݷ�������ɹ���");
                        SetButtonState(masterRow["STATE"].ToString());
                    }

                }
                catch (Exception exp)
                {
                    THOKUtil.ShowInfo(btnCheck.Text + "����ʧ�ܣ�ԭ��" + exp.Message);
                }
            }
        }