// GET: userInfoes/Details/5 /*public ActionResult Details(int? id) * { * if (id == null) * { * return new HttpStatusCodeResult(HttpStatusCode.BadRequest); * } * userInfo userInfo = db.userInfo.Find(id); * if (userInfo == null) * { * return HttpNotFound(); * } * return View(userInfo); * }*/ /*=======Provide list of areas to be added for Subuser under Vendor==========*/ public ActionResult Addarea(int id) { areaAssignedModel obj = new areaAssignedModel(); using (var context = new promoLacDbEntities()) { obj.detail = Getarea(vendorId(User.Identity.Name)); obj.vendorId = id; return(View(obj)); } }
public ActionResult Addarea(areaAssignedModel u) { using (var context = new promoLacDbEntities()) { areaAssigned a = new areaAssigned() { vendorId = u.vendorId, areaId = 1 }; context.areaAssigneds.Add(a); context.SaveChanges(); } return(RedirectToAction("../controlPanel/controlPanel")); }