Exemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     BillDialog billDialog = new BillDialog(masterTable.NewRow(), "3");
     if (billDialog.ShowDialog() == DialogResult.OK)
     {
         DataRow row = billDialog.MasterRow;
         row["ORIBILLNO"] = "";
         row["STATUS"] = "0";//�ֹ�����
         row["STATE"] = "1";
         row["STATEDESC"] = "����";
         row["OPERATER"] = UserID;
         row["USERNAME"] = UserName;
         row["OPERATEDATE"] = SysDate;
         try
         {
             billDal.AddBill3(row, billDialog.DetailTable);
             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;
         BillDialog billDialog = new BillDialog(masterRow, detailTable, "3", masterRow["STATE"].ToString() == "1");
         if (billDialog.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 detailTable = billDialog.DetailTable;
                 billDal.SaveBill3(masterRow, detailTable);
             }
             catch (Exception exp)
             {
                 THOKUtil.ShowInfo("������ⵥʧ�ܣ�ԭ��" + exp.Message);
             }
         }
         else
             detailTable.RejectChanges();
     }
 }