protected void btnDematTnCAccepted_Click(object sender, EventArgs e)
        {
            UserBo userBo           = new UserBo();
            string strOnlineAdviser = ConfigurationSettings.AppSettings["ONLINE_ADVISER"].ToString();

            if (Page.Request.Headers["x-Account-ID"] != null && Page.Request.Headers["x-Account-ID"] != "")
            {
                userAccountId = Page.Request.Headers["x-Account-ID"].ToString();
            }
            else if (Request.QueryString["x-Account-ID"] != null && Request.QueryString["x-Account-ID"] != "")
            {
                userAccountId = Request.QueryString["x-Account-ID"].ToString();
            }
            if (Request.QueryString["WERP"] != null)
            {
                isWerp = Request.QueryString["WERP"];
            }
            if (string.IsNullOrEmpty(isWerp))
            {
                userVo = userBo.GetUserAccountDetails(userAccountId, Convert.ToInt32(strOnlineAdviser));
            }
            else
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
                userVo    = userBo.GetUserAccountDetails(userAccountId, advisorVo.advisorId);
            }
            customerVo = (CustomerVo)Session["CustomerVo"];

            CustomerBo customerBo = new CustomerBo();

            customerBo.UpdateDematAcceptance(customerVo.CustomerId);
            customerVo            = customerBo.GetCustomerInfo(userVo.UserId);
            Session["CustomerVo"] = customerVo;
            if (customerVo.IsDematAccepted && customerVo.IsDematInvestor)
            {
                Session["ExchangeMode"] = "Demat";
                ddlMode.SelectedValue   = "Demat";
            }
            else if (customerVo.IsDematAccepted && !customerVo.IsDematInvestor)
            {
                ddlMode.SelectedValue = "Online";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alertwq", "alert('We have taken your request for registration of your client code for BSE StAR MF segment. The same will be activated shortly.');", true);
            }
            else
            {
                ddlMode.SelectedValue = "Online";
            }
        }
        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);
        }
Exemple #3
0
        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);
                    }
                }
            }
        }
