protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                trDPAccount.Visible      = false;
                trDPAccountsGrid.Visible = false;
                userVo     = (UserVo)Session["userVo"];
                customerVo = (CustomerVo)Session["CustomerVo"];


                if (!IsPostBack)
                {
                    if (Session[SessionContents.PortfolioId] != null)
                    {
                        portfolioId = int.Parse(Session[SessionContents.PortfolioId].ToString());
                        BindPortfolioDropDown();



                        dtBroker = XMLBo.GetBroker(path);
                        ddlBrokerCode.DataSource     = dtBroker;
                        ddlBrokerCode.DataTextField  = "Broker";
                        ddlBrokerCode.DataValueField = "BrokerCode";
                        ddlBrokerCode.DataBind();

                        if (Request.QueryString["action"] != "" && Request.QueryString["action"] != null)
                        {
                            if (Request.QueryString["action"].Trim() == "Edit")
                            {
                                BtnSetVisiblity(1);
                                EditEQAccountDetails();
                            }
                            else if (Request.QueryString["action"].Trim() == "View")
                            {
                                BtnSetVisiblity(0);
                                lnkBack.Visible = true;
                                ViewEQAccountDetails();
                            }
                        }
                        else
                        {
                            ddlBrokerCode.Items.Insert(0, new ListItem("Select a Broker Code", "Select a Broker Code"));
                            //dateValidator.MinimumValue = "1/1/1900";
                            //dateValidator.MaximumValue = DateTime.Today.ToString();
                        }
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerEQAccountAdd.ascx:Page_Load()");
                object[] objects = new object[4];
                objects[0]   = path;
                objects[1]   = userVo;
                objects[2]   = customerVo;
                objects[3]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //txtTradeNum.Attributes.Add("onchange", "javascript:checkLoginId(value);");
            try
            {
                SessionBo.CheckSession();
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                trDPAccount.Visible      = false;
                trDPAccountsGrid.Visible = false;
                userVo     = (UserVo)Session["userVo"];
                customerVo = (CustomerVo)Session["CustomerVo"];


                if (!IsPostBack)
                {
                    gvEqMIS.Visible = false;
                    if (Session[SessionContents.PortfolioId] != null)
                    {
                        portfolioId = int.Parse(Session[SessionContents.PortfolioId].ToString());
                        BindPortfolioDropDown();
                        BindCustomerBankList();
                        BindAccountNum();
                        dtBroker = XMLBo.GetBroker(path);
                        ddlBrokerCode.DataSource     = dtBroker;
                        ddlBrokerCode.DataTextField  = "Broker";
                        ddlBrokerCode.DataValueField = "BrokerCode";
                        ddlBrokerCode.DataBind();
                        //Txt_ServiceTax.Text = 12.36.ToString();
                        if (Request.QueryString["action"] != "" && Request.QueryString["action"] != null)
                        {
                            customerAccountsVo = (CustomerAccountsVo)Session["EQAccountVoRow"];
                            if (Request.QueryString["action"].Trim() == "Edit")
                            {
                                BtnSetVisiblity(1);
                                EditEQAccountDetails();
                            }
                            else if (Request.QueryString["action"].Trim() == "View")
                            {
                                BtnSetVisiblity(0);
                                lnkBack.Visible = true;
                                ViewEQAccountDetails();
                            }
                            if (ddlBankList.SelectedIndex != 0 && ddlAccountNum.SelectedIndex != -1)
                            {
                                BindEQLedgerMIS(customerVo.CustomerId, customerAccountsVo.AccountId, customerAccountsVo.BankId);
                            }
                            else
                            {
                                tblMessage.Visible     = true;
                                ErrorMessage.Visible   = true;
                                ErrorMessage.InnerText = "Bank is not associated with Current trade  Account selected...!";
                            }
                        }
                        else
                        {
                            ddlBrokerCode.Items.Insert(0, new ListItem("Select a Broker Code", "Select a Broker Code"));
                            //dateValidator.MinimumValue = "1/1/1900";
                            //dateValidator.MaximumValue = DateTime.Today.ToString();
                        }
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerEQAccountAdd.ascx:Page_Load()");
                object[] objects = new object[4];
                objects[0]   = path;
                objects[1]   = userVo;
                objects[2]   = customerVo;
                objects[3]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }