예제 #1
0
        private void SavePortfolioDetails()
        {
            newCustomerPortfolioVo = new CustomerPortfolioVo();
            try
            {
                if (txtCustomerId.Value != string.Empty)
                {
                    customerId = int.Parse(txtCustomerId.Value);
                }
                newCustomerPortfolioVo.CustomerId        = customerId;
                newCustomerPortfolioVo.IsMainPortfolio   = 0;
                newCustomerPortfolioVo.PMSIdentifier     = txtPMSIdentifier.Text;
                newCustomerPortfolioVo.PortfolioName     = txtPortfolioName.Text;
                newCustomerPortfolioVo.PortfolioTypeCode = ddlPortfolioType.SelectedValue;

                portfolioBo.CreateCustomerPortfolio(newCustomerPortfolioVo, rmVo.UserId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "GroupAccountSetup.ascx:SavePortfolioDetails()");
                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
예제 #2
0
        /// <summary>
        /// Used to Create Complete Customer Details
        /// </summary>
        /// <param name="customerVo"></param>
        /// <param name="userVo"></param>
        /// <param name="customerPortfolioVo"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public List <int> CreateCompleteCustomer(CustomerVo customerVo, UserVo userVo, CustomerPortfolioVo customerPortfolioVo, int userId)
        {
            List <int>  customerIds = new List <int>();
            CustomerDao customerDao = new CustomerDao();

            try
            {
                customerIds = customerDao.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, userId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBo.cs:CreateCompleteCustomer()");


                object[] objects = new object[4];
                objects[0] = customerVo;
                objects[1] = userVo;
                objects[2] = customerPortfolioVo;
                objects[3] = userId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(customerIds);
        }
        public CustomerPortfolioVo GetCustomerDefaultPortfolio1(int customerId, string portfolio)
        {
            CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo();
            PortfolioDao        portfolioDao        = new PortfolioDao();

            try
            {
                customerPortfolioVo = portfolioDao.GetCustomerDefaultPortfolio1(customerId, portfolio);
            }

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

                FunctionInfo.Add("Method", "PortfolioBo.cs:GetCustomerDefaultPortfolio()");


                object[] objects = new object[1];
                objects[0] = customerId;

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

            return(customerPortfolioVo);
        }
        public bool UpdateCustomerPortfolio(CustomerPortfolioVo customerPortfolioVo, int userId)
        {
            bool         bResult      = false;
            PortfolioDao portfolioDao = new PortfolioDao();

            try
            {
                bResult = portfolioDao.UpdateCustomerPortfolio(customerPortfolioVo, userId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioBo.cs:UpdateCustomerPortfolio()");
                object[] objects = new object[2];
                objects[0]   = customerPortfolioVo;
                objects[1]   = userId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(bResult);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            rmvo = (RMVo)Session["rmvo"];


            customerportfoliovo = (CustomerPortfolioVo)Session["customerPortfolioVo"];

            if (Session["DematDetailsView"].ToString() == "View")
            {
                lblTitle.Text = "View Demat Account";
                # region View Section
                txtBeneficiaryAcctNbr.Enabled = false;
                rbtnYes.Enabled               = false;
                rbtnNo.Enabled                = false;
                txtDpClientId.Enabled         = false;
                txtDPId.Enabled               = false;
                txtDpName.Enabled             = false;
                ddlModeOfHolding.Enabled      = false;
                txtBeneficiaryAcctNbr.Enabled = false;
                gvPickJointHolder.Enabled     = false;
                gvPickNominee.Enabled         = false;
                lstAvailableTrades.Enabled    = false;
                lstAssocaitedTrades.Enabled   = false;
                addBranch.Disabled            = true;
                deleteBranch.Disabled         = true;
                txtAccountOpeningDate.Enabled = false;
                btnSubmit.Visible             = false;
                lbtnBackButton.Visible        = true;
                ViewEditMode();

                # endregion
            }
        protected void ddlTradeAccountNos_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlTradeAccountNos.SelectedValue != "-1")
            {
                CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                CustomerAccountsVo    customerAccountsVo    = new CustomerAccountsVo();
                CustomerPortfolioVo   customerPortfolioVo   = new CustomerPortfolioVo();
                PortfolioBo           portfolioBo           = new PortfolioBo();
                CustomerVo            customerVo            = customerBo.GetCustomer(Convert.ToInt32(txtParentCustomerId.Value));

                customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId);
                customerAccountsVo  = customerTransactionBo.GetCustomerEQAccountDetails(int.Parse(ddlTradeAccountNos.SelectedValue.ToString()), customerPortfolioVo.PortfolioId);
                if (rdoDelivery.Checked)
                {
                    hidBrokerRate.Value = customerAccountsVo.BrokerageDeliveryPercentage.ToString();
                }
                else
                {
                    hidBrokerRate.Value = customerAccountsVo.BrokerageSpeculativePercentage.ToString();
                }
                hidOtherCharges.Value = customerAccountsVo.OtherCharges.ToString();
            }
            else
            {
                hidBrokerRate.Value   = "0";
                hidOtherCharges.Value = "0";
            }
        }
예제 #7
0
        public List <CustomerPortfolioVo> GetCustomerPortfolios(int customerId)
        {
            List <CustomerPortfolioVo> customerPortfolioVoList = null;

            CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo();
            Database            db;
            DbCommand           getCustomerPortfolioCmd;
            DataSet             dsGetCustomerPortfolio;


            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getCustomerPortfolioCmd = db.GetStoredProcCommand("SP_GetCustomerPortfolio");
                db.AddInParameter(getCustomerPortfolioCmd, "C_CustomerId", DbType.Int32, customerId);

                dsGetCustomerPortfolio = db.ExecuteDataSet(getCustomerPortfolioCmd);
                if (dsGetCustomerPortfolio.Tables[0].Rows.Count > 0)
                {
                    customerPortfolioVoList = new List <CustomerPortfolioVo>();

                    foreach (DataRow dr in dsGetCustomerPortfolio.Tables[0].Rows)
                    {
                        customerPortfolioVo                   = new CustomerPortfolioVo();
                        customerPortfolioVo.PortfolioId       = int.Parse(dr["CP_PortfolioId"].ToString());
                        customerPortfolioVo.CustomerId        = int.Parse(dr["C_CustomerId"].ToString());
                        customerPortfolioVo.IsMainPortfolio   = int.Parse(dr["CP_IsMainPortfolio"].ToString());
                        customerPortfolioVo.PortfolioTypeCode = dr["XPT_PortfolioTypeCode"].ToString();
                        customerPortfolioVo.PMSIdentifier     = dr["CP_PMSIdentifier"].ToString();
                        customerPortfolioVo.PortfolioName     = dr["CP_PortfolioName"].ToString();

                        customerPortfolioVoList.Add(customerPortfolioVo);
                    }
                }
            }

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

                FunctionInfo.Add("Method", "PortfolioDao.cs:GetCustomerPortfolios()");


                object[] objects = new object[1];
                objects[0] = customerId;

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

            return(customerPortfolioVoList);
        }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                userVo              = (UserVo)Session[SessionContents.UserVo];
                customerVo          = (CustomerVo)Session[SessionContents.CustomerVo];
                rmVo                = (RMVo)Session[SessionContents.RmVo];
                userId              = userVo.UserId;
                customerId          = customerVo.CustomerId;
                customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerId);
                portfolioId         = customerPortfolioVo.PortfolioId;
                Session[SessionContents.PortfolioId] = portfolioId;
                //lblMessage.Visible = false;
                //trlblerrormsg.Visible = false;
                lblMaturityMsg.Visible      = false;
                lblLifeInsurance.Visible    = false;
                lblGeneralInsurance.Visible = false;
                BindCustomerAssetMaturityDates();
                BindAssetInvestments();
                BindAssetCurrentValChart();
                BindCustInsuranceDetails();
                BindCustomerAlerts();
                // Show unread messages
                ShowUnreadMessageAlert();
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

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

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


                object[] objects = new object[10];

                objects[0]   = customerVo;
                objects[1]   = userVo;
                objects[2]   = customerMemberVo;
                objects[3]   = rmVo;
                objects[4]   = customerFamilyVo;
                objects[5]   = customerFamilyList;
                objects[6]   = customerPortfolioVo;
                objects[7]   = userId;
                objects[8]   = customerId;
                objects[9]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void Save()
        {
            CustomerVo          customerVo          = new CustomerVo();
            UserVo              userVo              = new UserVo();
            CustomerBo          customerBo          = new CustomerBo();
            CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo();
            List <int>          customerIds         = new List <int>();

            if (Page.IsValid)
            {
                if (fpuserVo.C_CustomerId == null || fpuserVo.C_CustomerId == 0)
                {
                    customerVo.RmId            = 4682;
                    customerVo.BranchId        = 1339;
                    customerVo.Type            = "IND";
                    customerVo.FirstName       = fpuserVo.UserName;
                    userVo.FirstName           = fpuserVo.UserName;
                    customerVo.Email           = fpuserVo.EMail;
                    customerVo.IsProspect      = 1;
                    customerVo.IsFPClient      = 1;
                    customerVo.IsActive        = 1;
                    customerVo.IsRealInvestor  = true;
                    customerVo.PANNum          = fpuserVo.Pan;
                    customerVo.Mobile1         = fpuserVo.MobileNo;
                    customerVo.ProspectAddDate = DateTime.Now;
                    customerVo.Dob             = fpuserVo.DOB;
                    userVo.Email = fpuserVo.EMail;
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolioProspect";
                    customerIds = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, fpuserVo.UserId);
                    if (customerIds != null)
                    {
                        CustomerFamilyVo familyVo = new CustomerFamilyVo();
                        CustomerFamilyBo familyBo = new CustomerFamilyBo();
                        familyVo.AssociateCustomerId = customerIds[1];
                        familyVo.CustomerId          = customerIds[1];
                        familyVo.Relationship        = "SELF";
                        familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);
                    }
                    if (UpdateCustomerIdInFPUserTable(fpuserVo.UserId, customerIds[1]))
                    {
                        divTncSuccess.Visible = true;
                    }
                }
                else
                {
                    if (UpdateCustomerIdInFPUserTable(fpuserVo.UserId, fpuserVo.C_CustomerId))
                    {
                        divTncSuccess.Visible = true;
                    }
                }
                divtnc1.Visible       = false;
                divtnc2.Visible       = false;
                divTncSuccess.Visible = true;
            }
        }