Exemple #4
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            UserBo userBo = new UserBo();

            AdvisorStaffBo adviserStaffBo = new AdvisorStaffBo();
            RMVo           rmVo           = new RMVo();
            CustomerVo     customerVo     = new CustomerVo();
            CustomerBo     customerBo     = new CustomerBo();


            if (userBo.ValidateUser(txtUserName.Text.ToString(), txtPassword.Text.ToString()))
            {
                userVo = userBo.GetUser(txtUserName.Text.ToString());
                if (userVo.UserType == "Advisor")
                {
                    rmVo = adviserStaffBo.GetAdvisorStaff(userVo.UserId);
                    if (rmVo.AdviserId == adviserId || isMainDomain == true)
                    {
                        lblLoginMessage.Visible  = true;
                        lblLoginMessage.Text     = "Logged In to " + appName.ToString() + " as " + userVo.FirstName + ' ' + userVo.MiddleName + ' ' + userVo.LastName;
                        lblLoginMessage.CssClass = "FieldName";
                        tblLoginBlock.Visible    = false;

                        Session["CurrentUserVo"] = userVo;
                        lnklogout.Visible        = true;
                        Response.Write("<script>window.open('" + refLink + "?UserId=" + Encryption.Encrypt(userVo.UserId.ToString()) + "','_blank');</script>");
                    }
                    else
                    {
                        lblLoginMessage.Visible  = true;
                        tblLoginBlock.Visible    = true;
                        lblLoginMessage.Text     = "Authentication Failed";
                        lblLoginMessage.CssClass = "FieldError";
                    }
                }
                else if (userVo.UserType == "Customer")
                {
                    customerVo = customerBo.GetCustomerInfo(userVo.UserId);
                    rmVo       = adviserStaffBo.GetAdvisorStaffDetails(customerVo.RmId);
                    if (rmVo.AdviserId == adviserId || isMainDomain == true)
                    {
                        lblLoginMessage.Visible  = true;
                        lblLoginMessage.Text     = "Logged In to " + appName.ToString() + " as " + userVo.FirstName + ' ' + userVo.MiddleName + ' ' + userVo.LastName;
                        lblLoginMessage.CssClass = "FieldName";
                        Session["CurrentUserVo"] = userVo;
                        tblLoginBlock.Visible    = false;
                        lnklogout.Visible        = true;
                        Response.Write("<script>window.open('" + refLink + "?UserId=" + Encryption.Encrypt(userVo.UserId.ToString()) + "','_blank');</script>");
                    }
                    else
                    {
                        lblLoginMessage.Visible  = true;
                        tblLoginBlock.Visible    = false;
                        lblLoginMessage.Text     = "Authentication Failed";
                        lblLoginMessage.CssClass = "FieldError";
                    }
                }
            }
            else
            {
                lblLoginMessage.Text     = "Invalid LoginId or Password";
                lblLoginMessage.Visible  = true;
                lblLoginMessage.CssClass = "FieldError";
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                userVo                = (UserVo)Session["userVo"];
                customerVo            = customerBo.GetCustomerInfo(userVo.UserId);
                Session["CustomerVo"] = customerVo;
                lblName.Text          = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
                lblPhone.Text         = customerVo.ResISDCode.ToString() + " - " + customerVo.ResSTDCode.ToString() + " - " + customerVo.ResPhoneNum.ToString();
                lblAddress.Text       = customerVo.Adr1Line1.ToString() + "<br />" + customerVo.Adr1Line1.ToString() + "<br />" + customerVo.Adr1Line2.ToString() + "<br />" + customerVo.Adr1Line3.ToString() + "<br />" + customerVo.Adr1PinCode.ToString() + "<br />" + customerVo.Adr1State.ToString() + "<br />" + customerVo.Adr1City.ToString() + "<br />" + customerVo.Adr1Country.ToString();
                customerFamilyList    = customerFamilyBo.GetCustomerFamily(customerVo.CustomerId);
                if (customerFamilyList != null)
                {
                    trFamilyMembers.Visible = true;
                    DataTable dtCustomerFamilyList = new DataTable();
                    dtCustomerFamilyList.Columns.Add("AssociationId");
                    dtCustomerFamilyList.Columns.Add("Name");
                    dtCustomerFamilyList.Columns.Add("Relationship");

                    DataRow drCustomerFamily;
                    for (int i = 0; i < customerFamilyList.Count; i++)
                    {
                        drCustomerFamily = dtCustomerFamilyList.NewRow();
                        CustomerFamilyVo customerFamilyVo = new CustomerFamilyVo();
                        customerFamilyVo    = customerFamilyList[i];
                        drCustomerFamily[0] = customerFamilyVo.AssociationId.ToString();
                        drCustomerFamily[1] = customerFamilyVo.AssociateCustomerName.ToString();
                        drCustomerFamily[2] = customerFamilyVo.Relationship;
                        dtCustomerFamilyList.Rows.Add(drCustomerFamily);
                    }
                    if (dtCustomerFamilyList.Rows.Count > 0)
                    {
                        gvFamilyMembers.DataSource = dtCustomerFamilyList;
                        gvFamilyMembers.DataBind();
                        gvFamilyMembers.Visible = true;
                        trFamilyMembers.Visible = true;
                    }
                    else
                    {
                        gvFamilyMembers.DataSource = null;
                        gvFamilyMembers.DataBind();
                        trFamilyMembers.Visible = false;
                    }
                }
                else
                {
                    gvFamilyMembers.DataSource = null;
                    gvFamilyMembers.DataBind();
                    trFamilyMembers.Visible = false;
                }
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerIndividualDashboard.ascx:Page_Load()");

                object[] objects = new object[2];

                objects[1] = customerVo;
                objects[2] = userVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }