Exemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     BillInDialog billDialog = new BillInDialog(masterTable.NewRow());
     if (billDialog.ShowDialog() == DialogResult.OK)
     {
         DataRow row = billDialog.MasterRow;
         row["ORIBILLNO"] = "";
         row["STATUS"] = "0";//�ֹ�����
         row["STATUSNAME"] = "�ֹ�����";
         row["STATE"] = "1";
         row["STATEDESC"] = "����";
         row["OPERATER"] = UserID;
         row["USERNAME"] = UserName;
         row["OPERATEDATE"] = SysDate;
         try
         {
             billDal.AddBill(row, billDialog.DetailTable, "P", row["BILLDATE"].ToString());
             masterTable.Rows.InsertAt(row, 0);
             bsMain.Position = 0;
         }
         catch (Exception exp)
         {
             THOKUtil.ShowInfo("������ⵥʧ�ܣ�ԭ��" + exp.Message);
         }
     }
 }
Exemplo n.º 2
0
 private void btnModify_Click(object sender, EventArgs e)
 {
     if (dgvMaster.CurrentRow != null)
     {
         DataRow masterRow = ((DataRowView)dgvMaster.CurrentRow.DataBoundItem).Row;
         BillInDialog billDialog = new BillInDialog(masterRow, detailTable, masterRow["STATUS"].ToString() == "0" && masterRow["STATE"].ToString() == "1");
         if (billDialog.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 detailTable = billDialog.DetailTable;
                 billDal.SaveBill(masterRow, detailTable);
             }
             catch (Exception exp)
             {
                 THOKUtil.ShowInfo("������ⵥʧ�ܣ�ԭ��" + exp.Message);
             }
         }
         else
             detailTable.RejectChanges();
     }
 }