예제 #10
0
        protected void ddlActionForProspect_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            int                 userId              = 0;
            UserBo              userBo              = new UserBo();
            bool                isGrpHead           = false;
            CustomerVo          customerVo          = new CustomerVo();
            CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo();
            PortfolioBo         portfolioBo         = new PortfolioBo();
            CustomerBo          customerBo          = new CustomerBo();
            int                 ParentId;

            if (Session[SessionContents.PortfolioId] != null)
            {
                Session.Remove(SessionContents.PortfolioId);
            }
            LinkButton lnkAction = (LinkButton)sender;
            //RadComboBox ddlAction = (RadComboBox)sender;
            GridDataItem item = (GridDataItem)lnkAction.NamingContainer;

            ParentId = int.Parse(gvLeadList.MasterTableView.DataKeyValues[item.ItemIndex]["C_CustomerId"].ToString());

            Session["ParentIdForDelete"] = ParentId;
            customerVo            = customerBo.GetCustomer(ParentId);
            Session["CustomerVo"] = customerVo;
            isGrpHead             = customerBo.CheckCustomerGroupHead(ParentId);

            //to set portfolio Id and its details
            customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(ParentId);
            //Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
            Session["customerPortfolioVo"] = customerPortfolioVo;

            Session["IsDashboard"] = "false";
            customerPortfolioVo    = portfolioBo.GetCustomerDefaultPortfolio(ParentId);
            if (customerVo.IsProspect == 0)
            {
                //Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
                //Session["customerPortfolioVo"] = customerPortfolioVo;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "RMCustomerIndividualDashboard", "loadcontrol('RMCustomerIndividualDashboard','login');", true);
            }
            else
            {
                isGrpHead = customerBo.CheckCustomerGroupHead(ParentId);
                if (isGrpHead == false)
                {
                    ParentId = customerBo.GetCustomerGroupHead(ParentId);
                }
                else
                {
                    ParentId = customerVo.CustomerId;
                }
                Session[SessionContents.FPS_ProspectList_CustomerId]     = ParentId;
                Session[SessionContents.FPS_AddProspectListActionStatus] = "View";
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('AddProspectList','login');", true);
                //Session[SessionContents.FPS_TreeView_Status] = "FinanceProfile";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int customerId;
            int portfolioid;

            rmvo = (RMVo)Session["rmvo"];
            BindDepositoryType();
            customerportfoliovo = (CustomerPortfolioVo)Session["customerPortfolioVo"];
            if (Request.QueryString["CustomerId"] != null)
            {
                lblisactive.Visible  = false;
                chk_isactive.Visible = false;
                customerId           = int.Parse(Request.QueryString["CustomerId"].ToString());

                dsModeOfHolding       = new DataSet();
                dtCustomerAccociation = new DataTable();
                dsCustomerAssociation = new DataSet();
                dsModeOfHolding       = bodemataccount.GetXmlModeOfHolding();
                dsCustomerAssociation = bodemataccount.GetCustomerAccociation(customerId);
                //Mode of Holding Combobox populating
                ddlModeOfHolding.DataSource     = dsModeOfHolding;
                ddlModeOfHolding.DataTextField  = "XMOH_ModeOfHolding";
                ddlModeOfHolding.DataValueField = "XMOH_ModeOfHoldingCode";
                ddlModeOfHolding.DataBind();
                ddlModeOfHolding.SelectedIndex = 8;
                chk_isactive.Enabled           = false;
                lbtnBack2Button.Visible        = false;
                Session["DematDetailsView"]    = "Add";
                lblTitle.Text = "Add Demat Account";
            }

            else if (Session["DematDetailsView"].ToString() == "View" && Session["DematAccountId"] != null)
            {
                lblTitle.Text = "View Demat Account";
                # region View Section
                ddlDepositoryName.Enabled = false;
                rbtnYes.Enabled           = false;
                rbtnNo.Enabled            = false;
                txtDpClientId.Enabled     = false;
                txtDPId.Enabled           = false;
                txtDpName.Enabled         = false;
                ddlModeOfHolding.Enabled  = false;
                ddlDepositoryName.Enabled = false;

                txtAccountOpeningDate.Enabled = false;
                btnSubmit.Visible             = false;
                lbtnBackButton.Visible        = true;
                chk_isactive.Enabled          = false;
                gvAssociate.Visible           = true;
                trAssociatePanel.Visible      = true;
                gvAssociate.Enabled           = false;
                ViewEditMode();

                # endregion
            }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            PortfolioBo portfolioBo = new PortfolioBo();

            String statusMsg                = string.Empty;
            int    totalFoliosMoved         = 0;
            CustomerPortfolioVo portfolioVo = new CustomerPortfolioVo();

            if (txtCustomerId.Value != string.Empty)
            {
                string portfolio = ddlAdvisorBranchList.SelectedValue;
                portfolioVo = portfolioBo.GetCustomerDefaultPortfolio1((Convert.ToInt32(txtCustomerId.Value)), portfolio);
                if (portfolioVo.PortfolioId < 1)
                {
                    lblMessage.Text    = "No default Portfolio found for the selected customer.";
                    lblMessage.Visible = true;
                    return;
                }
            }
            else
            {
                lblMessage.Text    = "Please select a customer.";
                lblMessage.Visible = true;
                return;
            }


            foreach (GridViewRow dr in gvMFFolio.Rows)
            {
                CheckBox checkBox = (CheckBox)dr.FindControl("chkBox");
                if (checkBox.Checked)
                {
                    int  MFAccountId = Convert.ToInt32(gvMFFolio.DataKeys[dr.RowIndex].Values[0]);
                    bool isUpdated   = PortfolioBo.TransferFolio(MFAccountId, portfolioVo.PortfolioId);
                    if (isUpdated)
                    {
                        totalFoliosMoved++;
                    }
                    else
                    {
                        statusMsg += "<br/>Error occurred while moving folio with mutual fund accountId " + MFAccountId + ".<br/>";
                    }
                }
            }
            if (totalFoliosMoved > 0)
            {
                statusMsg += "<b style='color:Green'>Total Folios moved = " + totalFoliosMoved + "</b>";
            }
            //lblMessage.Text = statusMsg;
            //lblMessage.Visible = true;
            lblTransferMsg.Text = statusMsg;
            divMessage.Attributes.Add("class", "yellow-box");
            BindFolioGridView();
        }
        protected void btnSubmitMoveFolio_Click(object sender, EventArgs e)
        {
            try
            {
                customerVo = (CustomerVo)Session["customerVo"];
                CustomerPortfolioVo portfolioVo = new CustomerPortfolioVo();
                CheckBox            chkBox      = new CheckBox();
                chkBox = GetchkBox();
                int    accountID;
                int    customerId = customerVo.CustomerId;
                int    TofolioId  = Convert.ToInt32(ddlPickPortfolio.SelectedValue);
                bool   PortFolioUpdate;
                string statusMsg = string.Empty;

                foreach (GridDataItem dr in gvMFFolio.Items)
                {
                    int selectedRow = 0;
                    //int rowIndex = dr.RowIndex;
                    //DataKey dKey = gvMFFolio.DataKeys[rowIndex];

                    if (((CheckBox)dr.FindControl("chkBox")).Checked == true)
                    {
                        AdvisorBranchBo adviserBranchBo = new AdvisorBranchBo();
                        accountID = Convert.ToInt32(gvMFFolio.MasterTableView.DataKeyValues[selectedRow]["FolioId"].ToString());
                        //string folioNo = gvMFFolio.MasterTableView.DataKeyValues[selectedRow]["FolioId"].ToString();
                        string folioNo = gvMFFolio.MasterTableView.Items[dr.ItemIndex].GetDataKeyValue("Folio No").ToString();

                        PortFolioUpdate = adviserBranchBo.FolioMoveToPortfolio(customerId, folioNo, TofolioId, accountID);
                        if (PortFolioUpdate == true)
                        {
                            statusMsg = "Portfolio Moved to Another Portfolio";
                            statusMsgSuccess.InnerText = statusMsg;
                            trFailure.Visible          = true;
                            statusMsgSuccess.Visible   = true;
                            statusMsgFailure.Visible   = false;
                        }
                        else
                        {
                            statusMsgFailure.InnerText = statusMsg;
                            statusMsg                = "Portfolio Has not been moved";
                            trFailure.Visible        = true;
                            statusMsgSuccess.Visible = false;
                            statusMsgFailure.Visible = true;
                        }
                    }
                }
                this.BindFolioGridView();
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
        }
예제 #14
0
        public bool CreateCustomerPortfolio(CustomerPortfolioVo customerPortfolioVo, int userId)
        {
            bool      bResult = false;
            int       customerPortfolioId;
            Database  db;
            DbCommand createPortfolioCmd;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                createPortfolioCmd = db.GetStoredProcCommand("SP_CreateCustomerPortfolio");
                db.AddInParameter(createPortfolioCmd, "C_CustomerId", DbType.Int32, customerPortfolioVo.CustomerId);
                db.AddInParameter(createPortfolioCmd, "CP_IsMainPortfolio", DbType.Int16, customerPortfolioVo.IsMainPortfolio);
                db.AddInParameter(createPortfolioCmd, "XPT_PortfolioTypeCode", DbType.String, customerPortfolioVo.PortfolioTypeCode);
                db.AddInParameter(createPortfolioCmd, "CP_PMSIdentifier", DbType.String, customerPortfolioVo.PMSIdentifier);
                db.AddInParameter(createPortfolioCmd, "CP_PortfolioName", DbType.String, customerPortfolioVo.PortfolioName);
                db.AddInParameter(createPortfolioCmd, "CP_CreatedBy", DbType.Int32, userId);
                db.AddInParameter(createPortfolioCmd, "CP_ModifiedBy", DbType.Int32, userId);
                db.AddOutParameter(createPortfolioCmd, "CP_PortfolioId", DbType.Int32, 10);

                if (db.ExecuteNonQuery(createPortfolioCmd) != 0)
                {
                    bResult = true;
                }
                customerPortfolioId = int.Parse(db.GetParameterValue(createPortfolioCmd, "CP_PortfolioId").ToString());
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "PortfolioDao.cs:CreateCustomerPortfolio()");


                object[] objects = new object[2];
                objects[0] = customerPortfolioVo;
                objects[1] = userId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(bResult);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                userVo     = (UserVo)Session["userVo"];
                customerVo = (CustomerVo)Session["customerVo"];//SessionContents.CustomerVo;

                if (Session[SessionContents.PortfolioId] != null)
                {
                    portfolioId = Int32.Parse(Session[SessionContents.PortfolioId].ToString());
                }
                else
                {
                    customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId);
                    Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
                    portfolioId = customerPortfolioVo.PortfolioId;
                }

                if (!IsPostBack)
                {
                    ErrorMessage.Visible = false;
                    BindPortfolioDropDown();
                    LoadGridview(portfolioId);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewInsuranceDetails.ascx:Page_Load()");
                object[] objects = new object[3];
                objects[0]   = userVo;
                objects[1]   = customerVo;
                objects[2]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            CustomerPortfolioVo customerportfoliovo = (CustomerPortfolioVo)Session["customerPortfolioVo"];

            customervo = (CustomerVo)Session["CustomerVo"];
            if (!IsPostBack)
            {
                int customerId = customervo.CustomerId;
                //int demataccountid = int.Parse(Session["DematAccountId"].ToString());
                try
                {
                    DataSet dsDematDetails = bodemataccount.GetDematAccountHolderDetails(customerId);
                    if (dsDematDetails == null)
                    {
                        gvDematDetailsTeleR.Visible = false;
                        lblError.Visible            = true;
                        lblError.Text = "No data available to show";
                    }
                    else
                    {
                        if (dsDematDetails.Tables[0].Rows.Count <= 0)
                        {
                            lblError.Visible = true;
                            lblError.Text    = "No data available to show";
                            //mypager.Visible = false;
                        }
                        else
                        {
                            lblError.Visible               = false;
                            gvDematDetailsTeleR.Visible    = true;
                            gvDematDetailsTeleR.DataSource = dsDematDetails.Tables[0];
                            gvDematDetailsTeleR.DataBind();
                            gvDematDetailsTele.Visible = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        private void UpdatePortfolioDetails()
        {
            newCustomerPortfolioVo = new CustomerPortfolioVo();
            dsPortfolioType        = new DataSet();
            try
            {
                if (txtCustomerId.Value != string.Empty)
                {
                    customerId = int.Parse(txtCustomerId.Value);
                }
                newCustomerPortfolioVo.PortfolioId = int.Parse(Session["PortfolioId"].ToString());
                dsPortfolioType = portfolioBo.GetCustomerPortfolioDetails(newCustomerPortfolioVo.PortfolioId);
                newCustomerPortfolioVo.CustomerId = customerId;
                if (dsPortfolioType.Tables[0].Rows[0]["CP_IsMainPortfolio"].ToString() != "")
                {
                    newCustomerPortfolioVo.IsMainPortfolio = int.Parse(dsPortfolioType.Tables[0].Rows[0]["CP_IsMainPortfolio"].ToString());
                }
                newCustomerPortfolioVo.PMSIdentifier     = txtPMSIdentifier.Text;
                newCustomerPortfolioVo.PortfolioName     = txtPortfolioName.Text;
                newCustomerPortfolioVo.PortfolioTypeCode = ddlPortfolioType.SelectedValue;

                portfolioBo.UpdateCustomerPortfolio(newCustomerPortfolioVo, userId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "GroupAccountSetup.ascx:SavePortfolioDetails()");
                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void btnAddTradeAccount_Click(object sender, EventArgs e)
        {
            CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo();
            PortfolioBo         portfolioBo         = new PortfolioBo();
            CustomerVo          customerVo          = customerBo.GetCustomer(Convert.ToInt32(txtParentCustomerId.Value));

            customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId);
            Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
            Session["CustomerVo"] = customerVo;

            SaveCurrentPageState();


            string queryString = "?prevPage=MultipleEqEntry";

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('CustomerEQAccountAdd','" + queryString + "');", true);



            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('CustomerEQAccountAdd','none')", true);

            //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountAdd','none');", true);
        }
        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);
        }
예제 #20
0
        /// <summary>
        /// Goes to the corresponding Grids on the click on the Assets class on the Assets Grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lnkAssetClassAssetsGrid_Click(object sender, EventArgs e)
        {
            string str = ((LinkButton)sender).Text;

            //GridViewRow gvRow = ((GridViewRow)(((LinkButton)sender).Parent.Parent));
            //int rowIndex = gvRow.RowIndex;
            //DataKey dk = gvAssetAggrCurrentValue.DataKeys[rowIndex];
            //int customerId = Convert.ToInt32(dk.Value);

            customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerId);
            Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
            if (str == "Mutual Fund")
            {
                Session["IsDashboard"] = "MFAssets";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewMutualFundPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewMutualFundPortfolio','none');", true);
                }
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "CustomerIndLeftPane", "loadlinks('RMCustomerIndividualLeftPane','login');", true);
            }
            else if (str == "Fixed Income")
            {
                Session["IsDashboard"] = "FixedIncome";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PortfolioFixedIncomeView','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioFixedIncomeView','none');", true);
                }
            }
            else if (str == "Govt Savings")
            {
                Session["IsDashboard"] = "GovtSavings";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewGovtSavings','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewGovtSavings','none');", true);
                }
            }
            else if (str == "Property")
            {
                Session["IsDashboard"] = "Property";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PortfolioProperty','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioProperty','none');", true);
                }
            }
            else if (str == "Pension & Gratuities")
            {
                Session["IsDashboard"] = "PensionGratuities";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PensionPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PensionPortfolio','none');", true);
                }
            }
            else if (str == "Personal Items")
            {
                Session["IsDashboard"] = "PersonalItems";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PortfolioPersonal','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioPersonal','none');", true);
                }
            }
            else if (str == "Gold")
            {
                Session["IsDashboard"] = "Gold";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewGoldPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewGoldPortfolio','none');", true);
                }
            }

            else if (str == "Collectibles")
            {
                Session["IsDashboard"] = "Collectibles";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewCollectiblesPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewCollectiblesPortfolio','none');", true);
                }
            }

            //else if (str == "BankAccountDetails")
            //{
            //    Session["IsDashboard"] = "BankAccountDetails";
            //    if (Session["S_CurrentUserRole"] == "Customer")
            //        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewBankDetails','none');", true);
            //    else
            //        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewBankDetails','none');", true);
            //}

            else if (str == "Insurance")
            {
                Session["IsDashboard"] = "Insurance";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewInsuranceDetails','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewInsuranceDetails','none');", true);
                }
            }
            else if (str == "General Insurance")
            {
                Session["IsDashboard"] = "GeneralInsurance";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewGeneralInsuranceDetails','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewGeneralInsuranceDetails','none');", true);
                }
            }
            else if (str == "Direct Equity")
            {
                Session["IsDashboard"] = "DirectEquity";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewEquityPortfolios','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewEquityPortfolios','none');", true);
                }
            }


            else if (str == "LiabilitiesView")
            {
                Session["IsDashboard"] = "LiabilitiesView";

                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('LiabilityView','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('LiabilityView','none');", true);
                }
            }
            else
            {
                Session["IsDashboard"] = "BankAccountDetails";
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewBankDetails','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewBankDetails','none');", true);
                }
            }

            ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "CustomerIndLeftPane", "loadlinks('RMCustomerIndividualLeftPane','login');", true);
        }
