public void Save(PurchaseInfo obj) { PurchaseDLL objDll = new PurchaseDLL(); objDll.Save(obj); }
private void btnSave_Click(object sender, EventArgs e) { PurchaseInfo purchaseInfo = new PurchaseInfo(); // Validation should be in separate class. GetTxtFieldData(purchaseInfo); purchaseInfo.UpdateComputer = Environment.MachineName; purchaseInfo.AddPurchaseDate(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss tt")); purchaseInfo.AddUpdateDate(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss tt")); // Inserting value by a data link layer. // Should be via BLL. Change will come PurchaseDLL purchaseDll = new PurchaseDLL(); purchaseDll.Save(purchaseInfo); FillDataGridView(); ClearTxtField(); }