// GET: RpasUser/Edit/5 public ActionResult Edit(int?id) { if (!exLogic.User.hasAccess("RPASUSER.EDIT")) { return(RedirectToAction("NoAccess", "Home")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MSTR_User mSTR_User = db.MSTR_User.Find(id); MSTR_User_Pilot mSTR_User_Pilot = db.MSTR_User_Pilot.Find(id); if (mSTR_User == null) { return(HttpNotFound()); } var viewModel = new ViewModel.UserViewModel { User = mSTR_User, Pilot = mSTR_User_Pilot, ProfileList = Util.GetProfileList(), CountryList = Util.GetCountryLists("Country", "CountryName", "Code", "sp"), AccountList = Util.GetAccountList(), DashboardList = Util.GetDashboardLists(), PermitCategoryList = Util.GetLists("RPASCategory") }; return(View(viewModel)); //return View(mSTR_User); }
public ActionResult DeleteConfirmed(int id) { MSTR_User mSTR_User = db.MSTR_User.Find(id); db.MSTR_User.Remove(mSTR_User); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: RpasUser/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MSTR_User mSTR_User = db.MSTR_User.Find(id); if (mSTR_User == null) { return(HttpNotFound()); } return(View(mSTR_User)); }
public PilotEditModel(int UserID) { ExponentPortalEntities db = new ExponentPortalEntities(); MSTR_User mSTR_User = db.MSTR_User.Find(UserID); if (mSTR_User == null) { this.UserId = 0; return; } this.UserId = mSTR_User.UserId; this.UserName = mSTR_User.UserName; this.PhotoUrl = mSTR_User.PhotoUrl; this.FirstName = mSTR_User.FirstName; this.MiddleName = mSTR_User.MiddleName; this.LastName = mSTR_User.LastName; this.Remarks = mSTR_User.Remarks; this.MobileNo = mSTR_User.MobileNo; this.HomeNo = mSTR_User.HomeNo; this.EmailId = mSTR_User.EmailId; this.CountryId = mSTR_User.CountryId; this.RPASPermitNo = mSTR_User.RPASPermitNo; this.PermitCategory = mSTR_User.PermitCategory; this.ContactAddress = mSTR_User.ContactAddress; this.RegRPASSerialNo = mSTR_User.RegRPASSerialNo; this.EmiratesID = mSTR_User.EmiratesID; this.DOI_RPASPermit = mSTR_User.DOI_RPASPermit; this.DOE_RPASPermit = mSTR_User.DOE_RPASPermit; this.UserDescription = mSTR_User.UserDescription; this.Nationality = mSTR_User.Nationality; this.AccountID = mSTR_User.AccountId.Value; MSTR_User_Pilot mSTR_User_Pilot = db.MSTR_User_Pilot.Find(UserId); if (mSTR_User_Pilot != null) { this.Department = mSTR_User_Pilot.Department; this.PassportNo = mSTR_User_Pilot.PassportNo; this.DateOfExpiry = mSTR_User_Pilot.DateOfExpiry; this.EmiratesID = mSTR_User_Pilot.EmiratesId; } this.LinkedDroneID = db.M2M_Drone_User .Where(w => w.UserID == UserId) .Select(s => s.DroneID) .ToList(); }
public ActionResult UserActivation([Bind(Prefix = "ID")] string key) { MSTR_User newUser = ctx.MSTR_User.FirstOrDefault(x => x.ActivationKey == key && x.IsActive == false); if (newUser != null) { ViewBag.Username = newUser.UserName; } else { ViewBag.Message = "Activation link expired."; } return View(newUser); }
// GET: RpasUser/Create public ActionResult Create([Bind(Prefix = "ID")] int RPASID = 0) { if (!exLogic.User.hasAccess("RPASUSER.CREATE")) { return(RedirectToAction("NoAccess", "Home")); } MSTR_User EPASValues = new MSTR_User(); if (RPASID != 0) { ViewBag.RPASid = RPASID; //ViewBag.IsPassowrdRequired = false; var RPASoList = (from p in db.MSTR_RPAS_User where p.RpasId == RPASID select p).ToList(); EPASValues.FirstName = RPASoList[0].Name; EPASValues.CountryId = Convert.ToInt16(RPASoList[0].NationalityId); EPASValues.EmiratesID = RPASoList[0].EmiratesId; EPASValues.EmailId = RPASoList[0].EmailId; EPASValues.MobileNo = RPASoList[0].MobileNo; //EPASValues.UserProfileId = Convert.ToInt16(7); //EPASValues.Dashboard = "RPAS"; //EPASValues.IsActive = false; //EPASValues.IsPilot = false; } var viewModel = new ViewModel.UserViewModel { User = EPASValues, Pilot = new MSTR_User_Pilot(), ProfileList = Util.GetProfileList(), CountryList = Util.GetCountryLists("Country", "CountryName", "Code", "sp"), AccountList = Util.GetAccountList(), DashboardList = Util.GetDashboardLists(), PermitCategoryList = Util.GetLists("RPASCategory") }; return(View(viewModel)); }