// GET: Bills/Create public ActionResult CreateAccount_bill() { string date = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt"); string month = DateTime.Now.ToString("MMMM"); DBmodel payrollentities = new DBmodel(); Biil biil = new Biil(); biil.Date = date; return(View(biil)); }
public ActionResult CreateAccount_bill(Biil biil) { try { using (DBmodel payrollentities = new DBmodel()) { payrollentities.Biils.Add(biil); payrollentities.SaveChanges(); } return(RedirectToAction("BillList")); } catch { return(View()); } }
public ActionResult EditDetails_bill(int id, Biil biil) { try { using (DBmodel payrollentities = new DBmodel()) { payrollentities.Entry(biil).State = EntityState.Modified; payrollentities.SaveChanges(); } return(RedirectToAction("BillList")); } catch { return(View()); } }
public ActionResult DeleteDetails_bill(int id, FormCollection collection) { try { // TODO: Add delete logic here using (DBmodel payrollentities = new DBmodel()) { Biil biil = payrollentities.Biils.Where(x => x.BillId == id).FirstOrDefault(); payrollentities.Biils.Remove(biil); payrollentities.SaveChanges(); } return(RedirectToAction("BillList")); } catch { return(View()); } }