public ActionResult Index() { var CusData = new CusomerDTO() { customerList = _db.customers.ToList() }; //var results = (from row in _db.customers select row).ToList(); return(View(CusData)); }
public ActionResult EditCustomer(CusomerDTO s, int id) { customer result = _db.customers.Single(customer => customer.id == id); result.name = s.customerData.name; result.gender = s.customerData.gender; result.email = s.customerData.email; result.address = s.customerData.address; result.contact_no = s.customerData.contact_no; _db.SaveChanges(); return(RedirectToAction("Index", "Customer")); }
public ActionResult AddCustomer(CusomerDTO c) { _db.customers.Add(c.customerData); _db.SaveChanges(); return(RedirectToAction("Index", "Customer")); }