// [Authorize(Roles = "Admin,Editor,Registered User")] public ActionResult Delete(int id) { string query = "select * from MedicalStaffDirectories where MedicalStaffDirectoryId = @id"; SqlParameter sqlparams = new SqlParameter("@id", id); MedicalStaffDirectory selectedMember = db.MedicalStaffDirectories.SqlQuery(query, sqlparams).FirstOrDefault(); return(View(selectedMember)); }
public ActionResult Update(int id) { MedicalStaffDirectory selectedmember = db.MedicalStaffDirectories.SqlQuery("Select * from MedicalStaffDirectories where MedicalStaffDirectoryId=@id", new SqlParameter("@id", id)).FirstOrDefault(); List <Department> Departments = db.Departments.SqlQuery("Select * from Departments").ToList(); List <ApplicationUser> Users = db.Users.ToList(); AddUpdateMedicalStaffDirectory AddMedicalStaffDirectory = new AddUpdateMedicalStaffDirectory(); AddMedicalStaffDirectory.MedicalStaffDirectory = selectedmember; AddMedicalStaffDirectory.Departments = Departments; AddMedicalStaffDirectory.Users = Users; return(View(AddMedicalStaffDirectory)); }