예제 #21
0
        /// <summary>
        /// Goes to the corresponding Grids on the click on the Assets class on the Assets Grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lnkAssetClassAssetsGrid_Click(object sender, EventArgs e)
        {
            string str = ((LinkButton)sender).Text;

            //GridViewRow gvRow = ((GridViewRow)(((LinkButton)sender).Parent.Parent));
            //int rowIndex = gvRow.RowIndex;
            //DataKey dk = gvAssetAggrCurrentValue.DataKeys[rowIndex];
            //int customerId = Convert.ToInt32(dk.Value);

            customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerId);
            Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
            if (str == "Mutual Fund")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewMutualFundPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewMutualFundPortfolio','none');", true);
                }
            }
            else if (str == "Fixed Income")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PortfolioFixedIncomeView','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioFixedIncomeView','none');", true);
                }
            }
            else if (str == "Govt Savings")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewGovtSavings','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewGovtSavings','none');", true);
                }
            }
            else if (str == "Property")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PortfolioProperty','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioProperty','none');", true);
                }
            }
            else if (str == "Pension & Gratuities")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PensionPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PensionPortfolio','none');", true);
                }
            }
            else if (str == "Personal Items")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PortfolioPersonal','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioPersonal','none');", true);
                }
            }
            else if (str == "Gold")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewGoldPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewGoldPortfolio','none');", true);
                }
            }
            else if (str == "Collectibles")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewCollectiblesPortfolio','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewCollectiblesPortfolio','none');", true);
                }
            }
            else if (str == "Cash&Savings")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('PortfolioCashSavingsView','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioCashSavingsView','none');", true);
                }
            }
            else if (str == "Direct Equity")
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('ViewEquityPortfolios','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewEquityPortfolios','none');", true);
                }
            }
            else
            {
                if (Session["S_CurrentUserRole"] == "Customer")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrolCustomer('LiabilityView','none');", true);
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('LiabilityView','none');", true);
                }
            }
        }
