public AdminWorkPopUp UpdateUserDetailsInPopup(string UserName) { IMultipleResults data = dataDB.GetUserDetailsInAdminPopup(UserName); AdminWorkPopUp adPopup = new AdminWorkPopUp(); foreach (UserRegistration res in data.GetResult<UserRegistration>()) { adPopup.RegName = res.RegName; adPopup.RegUserName = res.RegUserName; adPopup.RegEMail = res.RegEMail; adPopup.RegAddress = res.RegAddress; adPopup.RegPhone = res.RegPhone; adPopup.RegCompany = res.RegCompany; adPopup.AdminName = res.AdminName; adPopup.LastUpdate = res.TimeStamp.ToString(); } return adPopup; }
public ActionResult AdminWorkPopUp(mvcTestingModel mvcModel, AdminWorkPopUp adminModel) { mvcTestingDB mvcDB = new mvcTestingDB(); try { string AdminLogin = Session["Adminlogin"].ToString(); string AdminDropdown = Session["adminDropDown"].ToString(); if (AdminLogin != "") { if ((AdminDropdown != "Support") && (AdminDropdown != "Admin")) { int result = mvcDB.UpdateUserDetailsInDatabase(mvcModel.AdminWorkPopUp.RegName, mvcModel.AdminWorkPopUp.RegUserName, mvcModel.AdminWorkPopUp.RegEMail, mvcModel.AdminWorkPopUp.RegAddress, mvcModel.AdminWorkPopUp.RegPhone, mvcModel.AdminWorkPopUp.RegCompany, AdminLogin); if (result == 0) { ViewData["result"] = "true"; } else { ViewData["result"] = "false"; } } else { ViewData["delete"] = "false2"; } } else { return RedirectToAction("ErrorPage"); } } catch { return RedirectToAction("About", "Home"); } return View(); }
public AdminWorkPopUp GetLastUpdatedDetails(string UsrName) { ISingleResult<LastUpdatedDetailsResult> data = dataDB.LastUpdatedDetails(UsrName); AdminWorkPopUp adPopup = new AdminWorkPopUp(); foreach (var res in data) { adPopup.AdminName = res.AdminName; adPopup.LastUpdate = res.LastUpdated.ToString(); } return adPopup; }
public ActionResult AdminWorkPopUp(mvcTestingModel mvcModel) { mvcTestingDB mvcDB = new mvcTestingDB(); AdminWorkPopUp adminModel = new AdminWorkPopUp(); //string AdminLogin = Session["Adminlogin"].ToString(); if (Session["Adminlogin"] != null) { string AdminLogin = Session["Adminlogin"].ToString(); string UserName = Request.QueryString["Name"]; mvcModel.AdminWorkPopUp = mvcDB.UpdateUserDetailsInPopup(UserName); if (mvcModel.AdminWorkPopUp.AdminName != null) { ViewBag.Value = "Last Updated By: " + mvcModel.AdminWorkPopUp.AdminName + " Date: " + mvcModel.AdminWorkPopUp.LastUpdate.ToString(); } else { ViewBag.Value = "Updates not available yet"; } } else { return RedirectToAction("ErrorPage"); } return View(mvcModel); }