Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //    customerVo = (CustomerVo)Session[SessionContents.CustomerVo];
            //    string First = customerVo.FirstName.ToString();
            //    string Middle = customerVo.MiddleName.ToString();
            //    string Last = customerVo.LastName.ToString();

            //    if (Middle != "")
            //    {
            //        lblNameValue.Text = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
            //    }
            //    else
            //    {
            //        lblNameValue.Text = customerVo.FirstName.ToString() + " " + customerVo.LastName.ToString();
            //    }

            //    lblEmailIdValue.Text = customerVo.Email.ToString();
            //}
            SessionBo.CheckSession();
            customerVo = (CustomerVo)Session[SessionContents.CustomerVo];
            if (customerVo != null)
            {
                Session[SessionContents.FPS_ProspectList_CustomerId] = customerVo.CustomerId;
            }
            if (!IsPostBack)
            {
                isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId);
                if (isGrpHead == true)
                {
                    //TreeView1.Nodes.AddAt(0, new TreeNode("Group Home"));
                    RadPanelBar1.Items.Insert(0, new Telerik.Web.UI.RadPanelItem("Group Home"));
                    Session["IsDashboard"] = "true";
                }
                else
                {
                    Session["IsDashboard"] = "CustDashboard";
                }

                string IsDashboard = string.Empty;

                if (Session["IsDashboard"] != null)
                {
                    IsDashboard = Session["IsDashboard"].ToString();
                }
                if (IsDashboard == "true")
                {
                    //TreeView1.CollapseAll();
                    RadPanelBar1.CollapseAllItems();
                    if (customerVo.RelationShip == "SELF")
                    {
                        //TreeView1.FindNode("Group Home").Selected = true;
                        RadPanelBar1.FindItemByText("Group Home").Selected = true;
                    }
                    else
                    {
                        //TreeView1.FindNode("Customer Dashboard").Selected = true;
                        RadPanelBar1.FindItemByValue("Customer Dashboard").Selected = true;
                    }
                    Session["IsDashboard"] = "false";
                }
                else if (IsDashboard == "CustDashboard")
                {
                    //TreeView1.CollapseAll();
                    //TreeView1.FindNode("Customer Dashboard").Selected = true;
                    RadPanelBar1.CollapseAllItems();
                    RadPanelBar1.FindItemByValue("Customer Dashboard").Selected = true;
                }
                else
                {
                    //TreeView1.CollapseAll();
                    //TreeView1.FindNode("Profile Dashboard").Expand();
                    RadPanelBar1.CollapseAllItems();
                    RadPanelBar1.FindItemByValue("Profile Dashboard").Expanded = true;
                    //TreeView1.FindNode("Profile Dashboard").Selected = true;
                    RadPanelBar1.FindItemByValue("Profile Dashboard").Selected = true;
                }
            }
            ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadtopmenu('CustomerIndividualLeftPane');", true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            string First  = null;
            string Middle = null;
            string Last   = null;

            userVo = (UserVo)Session["userVo"];
            bool isGrpHead = false;

            try
            {
                customerVo = (CustomerVo)Session[SessionContents.CustomerVo];
                if (customerVo != null)
                {
                    Session[SessionContents.FPS_ProspectList_CustomerId] = customerVo.CustomerId;
                }
                if (!IsPostBack)
                {
                    First  = customerVo.FirstName.ToString();
                    Middle = customerVo.MiddleName.ToString();
                    Last   = customerVo.LastName.ToString();
                    if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                    {
                        hdnUserRole.Value = "RM";
                    }
                    else if (Session[SessionContents.CurrentUserRole].ToString() == "BM")
                    {
                        hdnUserRole.Value = "BM";
                    }
                    else if (Session[SessionContents.CurrentUserRole].ToString() == "Adviser")
                    {
                        hdnUserRole.Value = "Adviser";
                    }
                    if (Middle != "")
                    {
                        lblNameValue.Text = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
                    }
                    else
                    {
                        lblNameValue.Text = customerVo.FirstName.ToString() + " " + customerVo.LastName.ToString();
                    }

                    lblEmailIdValue.Text = customerVo.Email.ToString();

                    isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId);
                    if (isGrpHead == true)
                    {
                        //TreeView1.Nodes.AddAt(1, new TreeNode("Group Dashboard"));
                        RadPanelBar1.Items.Insert(1, new Telerik.Web.UI.RadPanelItem("Group Dashboard"));
                        RadPanelBar1.Items.FindItemByText("Group Dashboard").Value = "Group Dashboard";
                    }

                    string IsDashboard = string.Empty;

                    if (Session["IsDashboard"] != null)
                    {
                        IsDashboard = Session["IsDashboard"].ToString();
                    }
                    if (IsDashboard == "true")
                    {
                        //TreeView1.CollapseAll();
                        RadPanelBar1.CollapseAllItems();
                        if (isGrpHead == true)
                        {
                            //TreeView1.FindNode("Group Dashboard").Selected = true;
                            RadPanelBar1.FindItemByText("Group Dashboard").Selected = true;
                        }
                        else
                        {
                            //TreeView1.FindNode("Customer Dashboard").Selected = true;
                            RadPanelBar1.FindItemByValue("Customer Dashboard").Selected = true;
                        }

                        Session["IsDashboard"] = "false";
                    }
                    else if (IsDashboard == "CustDashboard")
                    {
                        //TreeView1.CollapseAll();
                        //TreeView1.FindNode("Customer Dashboard").Selected = true;
                        RadPanelBar1.FindItemByValue("Customer Dashboard").Selected = true;
                        Session["IsDashboard"] = "false";
                    }
                    else if (Session[SessionContents.FPS_TreeView_Status] != null)
                    {
                        if (Session[SessionContents.FPS_TreeView_Status].ToString() == "FinanceProfile")
                        {
                            //TreeView1.CollapseAll();
                            //TreeView1.FindNode("Financial Planning").Expand();
                            RadPanelBar1.FindItemByValue("Financial Planning").Expanded = true;
                            //TreeView1.FindNode("FinanceProfile").Selected = true;
                            //TreeNode tn = new TreeNode("Finance Profile", "FinanceProfile");
                            RadPanelBar1.FindItemByValue("FinanceProfile").Selected = true;
                            //TreeView1.SelectedNode.Text = "Finance Profile";
                        }
                    }
                    else
                    {
                        //TreeView1.CollapseAll();
                        //    TreeView1.FindNode("Profile Dashboard").Expand();
                        //    TreeView1.FindNode("Profile Dashboard").Selected = true;
                    }
                }
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "topMenu", "loadtopmenu('CustomerIndividualLeftPane');", true);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

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

                object[] objects = new object[4];

                objects[0] = customerVo;
                objects[1] = First;
                objects[2] = Middle;
                objects[3] = Last;

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