public ActionResult DeleteConfirmed(int id) { SMA_Lookup_SalesRep sMA_Lookup_SalesRep = db.SMA_Lookup_SalesRep.Find(id); sMA_Lookup_SalesRep.IsActive = false; sMA_Lookup_SalesRep.InActiveDT = DateTime.Now; CustomIdentity iden = (CustomIdentity)HttpContext.User.Identity; sMA_Lookup_SalesRep.InActiveBy = iden.UserId; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SalesRepId,SalesRepNo,UserId,FirstName,LastName,RoleId,ContactId,EnterUserId,EnterDate,IsActive")] SMA_Lookup_SalesRep sMA_Lookup_SalesRep) { if (ModelState.IsValid) { db.Entry(sMA_Lookup_SalesRep).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ContactId = new SelectList(db.SMA_Lookup_Contact, "ContactId", "Title", sMA_Lookup_SalesRep.ContactId); ViewBag.UserId = new SelectList(db.SMA_Lookup_User, "UserId", "FirstName", sMA_Lookup_SalesRep.UserId); ViewBag.RoleId = new SelectList(db.SMA_Lookup_User_Role, "RoleId", "RoleName", sMA_Lookup_SalesRep.RoleId); ViewBag.EnterUserId = new SelectList(db.SMA_Lookup_User, "UserId", "FirstName", sMA_Lookup_SalesRep.EnterUserId); return(View(sMA_Lookup_SalesRep)); }
// GET: Setting/SalesRep/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SMA_Lookup_SalesRep sMA_Lookup_SalesRep = db.SMA_Lookup_SalesRep.Find(id); if (sMA_Lookup_SalesRep == null) { return(HttpNotFound()); } return(View(sMA_Lookup_SalesRep)); }
// GET: Setting/SalesRep/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SMA_Lookup_SalesRep sMA_Lookup_SalesRep = db.SMA_Lookup_SalesRep.Find(id); if (sMA_Lookup_SalesRep == null) { return(HttpNotFound()); } ViewBag.ContactId = new SelectList(db.SMA_Lookup_Contact, "ContactId", "Title", sMA_Lookup_SalesRep.ContactId); ViewBag.UserId = new SelectList(db.SMA_Lookup_User, "UserId", "FirstName", sMA_Lookup_SalesRep.UserId); ViewBag.RoleId = new SelectList(db.SMA_Lookup_User_Role, "RoleId", "RoleName", sMA_Lookup_SalesRep.RoleId); ViewBag.EnterUserId = new SelectList(db.SMA_Lookup_User, "UserId", "FirstName", sMA_Lookup_SalesRep.EnterUserId); return(View(sMA_Lookup_SalesRep)); }