// GET: UserRoles/Delete/5 public ActionResult Delete(string id) { addUserRoleDisply mod = DataController.getUserDisply(id); //return View("Index"); return(Delete(mod)); }
public static addUserRoleDisply getUserDisply(string id) { SqlConnection con = new SqlConnection(); string path = ConfigurationManager.ConnectionStrings[db].ConnectionString; con.ConnectionString = path; DataTable UserTable = new DataTable(); addUserRoleDisply model = new addUserRoleDisply(); try { SqlDataAdapter adpAuctions = new SqlDataAdapter("SELECT Id, UserName, Email, PhoneNumber from AspNetUsers WHERE Id ='" + id + "'", con); adpAuctions.Fill(UserTable); } catch (DataException e) { throw e; } foreach (DataRow row in UserTable.Rows) { model.userId = row.ItemArray[0].ToString(); model.UserName = row.ItemArray[1].ToString(); model.Email = row.ItemArray[2].ToString(); model.Selnumber = row.ItemArray[3].ToString(); } return(model); }
// GET: UserRoles/Edit/5 public ActionResult Edit(string id) { addUserRoleDisply mod = DataController.getUserDisply(id); //return View(mod); return(Edit(mod)); // return View(mod); }
public ActionResult Delete(addUserRoleDisply model) { try { // TODO: Add delete logic here string id = model.userId; DataController.revokeRole(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(addUserRoleDisply model) { try { // TODO: Add update logic here //string id = model.userId; DataController.GrantAdminToUse(model.userId); return(RedirectToAction("Index")); } catch (Exception e) { return(View()); } }