protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();

            if (!string.IsNullOrEmpty(Session["advisorVo"].ToString()))
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
            }
            if (Request.Form["ctrl_EquityReports$btnView"] != "View Report")
            {
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                rmVo = (RMVo)Session[SessionContents.RmVo];

                BindPeriodDropDown();
                txtCustomer_autoCompleteExtender.ContextKey       = advisorVo.advisorId.ToString();
                txtParentCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString();
                if (!IsPostBack)
                {
                    CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                    DataSet ds = customerTransactionBo.GetLastTradeDate();
                    if (ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["WTD_Date"] != null)
                    {
                        txtAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                    }
                }

                if (IsPostBack && !string.IsNullOrEmpty(Request.Form["ctrl_EquityReports$hidTabIndex"]))
                {
                    activeTabIndex = Convert.ToInt32(Request.Form["ctrl_EquityReports$hidTabIndex"]);
                }
            }
        }
Exemple #2
0
        private void BindLastTradeDate()
        {
            DataSet ds = customerTransactionBo.GetLastTradeDate();

            txtFrom.SelectedDate = DateTime.Parse(ds.Tables[0].Rows[0][0].ToString());
            txtTo.SelectedDate   = DateTime.Parse(ds.Tables[0].Rows[0][0].ToString());
        }