예제 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                customerVo = (CustomerVo)Session["CustomerVo"];
                rmVo       = (RMVo)Session["RmVo"];
                userVo     = (UserVo)Session["userVo"];
                if (userVo.UserType == "Advisor")
                {
                    adviserVo = (AdvisorVo)Session["advisorVo"];
                    adviserId = adviserVo.advisorId;
                }
                else if (userVo.UserType == "RM")
                {
                    adviserId = int.Parse(Session["adviserId"].ToString());
                }
                adviserId = ((AdvisorVo)Session["advisorVo"]).advisorId;

                GetLatestValuationDate();
                if (!IsPostBack)
                {
                    if (Session[SessionContents.PortfolioId] != null)
                    {
                        portfolioId = int.Parse(Session[SessionContents.PortfolioId].ToString());
                    }
                    else
                    {
                        customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId);
                        Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
                        portfolioId = customerPortfolioVo.PortfolioId;
                    }

                    BindPortfolioDropDown();
                    LoadChartsAndGrids();
                }
                else
                {
                    portfolioId = int.Parse(Session[SessionContents.PortfolioId].ToString());
                    BindPortfolioDropDown();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

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

                FunctionInfo.Add("Method", "PortfolioDashboard.ascx:Page_Load()");
                object[] objects = new object[6];
                objects[0]   = customerVo;
                objects[1]   = userVo;
                objects[2]   = rmVo;
                objects[3]   = adviserVo;
                objects[4]   = customerPortfolioVo;
                objects[5]   = adviserId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
            OnlineUserSessionBo.CheckSession();
            userVo     = (UserVo)Session["userVo"];
            rmVo       = (RMVo)Session["rmVo"];
            adviserVo  = (AdvisorVo)Session["advisorVo"];
            customerVo = (CustomerVo)Session["CustomerVo"];
            custPortVo = (CustomerPortfolioVo)Session["CustomerPortfolioVo"];
            if (custPortVo == null)
            {
                custPortVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId);
            }
            divValidationError.Visible = false;
            if (System.Web.HttpContext.Current.Session["BackOfficeUserId"] != null)
            {
                BackOfficeUserId = Convert.ToInt32(Session["BackOfficeUserId"]);
            }
            else
            {
                BackOfficeUserId = 0;
            }
            if (!IsPostBack)
            {
                clientMFAccessCode = boOnlineOrder.GetClientMFAccessStatus(customerVo.CustomerId);
                if (clientMFAccessCode == "FA")
                {
                    AmcBind();
                    BindCategory();
                    ShowAvailableLimits();
                    //lnkOfferDoc.Visible = false;
                    //lnkFactSheet.Visible = false;
                    //lnkExitLoad.Visible = false;
                    if (Request.QueryString["strAction"] != null && Request.QueryString["orderId"] != null && Request.QueryString["customerId"] != null)
                    {
                        strAction         = Request.QueryString["strAction"].ToString();
                        orderIdForEdit    = Convert.ToInt32(Request.QueryString["orderId"].ToString());
                        customerIdforEdit = Convert.ToInt32(Request.QueryString["customerId"].ToString());
                    }
                    else if (Request.QueryString["accountId"] != null && Request.QueryString["SchemeCode"] != null)
                    {
                        int    accountId      = 0;
                        int    schemeCode     = 0;
                        int    amcCode        = 0;
                        string category       = string.Empty;
                        int    isSIPAvaliable = 0;
                        accountId  = int.Parse(Request.QueryString["accountId"].ToString());
                        schemeCode = int.Parse(Request.QueryString["SchemeCode"].ToString());
                        commonLookupBo.GetSchemeAMCCategory(schemeCode, out amcCode, out category, out isSIPAvaliable, 1);
                        OnDrillDownBindControlValue(amcCode, category, accountId, schemeCode);
                        DataViewOnEdit();
                    }

                    btnSubmit.Text = "Submit";

                    if (strAction == "Edit")
                    {
                        BindSipDetailsForEdit();
                        DataViewOnEdit();
                        btnSubmit.Text         = "Modify";
                        onlineMFOrderVo.Action = "Edit";
                    }
                }
                else
                {
                    ShowMessage(boOnlineOrder.GetOnlineOrderUserMessage(clientMFAccessCode), 'I');
                    FreezeControls();
                    divControlContainer.Visible     = false;
                    divClientAccountBalance.Visible = false;
                }
            }
        }
