protected void gvCustomers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int userId     = 0;
            int customerId = 0;

            customerId = Convert.ToInt32(e.CommandArgument);
            UserVo userVo = (UserVo)Session["userVo"];

            userId = userVo.UserId;
            CustomerAccountsVo customerAccountsVo = new CustomerAccountsVo();
            CustomerAccountBo  customerBo         = new CustomerAccountBo();
            GridView           gv = (GridView)sender;

            RejectedTransactionsBo rejectedTransactionsBo = new RejectedTransactionsBo();
            bool isSucess = rejectedTransactionsBo.MapEquityToCustomer(transactionStagingId, customerId, userId);

            if (isSucess)
            {
                gvCustomers.Visible = false;
                lblMessage.Visible  = true;
                lblMessage.Text     = "Customer is mapped";
                lblMessage.CssClass = "SuccessMsg";
                tblSearch.Visible   = false;
            }
            else
            {
                lblMessage.Visible = true;
                lblMessage.Text    = "An error occurred while mapping.";
            }
        }
        protected void ddlAssetIC_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataSet           dsAccounts = new DataSet();
            CustomerAccountBo custAccBo  = new CustomerAccountBo();

            try
            {
                dsAccounts = custAccBo.GetCustomerCashSavingsAccounts(customerVo.CustomerId, assetGroupCode, ddlAssetIC.SelectedValue);
                if (dsAccounts.Tables[0].Rows.Count > 0)
                {
                    ddlAccountID.DataSource     = dsAccounts.Tables[0];
                    ddlAccountID.DataTextField  = "CCSA_AccountNum";
                    ddlAccountID.DataValueField = "CCSA_AccountId";
                    ddlAccountID.DataBind();
                    ddlAccountID.Items.Insert(0, "Select an Account");
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioCashSavingsEdit.ascx:ddlAssetIC_SelectedIndexChanged()");
                object[] objects = new object[2];
                objects[0]   = customerVo;
                objects[1]   = assetGroupCode;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void BindCustomerTradeAccount()
        {
            if (txtParentCustomerId.Value != string.Empty)
            {
                CustomerAccountBo customerAccountBo = new CustomerAccountBo();

                DataTable dtTradeAccountNumbers = customerAccountBo.GetTradeAccountNumbersByCustomer(int.Parse(txtParentCustomerId.Value));
                ddlTradeAccountNos.DataTextField  = dtTradeAccountNumbers.Columns[1].ToString();
                ddlTradeAccountNos.DataValueField = dtTradeAccountNumbers.Columns[0].ToString();
                ddlTradeAccountNos.DataSource     = dtTradeAccountNumbers;
                ddlTradeAccountNos.DataBind();

                ddlTradeAccountNos.Items.Insert(0, new ListItem("select", "-1"));
            }
        }
Exemplo n.º 4
0
        protected void gvCustomers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int  i;
            int  userId     = 0;
            int  customerId = 0;
            bool isSucess   = true;

            customerId = Convert.ToInt32(e.CommandArgument);
            UserVo userVo = (UserVo)Session["userVo"];

            userId = userVo.UserId;
            CustomerAccountsVo     customerAccountsVo = new CustomerAccountsVo();
            CustomerAccountBo      customerBo         = new CustomerAccountBo();
            GridView               gv = (GridView)sender;
            RejectedTransactionsBo rejectedTransactionsBo = new RejectedTransactionsBo();

            string transactionId = Convert.ToString(Request.Params["id"]);

            string[] testArray = transactionId.Split('~');

            for (i = 0; i < testArray.Length; i++)
            {
                transactionStagingId = int.Parse(testArray[i]);
                isSucess             = rejectedTransactionsBo.MapEquityToCustomer(transactionStagingId, customerId, userId);
            }


            if (isSucess)
            {
                gvCustomers.Visible = false;
                lblMessage.Visible  = true;
                lblMessage.Text     = "Customer is mapped";
                lblMessage.CssClass = "SuccessMsg";
                tblSearch.Visible   = false;
            }
            else
            {
                lblMessage.Visible = true;
                lblMessage.Text    = "An error occurred while mapping.";
            }
        }
Exemplo n.º 5
0
        protected void gvCustomers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int userId     = 0;
            int customerId = 0;

            customerId = Convert.ToInt32(e.CommandArgument);
            UserVo userVo = (UserVo)Session["userVo"];

            userId = userVo.UserId;
            bool insertioncomplete = true;
            CustomerAccountsVo customerAccountsVo = new CustomerAccountsVo();
            CustomerAccountBo  customerBo         = new CustomerAccountBo();
            GridView           gv = (GridView)sender;

            RejectedTransactionsBo rejectedTransactionsBo = new RejectedTransactionsBo();

            try
            {
                insertioncomplete = MapfoliotoCustomer(customerId);
            }
            catch (Exception ex)
            {
                insertioncomplete = false;
            }

            if (insertioncomplete)
            {
                gvCustomers.Visible = false;
                lblMessage.Visible  = true;
                lblMessage.Text     = "Customer is mapped";
                lblMessage.CssClass = "SuccessMsg";
                tblSearch.Visible   = false;
                reprocess();
            }
            else
            {
                lblMessage.Visible = true;
                lblMessage.Text    = "An error occurred while mapping.";
            }
        }
        protected void gvCustomers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int i;
            int userId     = 0;
            int customerId = 0;

            string[] testArrayFolio      = new string[0];
            string[] testArray           = new string[0];
            string[] testArraySIPFolio   = new string[0];
            string[] testArrayTrailFolio = new string[0];

            customerId = Convert.ToInt32(e.CommandArgument);
            UserVo userVo = (UserVo)Session["userVo"];

            userId = userVo.UserId;
            bool insertioncomplete = true;
            CustomerAccountsVo customerAccountsVo = new CustomerAccountsVo();
            CustomerAccountBo  customerBo         = new CustomerAccountBo();
            GridView           gv = (GridView)sender;
            //string transactionId = Convert.ToString(Request.Params["id"]);
            //string folioId = Convert.ToString(Request.Params["Folioid"]);
            //string[] testArrayFolio = folioId.Split('~');
            //string[] testArray = transactionId.Split('~');
            string folioId = Convert.ToString(Request.Params["Folioid"]);

            if (folioId != null)
            {
                testArrayFolio = folioId.Split('~');
            }
            string transactionId = Convert.ToString(Request.Params["id"]);

            if (transactionId != null)
            {
                testArray = transactionId.Split('~');
            }
            string SIPFolioid = Convert.ToString(Request.Params["SIPFolioid"]);

            if (SIPFolioid != null)
            {
                testArraySIPFolio = SIPFolioid.Split('~');
            }
            string TrailFolioid = Convert.ToString(Request.Params["TrailFolioid"]);

            if (TrailFolioid != null)
            {
                testArrayTrailFolio = TrailFolioid.Split('~');
            }

            RejectedTransactionsBo rejectedTransactionsBo = new RejectedTransactionsBo();

            try
            {
                if (transactionId != null)
                {
                    for (i = 0; i < testArray.Length; i++)
                    {
                        MFTransactionStagingId = int.Parse(testArray[i]);
                        insertioncomplete      = rejectedTransactionsBo.MapFolioToCustomer(MFTransactionStagingId, customerId, userId);
                    }
                }
                if (SIPFolioid != null)
                {
                    for (i = 0; i < testArraySIPFolio.Length; i++)
                    {
                        MFSIPFolioStagingId = int.Parse(testArraySIPFolio[i]);
                        insertioncomplete   = rejectedTransactionsBo.MapRejectedSIPFoliosToCustomer(MFSIPFolioStagingId, customerId, userId);
                    }
                }
                if (folioId != null)
                {
                    for (i = 0; i < testArrayFolio.Length; i++)
                    {
                        MFFolioStagingId  = int.Parse(testArrayFolio[i]);
                        insertioncomplete = rejectedTransactionsBo.MapRejectedFoliosToCustomer(MFFolioStagingId, customerId, userId);
                    }
                }
                if (TrailFolioid != null)
                {
                    for (i = 0; i < testArrayTrailFolio.Length; i++)
                    {
                        MFTrailFolioStagingid = int.Parse(testArrayTrailFolio[i]);
                        insertioncomplete     = rejectedTransactionsBo.MapRejectedTrailFoliosToCustomer(MFTrailFolioStagingid, customerId, userId);
                    }
                }
            }
            catch (Exception ex)
            {
                insertioncomplete = false;
            }

            if (insertioncomplete)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "mykey", "ClosePopUp();", true);
                divMapToCustomer.Visible = false;
                lblMessage.Visible       = true;
                lblMessage.Text          = "Customer is mapped";
                lblMessage.CssClass      = "SuccessMsg";
                tblSearch.Visible        = false;
                //reprocess();
            }
            else
            {
                lblMessage.Visible = true;
                lblMessage.Text    = "An error occurred while mapping.";
            }
        }
        private void BindDetails()
        {
            // Get the Portfolio ID from Session'
            try
            {
                customerVo = (CustomerVo)Session["CustomerVo"];
                customerId = customerVo.CustomerId;

                CashSavingsVo = new CashAndSavingsVo();
                int CashSavingsPortfolioId = Int32.Parse(Session["CashSavingsPortfolioId"].ToString());

                CashSavingsVo = CashSavingsBo.GetSpecificCashSavings(CashSavingsPortfolioId, customerId);

                if (CashSavingsVo != null)
                {
                    ddlAssetIC.SelectedValue = CashSavingsVo.AssetInstrumentCategoryCode.ToString(); //.Trim()


                    DataSet           dsAccounts = new DataSet();
                    CustomerAccountBo custAccBo  = new CustomerAccountBo();

                    dsAccounts = custAccBo.GetCustomerCashSavingsAccounts(customerVo.CustomerId, assetGroupCode, ddlAssetIC.SelectedValue);

                    if (dsAccounts.Tables[0].Rows.Count > 0)
                    {
                        ddlAccountID.DataSource     = dsAccounts.Tables[0];
                        ddlAccountID.DataTextField  = "CCSA_AccountNum";
                        ddlAccountID.DataValueField = "CCSA_AccountId";
                        ddlAccountID.DataBind();
                        ddlAccountID.Items.Insert(0, "Select an Account");
                    }

                    ddlAccountID.SelectedValue = CashSavingsVo.AccountId.ToString(); // .Trim()
                    txtName.Text                   = CashSavingsVo.Name.ToString().Trim();
                    txtDepositAmount.Text          = CashSavingsVo.DepositAmount.ToString().Trim();
                    txtDepositDate.Text            = CashSavingsVo.DepositDate.ToShortDateString().Trim();
                    txtCurrentValue.Text           = CashSavingsVo.CurrentValue.ToString().Trim();
                    txtInterestRate.Text           = CashSavingsVo.InterestRate.ToString().Trim();
                    ddlDebtIssuer.SelectedValue    = CashSavingsVo.DebtIssuerCode.ToString().Trim();    //
                    ddlInterestBasis.SelectedValue = CashSavingsVo.InterestBasisCode.ToString().Trim(); //

                    if (CashSavingsVo.InterestBasisCode.Trim() == "CI")
                    {
                        trCIFrequency.Visible        = true;
                        ddlCIFrequency.SelectedValue = CashSavingsVo.CompoundInterestFrequencyCode.ToString().Trim();
                    }
                    else
                    {
                        trCIFrequency.Visible = false;
                    }

                    if (CashSavingsVo.IsInterestAccumalated == 0)
                    {
                        rbtnInterestAccumYes.Checked = false;
                        rbtnInterestAccumNo.Checked  = true;
                        trIA.Visible          = false;
                        trIP.Visible          = true;
                        trIPFrequency.Visible = true;

                        txtInterestAmtPaidOut.Text   = CashSavingsVo.InterestAmntPaidOut.ToString().Trim();
                        ddlIPFrequency.SelectedValue = CashSavingsVo.InterestPayoutFrequencyCode.ToString().Trim();
                    }
                    else if (CashSavingsVo.IsInterestAccumalated == 1)
                    {
                        rbtnInterestAccumYes.Checked = true;
                        rbtnInterestAccumNo.Checked  = false;
                        trIA.Visible          = true;
                        trIP.Visible          = false;
                        trIPFrequency.Visible = false;

                        txtInterestAmtAccumulated.Text = CashSavingsVo.InterestAmntAccumulated.ToString().Trim();
                    }
                    else
                    {
                        trIA.Visible          = false;
                        trIP.Visible          = false;
                        trIPFrequency.Visible = false;
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioCashSavingsEdit.ascx.cs:BindDetails()");
                object[] objects = new object[3];
                objects[0]   = CashSavingsVo;
                objects[1]   = customerVo;
                objects[2]   = customerId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }