protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); int branchId; userVo = (UserVo)Session[SessionContents.UserVo]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); rmId = rmVo.RMId; Session[SessionContents.RmVo] = rmVo; branchId = advisorBranchBo.GetBranchId(rmVo.RMId); advisorBranchVo = advisorBranchBo.GetBranch(branchId); Session["advisorBranchVo"] = advisorBranchVo; if (!IsPostBack) { BindBranchDropDown(); bindGrid(0, int.Parse(ddlBMBranch.SelectedValue.ToString()), 1); bindChart(0, int.Parse(ddlBMBranch.SelectedValue.ToString()), 1); } // Show unread messages ShowUnreadMessageAlert(); }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); UserVo userVo = new UserVo(); RMVo rmVo = new RMVo(); //userType = Session["UserType"].ToString().ToLower(); int branchId; userVo = (UserVo)Session["userVo"]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); rmId = rmVo.RMId; Session["rmVo"] = rmVo; branchId = advisorBranchBo.GetBranchId(rmVo.RMId); advisorBranchVo = advisorBranchBo.GetBranch(branchId); Session["advisorBranchVo"] = advisorBranchVo; if (!IsPostBack) { BindBranchDropDown(); bindGrid(0, int.Parse(ddlBMBranch.SelectedValue.ToString()), 1); bindChart(0, int.Parse(ddlBMBranch.SelectedValue.ToString()), 1); } }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); userVo = (UserVo)Session["userVo"]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); Session["rmVo"] = rmVo; branchId = advisorBranchBo.GetBranchId(rmVo.RMId); adviserVo = (AdvisorVo)Session["advisorVo"]; if (branchId != 0 || adviserVo.MultiBranch == 0) { lnkAdd.Visible = false; lbl.Visible = false; Session["advisorBranchVo"] = advisorBranchBo.GetBranch(branchId); } else { lnkAdd.Visible = true; lbl.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); userVo = (UserVo)Session["UserVo"]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); Session["rmVo"] = rmVo; bmBranchId = advisorBranchBo.GetBranchId(rmVo.RMId); if (bmBranchId == 0) { } else { advisorBranchVo = advisorBranchBo.GetBranch(bmBranchId); Session["advisorBranchVo"] = advisorBranchVo; } if (!IsPostBack) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadtopmenu('AdvisorRMBMLeftpane');", true); } }
protected void Page_Load(object sender, EventArgs e) { RMVo rmVo = new RMVo(); AdvisorBranchBo advisorBranchBo = new AdvisorBranchBo(); GeneralConfigurationVo generalconfigurationvo = new GeneralConfigurationVo(); try { lblDate.Text = DateTime.Now.ToLongDateString(); imgLeftPlaceHolder.Style.Add("display", "none"); imgCenterPlaceholder.Style.Add("display", "none"); imgRightPlaceholder.Style.Add("display", "none"); if (Session[SessionContents.SAC_HostGeneralDetails] != null) { generalconfigurationvo = (GeneralConfigurationVo)Session[SessionContents.SAC_HostGeneralDetails]; if (!IsPostBack) { if (!string.IsNullOrEmpty(generalconfigurationvo.HostLogoPlacement)) { if (generalconfigurationvo.HostLogoPlacement == "TopLeftCorner") { imgLeftPlaceHolder.Style.Add("display", "block"); imgLeftPlaceHolder.Src = "Images/" + generalconfigurationvo.HostLogo; } else if (generalconfigurationvo.HostLogoPlacement == "TopRightCorner") { imgRightPlaceholder.Style.Add("display", "block"); imgRightPlaceholder.Src = "Images/" + generalconfigurationvo.HostLogo; } else if (generalconfigurationvo.HostLogoPlacement == "TopCenter") { imgCenterPlaceholder.Style.Add("display", "block"); imgCenterPlaceholder.Src = "Images/" + generalconfigurationvo.HostLogo; } } } if (Session["userVo"] != null) { userVo = (UserVo)(Session["userVo"]); rmVo = (RMVo)(Session[SessionContents.RmVo]); lblUserName.Text = "Welcome " + " " + userVo.FirstName + " " + userVo.LastName; lblSignOut.Text = "SignOut"; LinkButtonSignIn.Text = ""; if (Session[SessionContents.LogoPath] != null) { logoPath = (Session[SessionContents.LogoPath].ToString()); } else { if (Session["advisorVo"] != null) { logoPath = "Images/" + ((AdvisorVo)Session["advisorVo"]).LogoPath; } } if (Session[SessionContents.BranchLogoPath] != null) { branchLogoPath = (Session[SessionContents.BranchLogoPath].ToString()); } else { if (rmVo != null) { branchLogoPath = "Images/" + (advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId))).LogoPath; } } if (!IsPostBack) { if (!string.IsNullOrEmpty(generalconfigurationvo.AdviserLogoPlacement)) { if (logoPath != "Images/" && logoPath != "") { if (generalconfigurationvo.AdviserLogoPlacement == "TopLeftCorner") { imgLeftPlaceHolder.Style.Add("display", "block"); imgLeftPlaceHolder.Src = logoPath; } else if (generalconfigurationvo.AdviserLogoPlacement == "TopRightCorner") { imgRightPlaceholder.Style.Add("display", "block"); imgRightPlaceholder.Src = logoPath; } else if (generalconfigurationvo.AdviserLogoPlacement == "TopCenter") { imgCenterPlaceholder.Style.Add("display", "block"); imgCenterPlaceholder.Src = logoPath; } } } if (imgLeftPlaceHolder.Src != "" && imgRightPlaceholder.Src != "") { if (branchLogoPath != "Images/" && branchLogoPath != "") { imgCenterPlaceholder.Style.Add("display", "block"); imgCenterPlaceholder.Src = branchLogoPath; } } else if (imgCenterPlaceholder.Src != "" && imgRightPlaceholder.Src != "") { if (branchLogoPath != "Images/" && branchLogoPath != "") { imgLeftPlaceHolder.Style.Add("display", "block"); imgLeftPlaceHolder.Src = branchLogoPath; } } else if (imgLeftPlaceHolder.Src != "" && imgCenterPlaceholder.Src != "") { if (branchLogoPath != "Images/" && branchLogoPath != "") { imgRightPlaceholder.Style.Add("display", "block"); imgRightPlaceholder.Src = branchLogoPath; } } } //if (logoPath != "Images/") //{ // AdvisorLogo.Src = logoPath; //} //if (branchLogoPath != "Images/") //{ // BranchLogo.Src = branchLogoPath; //} CustomerVo customerVo = new CustomerVo(); customerVo = (CustomerVo)(Session["CustomerVo"]); } else { if (!IsPostBack) { if (Request.QueryString["UserId"] != null) { string userId = Request.QueryString["UserId"].ToString(); Page.ClientScript.RegisterStartupScript(this.GetType(), "pageloadscript", "loginloadcontrolfromDefault('Userlogin','" + userId + "','');", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "pageloadscript", "loginloadcontrolfromDefault('Userlogin','','');", true); } } } } //if (AdvisorLogo.Src == "") //{ // AdvisorLogo.Style.Add("display", "none"); //} //if (BranchLogo.Src == "") //{ // BranchLogo.Style.Add("display", "none"); //} } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "Default.aspx:PageLoad()"); object[] objects = new object[1]; objects[0] = userVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
private bool ValidateUserLogin(string userAccountId, string isWerp) { string strOnlineAdviser = "0"; bool isValidUser = false; UserBo userBo = new UserBo(); AssociatesVO associatesVo = new AssociatesVO(); AdvisorBranchVo advisorBranchVo = new AdvisorBranchVo(); AssociatesUserHeirarchyVo associatesUserHeirarchyVo = new AssociatesUserHeirarchyVo(); AdvisorBo advisorBo = new AdvisorBo(); BoDematAccount boDematAccount = new BoDematAccount(); AssociatesBo associatesBo = new AssociatesBo(); AdvisorStaffBo advisorStaffBo = new AdvisorStaffBo(); CustomerBo customerBo = new CustomerBo(); AdvisorBranchBo advisorBranchBo = new AdvisorBranchBo(); PortfolioBo portfolioBo = new PortfolioBo(); CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo(); strOnlineAdviser = ConfigurationSettings.AppSettings["ONLINE_ADVISER"].ToString(); if (string.IsNullOrEmpty(isWerp)) { userVo = userBo.GetUserAccountDetails(userAccountId, Convert.ToInt32(strOnlineAdviser)); } else { advisorVo = (AdvisorVo)Session["advisorVo"]; userVo = userBo.GetUserAccountDetails(userAccountId, advisorVo.advisorId); } if (!string.IsNullOrEmpty(isWerp)) { if (userVo != null) { customerVo = customerBo.GetCustomerInfo(userVo.UserId); isValidUser = true; } Session["CustomerVo"] = customerVo; } else if (userVo != null) { isValidUser = true; List <string> roleList = new List <string>(); string branchLogoSourcePath; string sourcePath; string potentialHomePage = string.Empty; roleList = userBo.GetUserRoles(userVo.UserId); if (userVo.UserType == "Customer") { customerVo = customerBo.GetCustomerInfo(userVo.UserId); advisorVo = advisorBo.GetAdvisor(advisorBranchBo.GetBranch(customerVo.BranchId).AdviserId); if (customerVo.IsProspect == 0) { customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId); Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId; } rmVo = advisorStaffBo.GetAdvisorStaffDetails(customerVo.RmId); Session[SessionContents.LogoPath] = advisorVo.LogoPath; Session[SessionContents.CurrentUserRole] = "Customer"; Session[SessionContents.UserTopRole] = "Customer"; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); sourcePath = "Images/" + userBo.GetRMLogo(rmVo.RMId); Session[SessionContents.LogoPath] = sourcePath; Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Session["CustomerVo"] = customerVo; Session["DematAccountVo"] = boDematAccount.GetCustomerActiveDematAccount(customerVo.CustomerId); UserBo.AddLoginTrack(userVo.LoginId, string.Empty, true, HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"], HttpContext.Current.Request.UserAgent, userVo.UserId); } Session["UserVo"] = userVo; Session["advisorVo"] = advisorVo; Session["rmVo"] = rmVo; SetAdviserPreference(); //Session["Theme"] = advisorVo.theme; //Session["refreshTheme"] = true; Session[SessionContents.LogoPath] = advisorVo.LogoPath; } return(isValidUser); }
private void LoadBranches(List <int> branchList) { AdvisorBranchVo advisorBranchVo; DataTable dtAdvisorBranch = new DataTable(); DataRow drAdvisorBranch; try { if (branchList != null) { dtAdvisorBranch.Columns.Add("Sl.No."); dtAdvisorBranch.Columns.Add("BranchId"); dtAdvisorBranch.Columns.Add("BranchName"); dtAdvisorBranch.Columns.Add("BranchCode"); dtAdvisorBranch.Columns.Add("Email"); dtAdvisorBranch.Columns.Add("Phone"); dtAdvisorBranch.Columns.Add("BranchHead"); dtAdvisorBranch.Columns.Add("BranchType"); for (int i = 0; i < branchList.Count; i++) { drAdvisorBranch = dtAdvisorBranch.NewRow(); advisorBranchVo = new AdvisorBranchVo(); advisorBranchVo = advisorBranchBo.GetBranch(branchList[i]); drAdvisorBranch[0] = (i + 1).ToString(); drAdvisorBranch[1] = advisorBranchVo.BranchId.ToString(); drAdvisorBranch[2] = advisorBranchVo.BranchName.ToString(); drAdvisorBranch[3] = advisorBranchVo.BranchCode.ToString(); drAdvisorBranch[4] = advisorBranchVo.Email.ToString(); drAdvisorBranch[5] = advisorBranchVo.Phone1Isd.ToString() + "-" + advisorBranchVo.Phone1Std.ToString() + "-" + advisorBranchVo.Phone1Number.ToString(); drAdvisorBranch[6] = advisorBranchVo.BranchHead.ToString(); drAdvisorBranch[7] = advisorBranchVo.BranchType.ToString(); dtAdvisorBranch.Rows.Add(drAdvisorBranch); } gvBranchList.DataSource = dtAdvisorBranch; gvBranchList.DataBind(); gvBranchList.Visible = true; lblCurrentPage.Visible = true; this.GetPageCount(); } else { gvBranchList.DataSource = null; gvBranchList.DataBind(); lblMessage.Visible = true; tblPager.Visible = false; lblCurrentPage.Visible = false; lblTotalRows.Visible = false; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "ViewBranches.ascx.cs:LoadBranches()"); object[] objects = new object[1]; objects[0] = branchList; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void btnSignIn_Click(object sender, EventArgs e) { UserVo userVo = new UserVo(); UserBo userBo = new UserBo(); AdvisorStaffBo advisorStaffBo = new AdvisorStaffBo(); AdvisorBranchBo advisorBranchBo = new AdvisorBranchBo(); AdvisorBranchVo advisorBranchVo = new AdvisorBranchVo(); RMVo rmVo = new RMVo(); AdvisorBo advisorBo = new AdvisorBo(); AdvisorVo advisorVo = new AdvisorVo(); CustomerBo customerBo = new CustomerBo(); CustomerVo customerVo = new CustomerVo(); List <string> roleList = new List <string>(); string sourcePath = ""; string branchLogoSourcePath = ""; int count; bool isGrpHead = false; if (!CheckSuperAdmin()) { if (txtLoginId.Text == "" || txtPassword.Text == "") { lblIllegal.Visible = true; lblIllegal.Text = "Username and Password does not match"; } else { if (userBo.ValidateUser(txtLoginId.Text, txtPassword.Text)) // Validating the User Using the Username and Password { Session["id"] = ""; lblIllegal.Visible = true; userVo = userBo.GetUser(txtLoginId.Text); Session["UserVo"] = userVo; AddLoginTrack(txtLoginId.Text, txtPassword.Text, true, userVo.UserId); if (userVo.theme != null) { Session["Theme"] = userVo.theme.ToString(); Session["refreshTheme"] = true; } else { Session["Theme"] = "Purple"; Session["refreshTheme"] = true; } if (userVo.IsTempPassword == 0) { string UserName = userVo.FirstName + " " + userVo.LastName; if (userVo.UserType == "Advisor") { Session[SessionContents.CurrentUserRole] = "Admin"; Session["advisorVo"] = advisorBo.GetAdvisorUser(userVo.UserId); Session["rmVo"] = advisorStaffBo.GetAdvisorStaff(userVo.UserId); advisorVo = (AdvisorVo)Session["advisorVo"]; rmVo = (RMVo)Session["rmVo"]; Session["adviserId"] = advisorBo.GetRMAdviserId(rmVo.RMId); if (advisorVo.LogoPath == null || advisorVo.LogoPath == "") { advisorVo.LogoPath = "spacer.png"; } else { sourcePath = "Images/" + advisorVo.LogoPath.ToString(); if (!System.IO.File.Exists(Server.MapPath(sourcePath))) { sourcePath = ""; } } Session[SessionContents.LogoPath] = sourcePath; roleList = userBo.GetUserRoles(userVo.UserId); count = roleList.Count; if (count == 3) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorRMBMDashBoard','login','" + UserName + "','" + sourcePath + "');", true); //login user role Type Session["S_CurrentUserRole"] = "Admin"; } if (count == 2) { if (roleList.Contains("RM") && roleList.Contains("BM")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; //login user role Type Session["S_CurrentUserRole"] = "RM"; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('BMRMDashBoard','login','" + UserName + "','" + sourcePath + "','" + branchLogoSourcePath + "');", true); } else if (roleList.Contains("RM") && roleList.Contains("Admin")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; //login user role Type Session["S_CurrentUserRole"] = "Admin"; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorRMDashBoard','login','" + UserName + "','" + sourcePath + "');", true); } else if (roleList.Contains("BM") && roleList.Contains("Admin")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; //login user role Type Session["S_CurrentUserRole"] = "Admin"; } } if (count == 1) { if (roleList.Contains("RM")) { Session["adviserId"] = advisorBo.GetRMAdviserId(rmVo.RMId); //Session["advisorVo"]=advisorBo.GetAdvisor( branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); sourcePath = "Images/" + userBo.GetRMLogo(rmVo.RMId); Session[SessionContents.LogoPath] = sourcePath; Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; //login user role Type Issue Reported by Ajay on July 1 2010 Session["S_CurrentUserRole"] = "RM"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('RMDashBoard','login','" + UserName + "','" + sourcePath + "','" + branchLogoSourcePath + "');", true); } else if (roleList.Contains("BM")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; //login user role Type Issue Reported by Ajay on July 1 2010 Session["S_CurrentUserRole"] = "BM"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('BMDashBoard','login','" + UserName + "','" + sourcePath + "','" + branchLogoSourcePath + "');", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorDashBoard','login','" + UserName + "','" + sourcePath + "');", true); } } GetLatestValuationDate(); } else if (userVo.UserType == "Customer") { customerVo = customerBo.GetCustomerInfo(userVo.UserId); //Session["advisorVo"] = advisorBo.GetAdvisorUser(userVo.UserId); Session["CustomerVo"] = customerVo; customerVo = (CustomerVo)Session["CustomerVo"]; advisorVo = advisorBo.GetAdvisor(advisorBranchBo.GetBranch(customerVo.BranchId).AdviserId); rmVo = advisorStaffBo.GetAdvisorStaffDetails(customerVo.RmId); Session["rmVo"] = rmVo; Session["advisorVo"] = advisorVo; //if(customerVo!=null){ sourcePath = "Images/" + userBo.GetCustomerLogo(customerVo.CustomerId); Session[SessionContents.LogoPath] = sourcePath; Session["S_CurrentUserRole"] = "Customer"; GetLatestValuationDate(); Session["IsDashboard"] = "true"; isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId); if (isGrpHead == true) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorRMCustGroupDashboard','login','" + UserName + "','" + sourcePath + "');", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorRMCustIndiDashboard','login','" + UserName + "','" + sourcePath + "');", true); } } else if (userVo.UserType == "Admin") { Session["refreshTheme"] = false; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdminUpload','login','" + UserName + "','');", true); } } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ChangeTempPassword','none');", true); } } else { lblIllegal.Visible = true; lblIllegal.Text = "Username and Password does not match"; AddLoginTrack(txtLoginId.Text, txtPassword.Text, false, 0); } } } }
protected void Page_Load(object sender, EventArgs e) { //advisorVo = (AdvisorVo)Session["advisorVo"]; RMVo rmVo = new RMVo(); AdvisorBranchBo advisorBranchBo = new AdvisorBranchBo(); GeneralConfigurationVo generalconfigurationvo = new GeneralConfigurationVo(); string url = HttpContext.Current.Request.Url.AbsoluteUri; //tdTermsCondition.Visible = false; try { lblDate.Text = DateTime.Now.ToLongDateString(); //imgLeftPlaceHolder.Style.Add("display", "none"); imgCenterPlaceholder.Style.Add("display", "none"); imgRightPlaceholder.Style.Add("display", "none"); imgIFABanner.Style.Add("display", "none"); if (Session[SessionContents.SAC_HostGeneralDetails] != null) { generalconfigurationvo = (GeneralConfigurationVo)Session[SessionContents.SAC_HostGeneralDetails]; if (!IsPostBack) { if (!string.IsNullOrEmpty(generalconfigurationvo.HostLogoPlacement)) { if (generalconfigurationvo.HostLogoPlacement == "TopLeftCorner") { imgLeftPlaceHolder.Style.Add("display", "block"); } else if (generalconfigurationvo.HostLogoPlacement == "TopRightCorner") { imgRightPlaceholder.Style.Add("display", "block"); } else if (generalconfigurationvo.HostLogoPlacement == "TopCenter") { imgCenterPlaceholder.Style.Add("display", "block"); } if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["Website_Logo"].ToString())) { imgLeftPlaceHolder.Src = ConfigurationManager.AppSettings["Website_Logo"].ToString(); } } } if (Session["userVo"] != null) { userVo = (UserVo)(Session["userVo"]); rmVo = (RMVo)(Session[SessionContents.RmVo]); //tdTermsCondition.Visible = true; if (userVo.UserType == "Advisor") { //tdGodaddySeal.Visible = true; } else { //tdTermsCondition.Visible = false; } if ((!IsPostBack) && (userVo.UserType == "Customer")) { //tdTermsCondition.Visible = false; tdDemo.Visible = false; tdHelp.Visible = false; lnkDemo.Visible = false; lnkHelp.Visible = false; } lblUserName.Text = "Welcome " + " " + userVo.FirstName + " " + userVo.LastName; if (userVo.PermisionList != null && userVo.RoleList.Contains("Ops") && userVo.PermisionList.Count() > 0) { lblPermissionList.Visible = true; foreach (string PName in userVo.PermisionList) { lblPermissionList.Text += PName + ","; } lblPermissionList.Text = lblPermissionList.Text.TrimEnd(','); } lblSignOut.Text = "SignOut"; LinkButtonSignIn.Text = ""; imgSessionOut.Visible = false; if (Session[SessionContents.LogoPath] != null) { logoPath = (Session[SessionContents.LogoPath].ToString()); } else { if (Session["advisorVo"] != null) { logoPath = "Images/" + ((AdvisorVo)Session["advisorVo"]).LogoPath; } } if (Session[SessionContents.BranchLogoPath] != null) { branchLogoPath = (Session[SessionContents.BranchLogoPath].ToString()); } else { if (rmVo != null) { branchLogoPath = "Images/" + (advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId))).LogoPath; } } if (!IsPostBack) { if (!string.IsNullOrEmpty(generalconfigurationvo.AdviserLogoPlacement)) { if (logoPath != "Images/" && logoPath != "") { if (generalconfigurationvo.AdviserLogoPlacement == "TopLeftCorner") { imgLeftPlaceHolder.Style.Add("display", "block"); imgLeftPlaceHolder.Src = logoPath; } else if (generalconfigurationvo.AdviserLogoPlacement == "TopRightCorner") { imgRightPlaceholder.Style.Add("display", "block"); imgRightPlaceholder.Src = logoPath; } else if (generalconfigurationvo.AdviserLogoPlacement == "TopCenter") { imgCenterPlaceholder.Style.Add("display", "block"); imgCenterPlaceholder.Src = logoPath; } } } if (imgLeftPlaceHolder.Src != "" && imgRightPlaceholder.Src != "") { if (branchLogoPath != "Images/" && branchLogoPath != "") { imgCenterPlaceholder.Style.Add("display", "block"); imgCenterPlaceholder.Src = branchLogoPath; } } else if (imgCenterPlaceholder.Src != "" && imgRightPlaceholder.Src != "") { if (branchLogoPath != "Images/" && branchLogoPath != "") { imgLeftPlaceHolder.Style.Add("display", "block"); imgLeftPlaceHolder.Src = branchLogoPath; } } else if (imgLeftPlaceHolder.Src != "" && imgCenterPlaceholder.Src != "") { if (branchLogoPath != "Images/" && branchLogoPath != "") { imgRightPlaceholder.Style.Add("display", "block"); imgRightPlaceholder.Src = branchLogoPath; } } } if (advisorPreferenceVo.IsBannerEnabled) { imgPlaceholders.Visible = false; tblIFALongBanner.Visible = true; if (!string.IsNullOrEmpty(advisorPreferenceVo.BannerImageName)) { imgIFABanner.Style.Add("display", "block"); imgIFABanner.Src = "Images/" + advisorPreferenceVo.BannerImageName; } else { imgIFABanner.Style.Add("display", "none"); } } else { tblIFALongBanner.Visible = false; } //if (logoPath != "Images/") //{ // AdvisorLogo.Src = logoPath; //} //if (branchLogoPath != "Images/") //{ // BranchLogo.Src = branchLogoPath; //} CustomerVo customerVo = new CustomerVo(); customerVo = (CustomerVo)(Session["CustomerVo"]); } else { if (!IsPostBack) { if (Request.QueryString["UserId"] != null) { string userId = Request.QueryString["UserId"].ToString(); Page.ClientScript.RegisterStartupScript(this.GetType(), "pageloadscript", "loginloadcontrolfromDefault('Userlogin','" + userId + "','');", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "pageloadscript", "loginloadcontrolfromDefault('Userlogin','','');", true); } } } } //if (AdvisorLogo.Src == "") //{ // AdvisorLogo.Style.Add("display", "none"); //} //if (BranchLogo.Src == "") //{ // BranchLogo.Style.Add("display", "none"); //} if (userVo.UserType != "Advisor") { MenuItemCollection items = AdvisorMenu.Items; foreach (MenuItem item in items) { if (item.Value == @"Transact/Business online") { item.Text = ""; item.SeparatorImageUrl = null; } if (item.Value == @"Repository") { item.Text = ""; item.SeparatorImageUrl = null; } if (item.Value == @"Info links") { item.Text = ""; item.SeparatorImageUrl = null; } if (item.Value == @"Price List") { item.Text = ""; item.SeparatorImageUrl = null; } if (item.Value == @"Calculators") { item.Text = ""; item.SeparatorImageUrl = null; } } tdDemo.Visible = false; tdHelp.Visible = false; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "Default.aspx:PageLoad()"); object[] objects = new object[1]; objects[0] = userVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void Page_Load(object sender, EventArgs e) { UserVo userVo = new UserVo(); RMVo rmVo = new RMVo(); AdvisorBranchBo advisorBranchBo = new AdvisorBranchBo(); try { lblDate.Text = DateTime.Now.ToLongDateString(); AdvisorLogo.Style.Add("display", "block"); BranchLogo.Style.Add("display", "block"); if (Session["userVo"] != null) { userVo = (UserVo)(Session["userVo"]); rmVo = (RMVo)(Session[SessionContents.RmVo]); lblUserName.Text = "Welcome " + " " + userVo.FirstName + " " + userVo.LastName; lblSignOut.Text = "SignOut"; LinkButtonSignIn.Text = ""; if (Session[SessionContents.LogoPath] != null) { logoPath = (Session[SessionContents.LogoPath].ToString()); } else { if (Session["advisorVo"] != null) { logoPath = "Images/" + ((AdvisorVo)Session["advisorVo"]).LogoPath; } } if (Session[SessionContents.BranchLogoPath] != null) { branchLogoPath = (Session[SessionContents.BranchLogoPath].ToString()); } else { if (rmVo != null) { branchLogoPath = "Images/" + (advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId))).LogoPath; } } if (logoPath != "Images/") { AdvisorLogo.Src = logoPath; } if (branchLogoPath != "Images/") { BranchLogo.Src = branchLogoPath; } //if (Session["advisorVo"] != null) //{ // //GeneralMenu.Visible = false; // //AdvisorHeader.Visible = true; // GeneralMenu.Style.Add("display", "none"); // AdvisorHeader.Style.Add("display", "block"); // RMHeader.Style.Add("display", "none"); // CustomerIndividualHeader.Style.Add("display", "none"); // CustomerNonIndividualHeader.Style.Add("display", "none"); // RMCLientHeaderIndividual.Style.Add("display", "none"); // RMCLientHeaderNonIndividual.Style.Add("display", "none"); // BMHeader.Style.Add("display", "none"); //} //if (Session["CustomerVo"] != null && Session["rmVo"] == null) //{ // //GeneralMenu.Visible = false; // //AdvisorHeader.Visible = true; // GeneralMenu.Style.Add("display", "none"); // AdvisorHeader.Style.Add("display", "none"); // RMHeader.Style.Add("display", "none"); CustomerVo customerVo = new CustomerVo(); customerVo = (CustomerVo)(Session["CustomerVo"]); // if (customerVo.Type == "IND") // { // CustomerIndividualHeader.Style.Add("display", "block"); // CustomerNonIndividualHeader.Style.Add("display", "none"); // } // else if (customerVo.Type == "NIND") // { // CustomerIndividualHeader.Style.Add("display", "none"); // CustomerNonIndividualHeader.Style.Add("display", "block"); // } // RMCLientHeaderIndividual.Style.Add("display", "none"); // RMCLientHeaderNonIndividual.Style.Add("display", "none"); // BMHeader.Style.Add("display", "none"); //} //if (Session["rmVo"] != null) //{ // if (Session["CustomerVo"] != null) // { // if (userVo.UserType != "Customer") // { // GeneralMenu.Style.Add("display", "none"); // AdvisorHeader.Style.Add("display", "none"); // RMHeader.Style.Add("display", "none"); // CustomerIndividualHeader.Style.Add("display", "none"); // CustomerNonIndividualHeader.Style.Add("display", "none"); // BMHeader.Style.Add("display", "none"); // CustomerVo customerVo = new CustomerVo(); // customerVo = (CustomerVo)(Session["CustomerVo"]); // if (customerVo.Type == "IND") // { // RMCLientHeaderIndividual.Style.Add("display", "block"); // RMCLientHeaderNonIndividual.Style.Add("display", "none"); // } // else if (customerVo.Type == "NIND") // { // RMCLientHeaderIndividual.Style.Add("display", "none"); // RMCLientHeaderNonIndividual.Style.Add("display", "block"); // } // } // else // { // GeneralMenu.Style.Add("display", "none"); // AdvisorHeader.Style.Add("display", "none"); // RMHeader.Style.Add("display", "none"); // RMCLientHeaderIndividual.Style.Add("display", "none"); // RMCLientHeaderNonIndividual.Style.Add("display", "none"); // BMHeader.Style.Add("display", "none"); // CustomerVo customerVo = new CustomerVo(); // customerVo = (CustomerVo)(Session["CustomerVo"]); // if (customerVo.Type == "IND") // { // CustomerIndividualHeader.Style.Add("display", "block"); // CustomerNonIndividualHeader.Style.Add("display", "none"); // } // else if (customerVo.Type == "NIND") // { // CustomerIndividualHeader.Style.Add("display", "none"); // CustomerNonIndividualHeader.Style.Add("display", "block"); // } // } //} //else //{ // if (rmVo.RMRole == "RM") // { // GeneralMenu.Style.Add("display", "none"); // AdvisorHeader.Style.Add("display", "none"); // RMHeader.Style.Add("display", "block"); // CustomerIndividualHeader.Style.Add("display", "none"); // CustomerNonIndividualHeader.Style.Add("display", "none"); // RMCLientHeaderIndividual.Style.Add("display", "none"); // RMCLientHeaderNonIndividual.Style.Add("display", "none"); // BMHeader.Style.Add("display", "none"); // } // else if (rmVo.RMRole == "Branch Man") // { // GeneralMenu.Style.Add("display", "none"); // AdvisorHeader.Style.Add("display", "none"); // RMHeader.Style.Add("display", "none"); // CustomerIndividualHeader.Style.Add("display", "none"); // CustomerNonIndividualHeader.Style.Add("display", "none"); // RMCLientHeaderIndividual.Style.Add("display", "none"); // RMCLientHeaderNonIndividual.Style.Add("display", "none"); // BMHeader.Style.Add("display", "block"); // } //} //} } else { // If User Sessions are empty, load the login control //GeneralMenu.Style.Add("display", "block"); //AdvisorHeader.Style.Add("display", "none"); //RMHeader.Style.Add("display", "none"); //CustomerIndividualHeader.Style.Add("display", "none"); //CustomerNonIndividualHeader.Style.Add("display", "none"); //RMCLientHeaderIndividual.Style.Add("display", "none"); //RMCLientHeaderNonIndividual.Style.Add("display", "none"); //BMHeader.Style.Add("display", "none"); AdvisorLogo.Style.Add("display", "none"); BranchLogo.Style.Add("display", "none"); if (!IsPostBack) { if (Request.QueryString["UserId"] != null) { string userId = Request.QueryString["UserId"].ToString(); Page.ClientScript.RegisterStartupScript(this.GetType(), "pageloadscript", "loginloadcontrolfromDefault('Userlogin','" + userId + "','');", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "pageloadscript", "loginloadcontrolfromDefault('Userlogin','','');", true); } } } if (AdvisorLogo.Src == "") { AdvisorLogo.Style.Add("display", "none"); } if (BranchLogo.Src == "") { BranchLogo.Style.Add("display", "none"); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "Default.aspx:PageLoad()"); object[] objects = new object[1]; objects[0] = userVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void AdvisorDashboardValidation(int userId) { try { //Session["userVo"] = userBo.GetUserDetails(userId); //userVo.UserId = userId; Session["advisorVo"] = advisorBo.GetAdvisorUser(userId); Session["rmVo"] = advisorStaffBo.GetAdvisorStaff(userId); advisorVo = (AdvisorVo)Session["advisorVo"]; rmVo = (RMVo)Session["rmVo"]; Session["adviserId"] = advisorBo.GetRMAdviserId(rmVo.RMId); if (advisorVo != null) { if (advisorVo.LogoPath == null || advisorVo.LogoPath == "") { advisorVo.LogoPath = ""; } sourcePath = "Images/" + advisorVo.LogoPath.ToString(); Session[SessionContents.LogoPath] = sourcePath; } roleList = userBo.GetUserRoles(userVo.UserId); count = roleList.Count; string UserName = userVo.FirstName + " " + userVo.LastName; if (count == 3) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Session["refreshTheme"] = true; Session["SuperAdmin_Status_Check"] = "1"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorRMBMDashBoard','login','" + UserName + "','" + sourcePath + "');", true); //login user role Type Session["S_CurrentUserRole"] = "Admin"; } if (count == 2) { if (roleList.Contains("RM") && roleList.Contains("BM")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; //login user role Type Session["S_CurrentUserRole"] = "RM"; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Session["refreshTheme"] = true; Session["SuperAdmin_Status_Check"] = "1"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('BMRMDashBoard','login','" + UserName + "','" + sourcePath + "','" + branchLogoSourcePath + "');", true); } else if (roleList.Contains("RM") && roleList.Contains("Admin")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; //login user role Type Session["S_CurrentUserRole"] = "Admin"; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Session["refreshTheme"] = true; Session["SuperAdmin_Status_Check"] = "1"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorRMDashBoard','login','" + UserName + "','" + sourcePath + "');", true); } else if (roleList.Contains("BM") && roleList.Contains("Admin")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; //login user role Type Session["S_CurrentUserRole"] = "Admin"; } } //for (int i = 0; i < 2; i++) //{ // if (roleList[i] == "RM") // { // rmVo = (RMVo)Session["rmVo"]; // // } // if (roleList[i] == "BM") // { // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorBMDashBoard','login','" + UserName + "','" + sourcePath + "');", true); // } //} if (count == 1) { if (roleList.Contains("RM")) { Session["adviserId"] = advisorBo.GetRMAdviserId(rmVo.RMId); //Session["advisorVo"]=advisorBo.GetAdvisor( branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); sourcePath = "Images/" + userBo.GetRMLogo(rmVo.RMId); Session[SessionContents.LogoPath] = sourcePath; Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('RMDashBoard','login','" + UserName + "','" + sourcePath + "','" + branchLogoSourcePath + "');", true); } else if (roleList.Contains("BM")) { advisorBranchVo = advisorBranchBo.GetBranch(advisorBranchBo.GetBranchId(rmVo.RMId)); Session["advisorBranchVo"] = advisorBranchVo; branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId); Session[SessionContents.BranchLogoPath] = branchLogoSourcePath; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('BMDashBoard','login','" + UserName + "','" + sourcePath + "','" + branchLogoSourcePath + "');", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loginloadcontrol('AdvisorDashBoard','login','" + UserName + "','" + sourcePath + "');", true); } } GetLatestValuationDate(); } catch (Exception ex) { throw ex; } }