예제 #24
0
        //protected void gvCustomerPortfolio_RowDataBound(object sender, GridViewRowEventArgs e)
        //{
        //    customerPortfolioList = portfolioBo.GetCustomerPortfolios(customerVo.CustomerId);

        //    DataTable dt = new DataTable();
        //    dt.Columns.Add("PortfolioId");
        //    dt.Columns.Add("lblPortfolioName");

        //    DataRowView drv = e.Row.DataItem as DataRowView;


        //    if (e.Row.RowType == DataControlRowType.DataRow)
        //    {

        //        DropDownList ddlType;

        //        ddlType = e.Row.FindControl("ddlType") as DropDownList;

        //        RadioButton rbtn;
        //        rbtn = e.Row.FindControl("rbtnPortfolio") as RadioButton;
        //        if (ddlType != null)
        //        {

        //            ddlType.DataSource = BindPortfolioType(path);
        //            ddlType.DataTextField = "PortfolioType";
        //            ddlType.DataValueField = "PortfolioTypeCode";
        //            ddlType.DataBind();
        //            customerPortfolioVo = new CustomerPortfolioVo();
        //            customerPortfolioVo = customerPortfolioList[gvCustomerPortfolio.Rows.Count];
        //            /*Bind the Selected Value to the Drop Down*/

        //            ddlType.SelectedValue = customerPortfolioVo.PortfolioTypeCode.ToString();

        //            if (customerPortfolioVo.IsMainPortfolio == 1)
        //            {



        //                rbtn.Checked = true;

        //            }
        //            else
        //            {
        //                rbtn.Checked = false;
        //            }
        //        }
        //    }
        //    if (e.Row.RowType == DataControlRowType.Footer)
        //    {
        //        DropDownList ddlAddType;

        //        ddlAddType = e.Row.FindControl("ddlAddType") as DropDownList;
        //        if (ddlAddType != null)
        //        {
        //            ddlAddType.DataSource = BindPortfolioType(path);
        //            ddlAddType.DataTextField = "PortfolioType";
        //            ddlAddType.DataValueField = "PortfolioTypeCode";
        //            ddlAddType.DataBind();
        //            ddlAddType.Items.Insert(0, "Select the Portfolio Type");
        //        }

        //    }
        //}

        //protected void gvCustomerPortfolio_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    int index = int.Parse(gvCustomerPortfolio.SelectedRow.RowIndex.ToString());
        //    int portfolioId = int.Parse(gvCustomerPortfolio.DataKeys[index].Value.ToString());
        //    Session[SessionContents.PortfolioId] = portfolioId;
        //    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioDashboard','none');", true);
        //}

        protected void btnAddPortfolio_Click(object sender, EventArgs e)
        {
            string newPortfolioName = string.Empty;
            string newPMSIdentifier = string.Empty;
            string newPortfolioType = "RGL";
            int    IsMainPortfolio;

            CustomerPortfolioBo customerPortfolioBo    = new CustomerPortfolioBo();
            CustomerPortfolioVo newCustomerPortfolioVo = new CustomerPortfolioVo();



            GridViewRow footerRow = gvCustomerPortfolio.FooterRow;

            DropDownList ddl = (DropDownList)footerRow.FindControl("ddlAddType");

            if (footerRow.Enabled)
            {
                if (((TextBox)footerRow.FindControl("txtPortfolioName")).Text.Trim() != "")
                {
                    newPortfolioName = ((TextBox)footerRow.FindControl("txtPortfolioName")).Text;
                }
                if (((RadioButton)footerRow.FindControl("rbtnAddMainPortfolio")).Checked)
                {
                    IsMainPortfolio = 1;
                    foreach (GridViewRow oldrow in gvCustomerPortfolio.Rows)
                    {
                        ((RadioButton)oldrow.FindControl("rbtnPortfolio")).Checked = false;
                    }
                }
                else
                {
                    IsMainPortfolio = 0;
                }
                if (((DropDownList)footerRow.FindControl("ddlAddType")).SelectedItem.Value.Trim().ToString() != "")
                {
                    if (ddl.SelectedIndex != 0)
                    {
                        newPortfolioType = ddl.SelectedItem.Value.ToString();
                    }
                }
                if (((TextBox)footerRow.FindControl("txtPMSIdentifier")).Text.Trim() != "")
                {
                    if (newPortfolioType == "PMS")
                    {
                        newPMSIdentifier = ((TextBox)footerRow.FindControl("txtPMSIdentifier")).Text;
                    }
                }

                if (newPMSIdentifier == "" && newPortfolioName == "" && ddl.SelectedIndex == 0)
                {
                }
                else
                {
                    newCustomerPortfolioVo.CustomerId        = customerVo.CustomerId;
                    newCustomerPortfolioVo.IsMainPortfolio   = IsMainPortfolio;
                    newCustomerPortfolioVo.PMSIdentifier     = newPMSIdentifier;
                    newCustomerPortfolioVo.PortfolioName     = newPortfolioName;
                    newCustomerPortfolioVo.PortfolioTypeCode = newPortfolioType;


                    portfolioBo.CreateCustomerPortfolio(newCustomerPortfolioVo, userVo.UserId);

                    newPMSIdentifier = string.Empty;
                    newPortfolioName = string.Empty;
                }
            }



            foreach (GridViewRow dr in gvCustomerPortfolio.Rows)
            {
                if (((Label)dr.FindControl("lblPortfolioName")).Text.Trim() != "")
                {
                    newPortfolioName = ((Label)dr.FindControl("lblPortfolioName")).Text;
                }
                if (((RadioButton)dr.FindControl("rbtnPortfolio")).Checked)
                {
                    IsMainPortfolio = 1;
                }
                else
                {
                    IsMainPortfolio = 0;
                }
                if (((DropDownList)dr.FindControl("ddlType")).SelectedItem.Value.Trim().ToString() != "")
                {
                    DropDownList ddlType = (DropDownList)dr.FindControl("ddlType");

                    newPortfolioType = ddlType.SelectedItem.Value.ToString();
                }
                if (((Label)dr.FindControl("lblPMSIdentifier")).Text.Trim() != "")
                {
                    if (newPortfolioType == "PMS")
                    {
                        newPMSIdentifier = ((Label)dr.FindControl("lblPMSIdentifier")).Text;
                    }
                }
                else
                {
                    newPMSIdentifier = string.Empty;
                }

                newCustomerPortfolioVo.CustomerId        = customerVo.CustomerId;
                newCustomerPortfolioVo.IsMainPortfolio   = IsMainPortfolio;
                newCustomerPortfolioVo.PMSIdentifier     = newPMSIdentifier;
                newCustomerPortfolioVo.PortfolioName     = newPortfolioName;
                newCustomerPortfolioVo.PortfolioTypeCode = newPortfolioType;
                if (((Label)dr.FindControl("PortfolioId")).Text.Trim() != "")
                {
                    newCustomerPortfolioVo.PortfolioId = int.Parse(((Label)dr.FindControl("PortfolioId")).Text);
                }

                portfolioBo.UpdateCustomerPortfolio(newCustomerPortfolioVo, userVo.UserId);
                newPortfolioName = string.Empty;
                newPMSIdentifier = string.Empty;
            }

            customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId);
            Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
            // BindGrid

            BindGridView();
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            PortfolioBo         portfolioBo = new PortfolioBo();
            int                 isBankAssociatedWithOtherTransactions = 0;
            String              statusMsg        = string.Empty;
            int                 totalFoliosMoved = 0;
            CustomerPortfolioVo portfolioVo      = new CustomerPortfolioVo();

            if (txtCustomerId.Value != string.Empty)
            {
                string portfolio = ddlAdvisorBranchList.SelectedValue;
                portfolioVo = portfolioBo.GetCustomerDefaultPortfolio1((Convert.ToInt32(txtCustomerId.Value)), portfolio);
                if (portfolioVo.PortfolioId < 1)
                {
                    lblMessage.Text = "No default Portfolio found for the selected customer.";
                    //trErrorMsg.Visible = true;
                    tblTransferFolio.Visible = false;
                    tblMoveFolio.Visible     = false;
                    return;
                }
            }
            else
            {
                lblMessage.Text = "Please select a customer.";
                //trErrorMsg.Visible = true;
                tblTransferFolio.Visible = false;
                tblMoveFolio.Visible     = false;
                return;
            }


            foreach (GridDataItem dr in gvMFFolio.Items)
            {
                CheckBox checkBox = (CheckBox)dr.FindControl("chkBox");
                if (checkBox.Checked)
                {
                    int  MFAccountId = Convert.ToInt32(gvMFFolio.MasterTableView.Items[dr.ItemIndex].GetDataKeyValue("FolioId").ToString());
                    bool isUpdated   = PortfolioBo.TransferFolio(MFAccountId, portfolioVo.PortfolioId, isBankAssociatedWithOtherTransactions);
                    if (isUpdated)
                    {
                        totalFoliosMoved++;
                    }
                    else
                    {
                        //statusMsgFailure.InnerText = statusMsg;
                        //statusMsg += "Error occurred while moving folio with mutual fund accountId " + MFAccountId;
                        //trFailure.Visible = true;
                        //statusMsgSuccess.Visible = false;
                        //statusMsgFailure.Visible = true;

                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Cannot transfer this folio the bank is associate with some other transactions');", true);
                    }
                    //lblstatusMsgFailure.Visible = true;
                }
            }
            if (totalFoliosMoved > 0)
            {
                statusMsg += "Total Folios moved = " + totalFoliosMoved;
                statusMsgSuccess.InnerText = statusMsg;
                trFailure.Visible          = true;
                statusMsgSuccess.Visible   = true;
                statusMsgFailure.Visible   = false;

                //    lblstatusMsgSuccess.Text += "<br/>Total Folios moved = " + totalFoliosMoved + ".<br/>";
                //lblstatusMsgSuccess.Visible = true;
                //lblMessage.Text = statusMsg;
                //lblMessage.Visible = true;
                //lblTransferMsg.Text = statusMsg;
                //divMessage.Attributes.Add("class", "yellow-box");
                //if (trTransferMsg.Visible == false)


                //    trTransferMsg.Visible = true;
            }
            BindFolioGridView();
        }