Exemple #3
0
        private void BindLastTradeDate()
        {
            DataSet ds = customerTransactionBo.GetLastTradeDate();

            txtFromDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][0].ToString()).ToShortDateString();
            txtToDate.Text   = DateTime.Parse(ds.Tables[0].Rows[0][0].ToString()).ToShortDateString();
        }
 private void BindLastTradeDate()
 {
     try
     {
         DataSet ds = customerTransactionBo.GetLastTradeDate();
         txtTransactionDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][0].ToString()).ToShortDateString();
     }
     catch (Exception ex)
     {
     }
     //txtToDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][0].ToString()).ToShortDateString();
 }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
                path      = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());


                if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "admin")
                {
                    userType = "advisor";
                }

                else
                {
                    userType = Session[SessionContents.CurrentUserRole].ToString().ToLower();
                }


                SessionBo.CheckSession();

                userVo = (UserVo)Session["userVo"];
                rmVo   = advisorStaffBo.GetAdvisorStaff(userVo.UserId);
                bmID   = rmVo.RMId;
                if (userType == "advisor")
                {
                    trBranchandRMDps.Visible = true;
                    if (!IsPostBack)
                    {
                        BindBranchDropDown();
                        BindRMDropDown();
                        trRange.Visible  = true;
                        trPeriod.Visible = false;
                    }
                    //dsGetLastTradeDate = customertransactionbo.GetLastTradeDate();
                    //DateTime dtLastTradeDate;
                }
                else if (userType == "rm")
                {
                    trBranchandRMDps.Visible = false;
                    trRange.Visible          = true;
                }

                else if (userType == "bm")
                {
                    trBranchandRMDps.Visible = true;
                    if (!IsPostBack)
                    {
                        BindBranchForBMDropDown();
                        BindRMforBranchDropdown(0, bmID, 1);
                        trRange.Visible  = true;
                        trPeriod.Visible = false;
                    }
                }
                dsGetLastTradeDate = customertransactionbo.GetLastTradeDate();
                DateTime dtLastTradeDate;


                if (dsGetLastTradeDate.Tables[0].Rows.Count != 0)
                {
                    dtLastTradeDate = (DateTime)dsGetLastTradeDate.Tables[0].Rows[0]["WTD_Date"];

                    txtFromDate.Text = dtLastTradeDate.ToShortDateString();
                    txtToDate.Text   = dtLastTradeDate.ToShortDateString();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AddBranch.ascx:PageLoad()");

                object[] objects = new object[2];
                objects[0]   = advisorVo;
                objects[1]   = path;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userVo = (UserVo)Session["UserVo"];


            if (Request.Form["ctrl_EquityReports$btnView"] != "View Report")
            {
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                if (!string.IsNullOrEmpty(Session[SessionContents.RmVo].ToString()))
                {
                    rmVo = (RMVo)Session[SessionContents.RmVo];
                }

                if (Session["UserType"] != null)
                {
                    if (Session["UserType"].ToString() == "Customer")
                    {
                        strFromCustomerDashBoard = true;
                    }
                }

                if (Session["UserType"].ToString().Trim() == "Customer" && strFromCustomerDashBoard == true)
                {
                    if (!string.IsNullOrEmpty(Session["CustomerVo"].ToString()))
                    {
                        customerVo = (CustomerVo)Session["CustomerVo"];
                    }
                    isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId);
                    if (isGrpHead == false)
                    {
                        TabPanel1.Visible = false;
                        TabPanel2.Visible = true;
                        if (!IsPostBack)
                        {
                            HdnIsGroupHeadReport.Value = "1";
                        }
                    }
                    else
                    {
                        TabPanel1.Visible = true;
                        TabPanel2.Visible = true;
                        if (!IsPostBack)
                        {
                            HdnIsGroupHeadReport.Value = "0";
                        }
                    }
                    CustomerLogin               = true;
                    hndCustomerLogin.Value      = "true";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                    trCustomerButton.Visible    = true;
                    trAdminRmButton.Visible     = false;
                }
                else
                {
                    hndCustomerLogin.Value      = "false";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                    trCustomerButton.Visible    = false;
                    trAdminRmButton.Visible     = true;
                }

                BindPeriodDropDown();

                if (!string.IsNullOrEmpty(Session["advisorVo"].ToString()))
                {
                    advisorVo = (AdvisorVo)Session["advisorVo"];
                }

                if (!IsPostBack)
                {
                    txtFromDate.Text = DateTime.Now.AddMonths(-1).ToString("dd-MM-yyyy");
                    txtToDate.Text   = DateTime.Now.ToString("dd-MM-yyyy");
                    CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                    DataSet ds = customerTransactionBo.GetLastTradeDate();
                    if (ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["WTD_Date"] != null)
                    {
                        txtAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                    }
                    txtFromDate.Text = DateTime.Now.AddMonths(-1).ToString("dd-MM-yyyy");
                    txtToDate.Text   = DateTime.Now.ToString("dd-MM-yyyy");
                    if (CustomerLogin == true)
                    {
                        trCustomerGrHead.Visible    = true;
                        trAdminCustomer.Visible     = false;
                        trAdminIndiCustomer.Visible = false;
                        trCustomerInd.Visible       = true;
                        trStepIndi.Visible          = false;
                        trStepGrHead.Visible        = false;
                        hdnCustomerId1.Value        = customerVo.CustomerId.ToString();
                        ShowGroupCustomers();
                        IndivisulCustomerLogin();
                    }
                    else
                    {
                        trCustomerGrHead.Visible    = false;
                        trAdminCustomer.Visible     = true;
                        trAdminIndiCustomer.Visible = true;
                        trCustomerInd.Visible       = false;
                        trStepIndi.Visible          = true;
                        trStepGrHead.Visible        = true;


                        if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                        {
                            txtCustomer_autoCompleteExtender.ContextKey          = rmVo.RMId.ToString();
                            txtParentCustomer_autoCompleteExtender.ContextKey    = rmVo.RMId.ToString();
                            txtCustomer_autoCompleteExtender.ServiceMethod       = "GetMemberCustomerName";
                            txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName";
                        }
                        else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin" || Session[SessionContents.CurrentUserRole].ToString() == "Ops")
                        {
                            txtCustomer_autoCompleteExtender.ContextKey          = advisorVo.advisorId.ToString();
                            txtParentCustomer_autoCompleteExtender.ContextKey    = advisorVo.advisorId.ToString();
                            txtCustomer_autoCompleteExtender.ServiceMethod       = "GetAdviserCustomerName";
                            txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName";
                        }
                    }
                }

                if (IsPostBack && !string.IsNullOrEmpty(Request.Form["ctrl_EquityReports$hidTabIndex"]))
                {
                    activeTabIndex = Convert.ToInt32(Request.Form["ctrl_EquityReports$hidTabIndex"]);
                }
            }
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userVo = (UserVo)Session["UserVo"];

            //ddlReportSubType.Attributes.Add("onchange", "ChangeDates()");
            rdoGroup.Attributes.Add("onClick", "javascript:ChangeCustomerSelectionTextBox(value);");
            rdoIndividual.Attributes.Add("onClick", "javascript:ChangeCustomerSelectionTextBox(value);");
            rdoCustomerGroup.Attributes.Add("onClick", "javascript:ChangeGroupOrSelf(value);");
            rdoCustomerIndivisual.Attributes.Add("onClick", "javascript:ChangeGroupOrSelf(value);");

            if (!string.IsNullOrEmpty(Session["advisorVo"].ToString()))
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
            }
            // cvAsOnDate.ValueToCompare = DateTime.Now.ToShortDateString();

            if (Request.Form["ctrl_MFReports$tabViewAndEmailReports$tabpnlViewReports$btnViewReport"] != "View Report" && Request.Form["ctrl_MFReports$tabViewAndEmailReports$tabpnlEmailReports$btnEmailReport"] != "Email Report")
            {
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                if (!string.IsNullOrEmpty(Session[SessionContents.RmVo].ToString()))
                {
                    rmVo = (RMVo)Session[SessionContents.RmVo];
                }

                if (Session["UserType"] != null)
                {
                    if (Session["UserType"].ToString() == "Customer")
                    {
                        strFromCustomerDashBoard = true;
                    }
                }

                if (userVo.UserType == "Customer" || strFromCustomerDashBoard == true)
                {
                    if (!string.IsNullOrEmpty(Session["CustomerVo"].ToString()))
                    {
                        customerVo = (CustomerVo)Session["CustomerVo"];
                    }
                    CustomerLogin               = true;
                    hndCustomerLogin.Value      = "true";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                    tabpnlEmailReports.Visible  = false;
                }
                else
                {
                    hndCustomerLogin.Value      = "false";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                }

                BindPeriodDropDown();

                //if (CustomerLogin == false)
                //{
                //    txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                //    txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                //}
                if (!IsPostBack)
                {
                    ddlMFTransactionTypeBind();
                    if (CustomerLogin == true)
                    {
                        trCustomerName.Visible  = true;
                        trIndCustomer.Visible   = false;
                        trGroupCustomer.Visible = false;
                        IndivisulCustomerLogin();

                        trAdvisorRadioList.Visible  = false;
                        trCustomerRadioList.Visible = true;

                        trAdminRM.Visible  = false;
                        trCustomer.Visible = true;

                        isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId);
                        if (isGrpHead == false)
                        {
                            trCustomerRadioList.Visible   = false;
                            rdoCustomerIndivisual.Checked = true;
                            divGroupCustomers.Visible     = false;
                            hndSelfOrGroup.Value          = "self";
                            ShowFolios();
                        }
                        else
                        {
                            rdoCustomerGroup.Checked = true;
                            hndSelfOrGroup.Value     = "";
                        }
                    }
                    else
                    {
                        trCustomerName.Visible  = false;
                        trIndCustomer.Visible   = true;
                        trGroupCustomer.Visible = true;

                        trAdvisorRadioList.Visible  = true;
                        trCustomerRadioList.Visible = false;

                        trAdminRM.Visible  = true;
                        trCustomer.Visible = false;
                    }


                    //tabpnlEmailReports.Visible = false;
                    if (CustomerLogin == false)
                    {
                        //This for Customer Search AutoCompelete TextBox Dynamic Assign Service Method.
                        //if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                        //{
                        //    txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                        //    txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                        //    txtCustomer_autoCompleteExtender.ServiceMethod = "GetMemberCustomerName";
                        //    txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName";
                        //}
                        //else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin")
                        //{
                        //    txtCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString();
                        //    txtParentCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString();
                        //    txtCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserCustomerName";
                        //    txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName";

                        //}


                        //ListBox horizontal Scorling enabled false
                        LBCustomer.HorizontalScrollEnabled       = false;
                        LBSelectCustomer.HorizontalScrollEnabled = false;

                        CustomerBo customerBo          = new CustomerBo();
                        DataTable  dtGroupCustomerList = new DataTable();
                        //dtGroupCustomerList = customerBo.GetParentCustomerName("BULKMAIL", int.Parse(rmVo.RMId.ToString()));
                        if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                        {
                            tabpnlEmailReports.Visible = true;
                            dtGroupCustomerList        = customerBo.GetParentCustomerName("BULKMAIL", int.Parse(rmVo.RMId.ToString()));
                        }
                        else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin")
                        {
                            tabpnlEmailReports.Visible = true;
                            dtGroupCustomerList        = customerBo.GetAdviserGroupCustomerName("BULKMAIL", int.Parse(advisorVo.advisorId.ToString()));
                        }
                        else if (Session[SessionContents.CurrentUserRole].ToString() == "BM")
                        {
                            tabpnlEmailReports.Visible = false;
                        }

                        LBCustomer.DataSource     = dtGroupCustomerList;
                        LBCustomer.DataTextField  = "C_FirstName";
                        LBCustomer.DataValueField = "C_CustomerId";
                        LBCustomer.DataBind();
                    }
                    CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                    DataSet ds = customerTransactionBo.GetLastTradeDate();
                    if (ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["WTD_Date"] != null)
                    {
                        txtAsOnDate.Text      = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtFromDate.Text      = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtToDate.Text        = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtEmailAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtEmailFromDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtEmailToDate.Text   = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                    }
                    //Transaction Subreport search invissible intitialy..
                    //trTranFilter1.Visible = false;
                    //trTranFilter2.Visible = false;
                    tabViewAndEmailReports.ActiveTabIndex = 0;
                    //ShowFolios();
                }
                if (CustomerLogin == false)
                {
                    if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                    {
                        hidBMLogin.Value = "False";
                        txtCustomer_autoCompleteExtender.ContextKey          = rmVo.RMId.ToString();
                        txtParentCustomer_autoCompleteExtender.ContextKey    = rmVo.RMId.ToString();
                        txtCustomer_autoCompleteExtender.ServiceMethod       = "GetMemberCustomerName";
                        txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName";
                    }
                    else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin")
                    {
                        hidBMLogin.Value = "False";
                        txtCustomer_autoCompleteExtender.ContextKey          = advisorVo.advisorId.ToString();
                        txtParentCustomer_autoCompleteExtender.ContextKey    = advisorVo.advisorId.ToString();
                        txtCustomer_autoCompleteExtender.ServiceMethod       = "GetAdviserCustomerName";
                        txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName";
                    }
                    else if (Session[SessionContents.CurrentUserRole].ToString() == "BM")
                    {
                        hidBMLogin.Value = "true";
                        txtCustomer_autoCompleteExtender.ContextKey          = rmVo.RMId.ToString();
                        txtParentCustomer_autoCompleteExtender.ContextKey    = rmVo.RMId.ToString();
                        txtCustomer_autoCompleteExtender.ServiceMethod       = "GetBMIndividualCustomerNames";
                        txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetBMParentCustomerNames";
                    }
                }

                if (IsPostBack && !string.IsNullOrEmpty(Request.Form["ctrl_MFReports$hidTabIndex"]))
                {
                    activeTabIndex = Convert.ToInt32(Request.Form["ctrl_MFReports$hidTabIndex"]);
                    tabViewAndEmailReports.ActiveTabIndex = activeTabIndex;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                this.Page.Culture = "en-GB";
                advisorVo         = (AdvisorVo)Session["advisorVo"];
                path            = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                userType        = Session["UserType"].ToString().ToLower();
                dsLastTradeDate = customertransactionbo.GetLastTradeDate();

                SessionBo.CheckSession();
                userVo = (UserVo)Session["userVo"];
                rmVo   = advisorStaffBo.GetAdvisorStaff(userVo.UserId);
                bmID   = rmVo.RMId;


                if (dsLastTradeDate.Tables[0].Rows.Count != 0)
                {
                    DateTime dtFromLastDate = (DateTime)dsLastTradeDate.Tables[0].Rows[0]["WTD_Date"];
                    DateTime dtToLastDate   = (DateTime)dsLastTradeDate.Tables[0].Rows[0]["WTD_Date"];
                    txtFromDate.Text = dtFromLastDate.ToShortDateString();
                    txtToDate.Text   = dtToLastDate.ToShortDateString();
                }
                if (txtFromDate.Text != null && txtFromDate.Text != "")
                {
                    convertedFromDate = Convert.ToDateTime(txtFromDate.Text.Trim(), ci);
                }
                else
                {
                    convertedFromDate = DateTime.MinValue;
                }
                if (txtToDate.Text != null && txtToDate.Text != "")
                {
                    convertedToDate = Convert.ToDateTime(txtToDate.Text.Trim(), ci);
                }
                else
                {
                    convertedToDate = DateTime.MinValue;
                }
                if (userType == "rm")
                {
                    spnBranch.Visible = false;
                    spnRM.Visible     = false;
                }
                if (userType == "adviser")
                {
                    if (!IsPostBack)
                    {
                        BindBranchDropDown();
                        BindRMDropDown();
                    }
                }
                if (userType == "bm")
                {
                    if (!IsPostBack)
                    {
                        BindBranchForBMDropDown();
                        BindRMforBranchDropdown(0, bmID, 1);
                    }
                    hdnbranchHeadId.Value = ddlBranch.SelectedValue;
                    hdnall.Value          = "2";
                    hdnbranchId.Value     = "0";
                    hdnrmId.Value         = "0";
                }
                //to hide the dropdown selection for mis type for adviser and bm
                if (!IsPostBack)
                {
                    rbtnPickDate.Checked   = true;
                    rbtnPickPeriod.Checked = false;
                    //trRange.Visible = true;
                    trPeriod.Visible = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AddBranch.ascx:PageLoad()");

                object[] objects = new object[2];
                objects[0]   = advisorVo;
                objects[1]   = path;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            advisorVo = (AdvisorVo)Session["advisorVo"];
            path      = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());

            if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "admin" || Session[SessionContents.CurrentUserRole].ToString().ToLower() == "ops")
            {
                userType = "advisor";
            }
            else
            {
                userType = Session[SessionContents.CurrentUserRole].ToString().ToLower();
            }

            advisorId = advisorVo.advisorId;
            PortfolioBo portfoliobo = new PortfolioBo();
            string      valuedate   = Convert.ToString(portfoliobo.GetLatestValuationDate(advisorId, "EQ"));

            hdnValuationDate.Value = valuedate.ToString();
            if (hdnValuationDate.Value == string.Empty)
            {
                if (userType == "advisor")
                {
                    BindBranchDropDown();
                    BindRMDropDown();
                }
                else if (userType == "rm")
                {
                    trBranchRmDpRow.Visible = false;
                }
                else if (userType == "bm")
                {
                    BindBranchForBMDropDown();
                    BindRMforBranchDropdown(0, bmID, 1);
                    trComSecWiseOptions.Visible = true;
                }
            }
            else
            {
                try
                {
                    /* For UserType */
                    advisorVo = (AdvisorVo)Session["advisorVo"];
                    path      = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());

                    if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "admin" || Session[SessionContents.CurrentUserRole].ToString().ToLower() == "ops")
                    {
                        userType = "advisor";
                    }
                    else
                    {
                        userType = Session[SessionContents.CurrentUserRole].ToString().ToLower();
                    }

                    SessionBo.CheckSession();
                    userVo          = (UserVo)Session["userVo"];
                    rmVo            = advisorStaffBo.GetAdvisorStaff(userVo.UserId);
                    bmID            = rmVo.RMId;
                    gvEQMIS.Visible = false;
                    if (!IsPostBack)
                    {
                        if (valuedate != "")
                        {
                            LatestValuationdate    = Convert.ToDateTime(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "EQ"));
                            hdnValuationDate.Value = LatestValuationdate.ToString();
                        }
                        if (LatestValuationdate != DateTime.MinValue)
                        {
                            txtEQDate.Text = LatestValuationdate.Date.ToShortDateString();
                        }
                        BindMISTypeDropDown();
                    }

                    dsGetLastTradeDate = customertransactionbo.GetLastTradeDate();
                    DateTime dtLastTradeDate;

                    if (valuedate != "")
                    {
                        LatestValuationdate    = Convert.ToDateTime(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "EQ"));
                        hdnValuationDate.Value = LatestValuationdate.ToString();
                    }
                    if (LatestValuationdate != DateTime.MinValue)
                    {
                        txtEQDate.Text = LatestValuationdate.Date.ToShortDateString();
                    }


                    if (dsGetLastTradeDate.Tables[0].Rows.Count != 0)
                    {
                        dtLastTradeDate = (DateTime)dsGetLastTradeDate.Tables[0].Rows[0]["WTD_Date"];
                    }

                    //to hide the dropdown selection for mis type for adviser and bm
                }
                catch (BaseApplicationException Ex)
                {
                    throw Ex;
                }
                catch (Exception Ex)
                {
                    BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                    NameValueCollection      FunctionInfo = new NameValueCollection();

                    FunctionInfo.Add("Method", "AddBranch.ascx:PageLoad()");

                    object[] objects = new object[2];
                    objects[0]   = advisorVo;
                    objects[1]   = path;
                    FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                    exBase.AdditionalInformation = FunctionInfo;
                    ExceptionManager.Publish(exBase);
                    throw exBase;
                }
            }
        }