public ActionResult DeleteConfirmed(int id) { StaffAccess staffAccess = db.StaffAccesses.Find(id); db.StaffAccesses.Remove(staffAccess); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "StaffAccessID,SystemAuthorizationID,StaffRoleID,IsAccessible")] StaffAccess staffAccess) { if (ModelState.IsValid) { db.Entry(staffAccess).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StaffRoleID = new SelectList(db.StaffRoles, "StaffRoleID", "RoleName", staffAccess.StaffRoleID); ViewBag.SystemAuthorizationID = new SelectList(db.SystemAuthorizations, "SystemAuthorizationID", "Add_Edit_Del", staffAccess.SystemAuthorizationID); return(View(staffAccess)); }
// GET: StaffAccesses/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StaffAccess staffAccess = db.StaffAccesses.Find(id); if (staffAccess == null) { return(HttpNotFound()); } return(View(staffAccess)); }
// GET: StaffAccesses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StaffAccess staffAccess = db.StaffAccesses.Find(id); if (staffAccess == null) { return(HttpNotFound()); } ViewBag.StaffRoleID = new SelectList(db.StaffRoles, "StaffRoleID", "RoleName", staffAccess.StaffRoleID); ViewBag.SystemAuthorizationID = new SelectList(db.SystemAuthorizations, "SystemAuthorizationID", "Add_Edit_Del", staffAccess.SystemAuthorizationID); return(View(staffAccess)); }
public StaffAccess updatestaff(StaffAccess Staffsccess, long id) { // Query the database for the row to be updated. var query = from ord in _dbContext.StaffAccess where ord.ID == id select ord; // Query the database for the row to be updated. // Execute the query, and change the column values // you want to change. foreach (StaffAccess ord in query) { ord.fname = Staffsccess.fname; ord.lname = Staffsccess.lname; ord.emailid = Staffsccess.emailid; ord.phoneno = Staffsccess.phoneno; ord.designation = Staffsccess.designation; ord.order = Staffsccess.order; ord.book = Staffsccess.book; ord.quote = Staffsccess.quote; ord.service = Staffsccess.service; ord.revenuemodel = Staffsccess.revenuemodel; ord.invoice = Staffsccess.invoice; ord.payment = Staffsccess.payment; ord.customer = Staffsccess.customer; ord.supplier = Staffsccess.supplier; ord.addstaff = Staffsccess.addstaff; ord.Status = Staffsccess.Status; ord.UpdatedDate = Staffsccess.UpdatedDate; // Insert any additional changes to column values. } // Query the database for the row to be updated. try { _dbContext.SaveChanges(); } catch (Exception ex) { } return(Staffsccess); }
public StaffAccess updatestaff(StaffAccess Staffsccess, long id) { var changes = newusermanager.updatestaff(Staffsccess, id); return(changes); }
public StaffAccess Savestaff(StaffAccess Staffsccess) { Staffsccess = newusermanager.Savestaff(Staffsccess); return(Staffsccess); }
public StaffAccess Savestaff(StaffAccess Staffsccess) { _dbContext.StaffAccess.Add(Staffsccess); _dbContext.SaveChanges(); return(Staffsccess); }