public ActionResult CreateDealer(Models.Dealers deal) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Dealers.Add(deal); database.SaveChanges(); return RedirectToAction("Index"); } else { return View(deal); } }
public ActionResult CreateDistributors(Models.Distributors dist) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Distributors.Add(dist); database.SaveChanges(); return RedirectToAction("AdminDistributors"); } else { return View(dist); } }
public ActionResult EditRegister(Models.Customers customer) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if(ModelState.IsValid) { database.Entry(customer).State = EntityState.Modified; database.SaveChanges(); return RedirectToAction("AdminRegister"); } return View() ; }
public ActionResult EditFeedbacks(Models.Feedbacks Feedback) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Entry(Feedback).State = EntityState.Modified; database.SaveChanges(); return RedirectToAction("AdminFeedBack"); } return View(); }
public ActionResult EditOrders(Models.Orders order) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Entry(order).State = EntityState.Modified; database.SaveChanges(); return RedirectToAction("AdminOrders"); } return View(); }
public ActionResult EditDistributors(Models.Distributors dist) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Entry(dist).State = EntityState.Modified; database.SaveChanges(); return RedirectToAction("AdminDistributors"); } return View(); }
public ActionResult EditFAQ(Models.FAQs faq) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Entry(faq).State = EntityState.Modified; database.SaveChanges(); return RedirectToAction("AdminFAQ"); } return View(); }
public ActionResult DeleteOrders(int Id) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { Models.Orders order = database.Orders.Find(Id); database.Orders.Remove(order); database.SaveChanges(); return RedirectToAction("AdminOrders"); } return View(database.Orders.Find(Id)); }
public ActionResult DeleteRegister(int Id) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { Models.Customers customer = database.Customers.Find(Id); database.Customers.Remove(customer); database.SaveChanges(); return RedirectToAction("AdminDealers"); } return View(database.Customers.Find(Id)); }
public ActionResult DeleteFAQ(int Id) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { Models.FAQs faq = database.FAQs.Find(Id); database.FAQs.Remove(faq); database.SaveChanges(); return RedirectToAction("AdminFAQ"); } return View(database.FAQs.Find(Id)); }
public ActionResult DeleteFeedback(int Id) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { Models.Feedbacks feeds = database.Feedbacks.Find(Id); database.Feedbacks.Remove(feeds); database.SaveChanges(); return RedirectToAction("AdminFeedback"); } return View(database.Feedbacks.Find(Id)); }
public ActionResult DeleteDistributors(int Id) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if(ModelState.IsValid) { Models.Distributors dist = database.Distributors.Find(Id); database.Distributors.Remove(dist); database.SaveChanges(); return RedirectToAction("AdminDistributors"); } return View(database.Distributors.Find(Id)); }
public ActionResult CreateRegister(Models.Customers customer) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Customers.Add(customer); database.SaveChanges(); return RedirectToAction("AdminRegister"); } else { return View(customer); } }
public ActionResult CreateOrders(Models.Orders order) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Orders.Add(order); database.SaveChanges(); return RedirectToAction("AdminOrder"); } else { return View(order); } }
public ActionResult CreateFeedback(Models.Feedbacks feeds) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.Feedbacks.Add(feeds); database.SaveChanges(); return RedirectToAction("AdminFeedback"); } else { return View(feeds); } }
public ActionResult CreateFAQ(Models.FAQs question) { Models.CompanyDatabase database = new Models.CompanyDatabase(); if (ModelState.IsValid) { database.FAQs.Add(question); database.SaveChanges(); return RedirectToAction("AdminFAQRegister"); } else { return View(question); } }