private void btnSave_Click(object sender, EventArgs e) { if (txtScheduleNo.Text.Trim().Length == 0) { THOKUtil.ShowInfo("���κŲ���Ϊ�ա�"); return; } if (detailTable.Rows.Count == 0) { THOKUtil.ShowInfo("���ⵥ��ϸ����Ϊ�ա�"); return; } try { BillDal billDal = new BillDal(); billDal.VerifyQuantity(detailTable, productState); } catch (Exception exp) { THOKUtil.ShowInfo(exp.Message); return; } DialogResult = DialogResult.OK; }
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); } } }