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(); }
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(); }