示例#1
0
        private void btnupdate_Click(object sender, EventArgs e)
        {
            PurchaseInfo purchaseInfo = new PurchaseInfo();

            GetTxtFieldData(purchaseInfo);
            purchaseInfo.AddUpdateDate(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss tt"));
            purchaseInfo.UpdateComputer = Environment.MachineName;

            PurchaseBLL objUpdate = new PurchaseBLL();
            objUpdate.Update(purchaseInfo);
            FillDataGridView();
            ClearTxtField();
        }
示例#2
0
 private void btndelete_Click(object sender, EventArgs e)
 {
     PurchaseInfo deleteInfo = new PurchaseInfo();
     GetTxtFieldData(deleteInfo);
     DialogResult dialog = MessageBox.Show("Do you want to delete the selected row?","Delete",  MessageBoxButtons.YesNo);
     if (dialog == DialogResult.Yes)
     {
         PurchaseBLL objBll = new PurchaseBLL();
         objBll.Delete(deleteInfo);
     }
     FillDataGridView();
     ClearTxtField();
 }