public ActionResult GuestRegister() { WslxEntity curWSLXModel = new WslHelper().validateWSL(); Session["w_user"] = curWSLXModel.WWSLX; ViewBag.homeid = "home"; GuestRegistrationModel guest = new GuestRegistrationModel(); GuestBL bl = new GuestBL(); guest = bl.GetGuestRegistrationBy(Session["w_user"].ToString()); if (guest == null) { GuestRegistrationModel _guest = new GuestRegistrationModel(); _guest.WSLX_ID = Session["w_user"].ToString(); if (_guest.PHONE != null) { _guest.phone1 = _guest.PHONE.Substring(0, 3); _guest.phone2 = _guest.PHONE.Substring(3, 3); _guest.phone3 = _guest.PHONE.Substring(6, 4); } return(View(_guest)); } if (guest.PHONE != null) { guest.phone1 = guest.PHONE.Substring(0, 3); guest.phone2 = guest.PHONE.Substring(3, 3); guest.phone3 = guest.PHONE.Substring(6, 4); } return(View(guest)); }
public ActionResult GuestConfirm() { WslxEntity curWSLXModel = new WslHelper().validateWSL(); Session["w_user"] = curWSLXModel.WWSLX; ViewBag.homeid = "home"; return(View()); }
// // GET: /Guest/ public ActionResult Index() { WslxEntity curWSLXModel = new WslHelper().validateWSL(); Session["w_user"] = curWSLXModel.WWSLX; ViewBag.homeid = "home"; EventModel evModel = new EventModel(); return(View(evModel)); }
public void OnAuthorization(AuthorizationContext filterContext) { try { if (filterContext.HttpContext.Request.Url.LocalPath.ToLower().EndsWith("/httperrors/noauthorized")) { return; } WslxEntity curWSLXModel = new WslHelper().validateWSL(); if (curWSLXModel.WResult) { string w_ma = "N"; string w_ford = "N"; string w_special_user = "******"; if (curWSLXModel.WOrg.ToUpper() == "FE46" || curWSLXModel.WOrg.ToUpper() == "99999" || curWSLXModel.WOrg.ToUpper() == "FE46F" || curWSLXModel.WWSLX.ToUpper() == "DBROTHE7") { w_ma = "Y"; } if (curWSLXModel.WOrg.ToUpper() == "MKS" || curWSLXModel.WOrg.ToUpper() == "FOE" || curWSLXModel.WRole.ToUpper() == "GENMGR" || curWSLXModel.WOrg.ToUpper() == "BMFXA" || curWSLXModel.WOrg.ToUpper() == "GHFUA") { w_ford = "Y"; } if (curWSLXModel.WWSLX.ToUpper() == "DBROTHE7" || curWSLXModel.WWSLX.ToUpper() == "J-TELEHA" || curWSLXModel.WWSLX.ToUpper() == "S-DOUG22") { w_special_user = "******"; } HttpContext.Current.Session["WSLXID"] = curWSLXModel.WWSLX; HttpContext.Current.Session["PA_CODE"] = curWSLXModel.WOrg; HttpContext.Current.Session["UserName"] = curWSLXModel.WRole; HttpContext.Current.Session["UserType"] = curWSLXModel.WUserType == null ? string.Empty : curWSLXModel.WUserType; HttpContext.Current.Session["Title"] = string.Empty; HttpContext.Current.Session["Email"] = string.Empty; HttpContext.Current.Session["SuperDealerCode"] = string.Empty; if (curWSLXModel.WRole.ToLower().Equals("dealer")) { UsuarioBL _usuarioBl = new UsuarioBL(); UserModel model = _usuarioBl.GetUserBy(curWSLXModel.WWSLX); if (model != null) { ProfileBL _profile = new ProfileBL(); if (_profile.GetStarsIdBy(model.USR_WSLX_ID)) { HttpContext.Current.Session["starsId"] = string.Empty; } } else { filterContext.Result = new RedirectResult("~/HttpErrors/NoAuthorized", false); } } } else { filterContext.Result = new RedirectResult("~/HttpErrors/NoAuthorized", false); } } catch (Exception ex) { filterContext.Result = new RedirectResult("~/HttpErrors/NoAuthorized", false); } }
public void OnAuthorization(AuthorizationContext filterContext) { try { bool isAlreadyLogedIn = HttpContext.Current.Session["w_user"] != null; //HttpContext.Current.Session["showVideo"] = false; //Validate the WSL Cookie WslxEntity curWSLXModel = new WslHelper().validateWSL(); HttpContext.Current.Session["userId"] = curWSLXModel.WWSLX; UsuarioBL _usuarioBl = new UsuarioBL(); UserModel model = _usuarioBl.GetUserBy(curWSLXModel.WWSLX); if (curWSLXModel.WResult) { if (HttpContext.Current.Session["ROLE_ID"] == null) { ReviewUserData(model); } if (!isAlreadyLogedIn) { LoginTrackingModel LOGIN_TRACKING = new LoginTrackingModel { CREATE_DATE = DateTime.Now, CREATED_BY = curWSLXModel.WWSLX, LOGIN_DATE = DateTime.Now, LOGIN_TIME = DateTime.Now.Hour, USERID = curWSLXModel.WWSLX, ACI = curWSLXModel.WUserType, SITE = (HttpContext.Current.Session["w_sitecode"] != null) ? HttpContext.Current.Session["w_sitecode"].ToString().ToUpper().Trim() : "", ORGCODE = (HttpContext.Current.Session["w_location"] != null) ? HttpContext.Current.Session["w_location"].ToString().ToUpper().Trim() : "", EMPCODE = (HttpContext.Current.Session["w_role"] != null) ? HttpContext.Current.Session["w_role"].ToString().ToUpper().Trim() : "", MRROLE = (HttpContext.Current.Session["w_username"] != null) ? HttpContext.Current.Session["w_username"].ToString().ToUpper().Trim() : "", ORG = (HttpContext.Current.Session["w_pacode"] != null) ? HttpContext.Current.Session["w_pacode"].ToString().ToUpper().Trim() : "" }; LoginTrackingBL.AddLOGIN_TRACKING(LOGIN_TRACKING); //HttpContext.Current.Session["showVideo"] = true; } HttpContext.Current.Session["w_user"] = curWSLXModel.WWSLX; HttpContext.Current.Session["w_pacode"] = curWSLXModel.WOrg; //this will need to change accordingly based on the client request. HttpContext.Current.Session["User_Id"] = curWSLXModel.WWSLX; if (curWSLXModel.WUserType.ToString().ToUpper().Trim() == "DEALER") { ProfileBL _profile = new ProfileBL(); ProfileModel profileModel = new ProfileModel(); profileModel = _profile.GetProfileBy(curWSLXModel.WWSLX); HttpContext.Current.Session["ShowPopUpS"] = null; if (model.USR_WSLX_ID != null) { HttpContext.Current.Session["ROLE_ID"] = Convert.ToString(LBC_Role.LBCDealers); model.USR_ROLE_ID = Convert.ToDecimal(LBC_Role.LBCDealers); HttpContext.Current.Session["UserName"] = curWSLXModel.WRole; if (!profileModel.haveProfileWslxId) { HttpContext.Current.Session["ShowPopUpS"] = true; } else { HttpContext.Current.Session["StarsIdProfile"] = profileModel.STARS_ID; } HttpContext.Current.Session["User_Id"] = profileModel.FIRST_NAME != null ? (profileModel.FIRST_NAME + " " + profileModel.LAST_NAME) : curWSLXModel.WWSLX; } else if (profileModel.WSLX_ID == null) { HttpContext.Current.Session["ShowPopUpS"] = true; HttpContext.Current.Session["ROLE_ID"] = Convert.ToString(LBC_Role.LBCDealers); model.USR_ROLE_ID = LBC_Role.LBCDealers; // filterContext.Result = new RedirectResult("~/LBC/Welcome", true); } else { HttpContext.Current.Session["StarsIdProfile"] = profileModel.STARS_ID; HttpContext.Current.Session["User_Id"] = profileModel.FIRST_NAME != null ? (profileModel.FIRST_NAME + " " + profileModel.LAST_NAME) : curWSLXModel.WWSLX; HttpContext.Current.Session["ROLE_ID"] = Convert.ToString(LBC_Role.LBCDealers); model.USR_ROLE_ID = LBC_Role.LBCDealers; } } else if ((curWSLXModel.WOrg.ToString().ToUpper().Trim() == "MKS" || curWSLXModel.WOrg.ToString().ToUpper().Trim() == "FNAMR") && model.USR_WSLX_ID == null) { HttpContext.Current.Session["ROLE_ID"] = Convert.ToString(LBC_Role.MKS); model.USR_ROLE_ID = Convert.ToDecimal(LBC_Role.MKS); HttpContext.Current.Session["User_Id"] = curWSLXModel.WWSLX; // this is a Lincoln Empoyee Role } else { if (model != null && model.USR_WSLX_ID != null) { HttpContext.Current.Session["ROLE_ID"] = model.USR_ROLE_ID; // HttpContext.Current.Session["User_Id"] = model.USR_WSLX_ID; HttpContext.Current.Session["User_Id"] = model.USR_FIRST_NAME + " " + model.USR_LAST_NAME; } // This Case we will check from the database Admin table // var model = new LoginModel(); //model.Permission = new CommonRepository().GetPermission(wslId); //if (model.Permission != null) //{ // return; //} //else //{ // errorcode = wslId + " is not Registered"; // HttpContext.Current.Session["errorcode"] = errorcode; // filterContext.Result = new RedirectResult("~/Home/Error?id=" + wslId); //} } } else { HttpContext.Current.Session["ViewType"] = "ViewNoAccess"; filterContext.Result = new RedirectResult("~/HttpErrors/NoAuthorized", false); } if (access_levels != null) { bool permitAccess = false; foreach (int access_level in access_levels) { if (model.USR_ROLE_ID == access_level) { permitAccess = true; break; } } if (!permitAccess) { filterContext.Result = new RedirectResult("~/HttpErrors/NoAuthorized", false); } } } catch (Exception ex) { errorcode = ex.Message; HttpContext.Current.Session["User_Id"] = ""; HttpContext.Current.Session["UserName"] = ""; HttpContext.Current.Session["errorcode"] = errorcode + " " + ex.Message; filterContext.Result = new RedirectResult("~/HttpErrors/Http404", false); throw ex; } }