protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                btnSubmit.Enabled                     = false;
                customerAccountsVo.CustomerId         = customerVo.CustomerId;
                customerAccountsVo.PortfolioId        = int.Parse(ddlPortfolio.SelectedValue.ToString());
                customerAccountsVo.TradeNum           = txtTradeNum.Text.ToString();
                customerAccountsVo.BrokerCode         = ddlBrokerCode.SelectedItem.Value.ToString();
                customerAccountsVo.AccountOpeningDate = DateTime.Parse(txtAccountStartingDate.Text);// ddlDay.SelectedItem.Text.ToString() + "/" + ddlMonth.SelectedItem.Value.ToString() + "/" + ddlYear.SelectedItem.Value.ToString()
                if (txtBrokeragePerDelivery.Text != "" && txtBrokeragePerSpeculative.Text != "" && txtOtherCharges.Text != "")
                {
                    customerAccountsVo.BrokerageDeliveryPercentage    = double.Parse(txtBrokeragePerDelivery.Text);
                    customerAccountsVo.BrokerageSpeculativePercentage = double.Parse(txtBrokeragePerSpeculative.Text);
                    customerAccountsVo.OtherCharges = double.Parse(txtOtherCharges.Text);
                }
                else
                {
                    customerAccountsVo.BrokerageDeliveryPercentage    = 0.0;
                    customerAccountsVo.BrokerageSpeculativePercentage = 0.0;
                    customerAccountsVo.OtherCharges = 0.0;
                }
                tradeAccountId = customerAccountBo.CreateCustomerEQAccount(customerAccountsVo, userVo.UserId);

                //if (rbtnYes.Checked)
                //{
                //foreach (GridViewRow gvr in this.gvDPAccounts.Rows)
                //{
                //    if (((CheckBox)gvr.FindControl("chkId")).Checked == true)
                //    {

                //        dpAccountId = int.Parse(gvDPAccounts.DataKeys[gvr.RowIndex].Value.ToString());
                //        customerAccountBo.CreateEQTradeDPAssociation(tradeAccountId, dpAccountId, isDefault, userVo.UserId);
                //    }
                //}
                //}
                if (Request.QueryString["prevPage"] != null && Request.QueryString["prevPage"] == "MultipleEqEntry")
                {
                    string queryString = "?prevPage=TradeAccAdd";
                    // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('RMMultipleEqTransactionsEntry','" + queryString + "');", true);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('RMMultipleEqTransactionsEntry','" + queryString + "');", true);
                }
                else if (Request.QueryString["prevPage"] != null && Request.QueryString["prevPage"] == "EquityManualSingleTransaction")
                {
                    string queryString = "?prevPage=TradeAccAdd";
                    //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('EquityManualSingleTransaction','" + queryString + "');", true);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('EquityManualSingleTransaction','" + queryString + "');", true);
                }
                else
                {
                    //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountView','none');", true);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountView','none');", true);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerEQAccountAdd.ascx:btnSubmit_Click()");
                object[] objects = new object[6];
                objects[0]   = customerAccountsVo;
                objects[1]   = portfolioId;
                objects[2]   = tradeAccountId;
                objects[3]   = dpAccountId;
                objects[4]   = isDefault;
                objects[5]   = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
예제 #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string accountopeningdate = txtAccountStartingDate.Text;

            try
            {
                btnSubmit.Enabled              = false;
                customerAccountsVo.CustomerId  = customerVo.CustomerId;
                customerAccountsVo.PortfolioId = int.Parse(ddlPortfolio.SelectedValue.ToString());
                customerAccountsVo.TradeNum    = txtTradeNum.Text.ToString();
                customerAccountsVo.BrokerCode  = ddlBrokerCode.SelectedItem.Value.ToString();
                if (!string.IsNullOrEmpty(accountopeningdate.Trim()))
                {
                    customerAccountsVo.AccountOpeningDate = DateTime.Parse(accountopeningdate);// ddlDay.SelectedItem.Text.ToString() + "/" + ddlMonth.SelectedItem.Value.ToString() + "/" + ddlYear.SelectedItem.Value.ToString()
                }
                //if (txtBrokeragePerDelivery.Text == "")
                //    txtBrokeragePerDelivery.Text = "0";
                //if (txtBrokeragePerSpeculative.Text == "")
                //    txtBrokeragePerSpeculative.Text = "0";
                //if (txtOtherCharges.Text == "")
                //    txtOtherCharges.Text = "0";

                if (ddlBankList.SelectedIndex != 0)
                {
                    customerAccountsVo.BankNameInExtFile = ddlBankList.SelectedValue;
                }
                if (ddlAccountNum.SelectedIndex != 0)
                {
                    customerAccountsVo.BankId = int.Parse(ddlAccountNum.SelectedValue);
                }
                //customerAccountsVo.BankName = ddlBankList.SelectedValue.ToString();
                //customerAccountsVo.BankAccountNum = account;
                //if (Txt_SEBITrnfee.Text != "")
                //{
                //    customerAccountsVo.SebiTurnOverFee = double.Parse(Txt_SEBITrnfee.Text);
                //}
                //else
                //{
                //    customerAccountsVo.SebiTurnOverFee = 0.0;
                //}
                //if (Txt_Transcharges.Text != "")
                //{
                //    customerAccountsVo.TransactionCharges = double.Parse(Txt_Transcharges.Text);
                //}
                //else
                //{
                //    customerAccountsVo.TransactionCharges = 0.0;
                //}
                //if (Txt_stampcharges.Text != "")
                //{
                //    customerAccountsVo.StampCharges = double.Parse(Txt_stampcharges.Text);
                //}
                //else
                //{
                //    customerAccountsVo.StampCharges = 0.0;
                //}
                //if (Txt_STT.Text != "")
                //{
                //    customerAccountsVo.Stt = double.Parse(Txt_STT.Text);
                //}
                //else
                //{
                //    customerAccountsVo.Stt = 0.0;
                //}
                //if (Txt_ServiceTax.Text != "")
                //{
                //    customerAccountsVo.ServiceTax = double.Parse(Txt_ServiceTax.Text);
                //}
                //else
                //{
                //    customerAccountsVo.ServiceTax = 0.0;
                //}


                //if (txtBrokeragePerDelivery.Text != "" || txtBrokeragePerSpeculative.Text != "")
                //{

                //    customerAccountsVo.BrokerageDeliveryPercentage = double.Parse(txtBrokeragePerDelivery.Text);
                //    customerAccountsVo.BrokerageSpeculativePercentage = double.Parse(txtBrokeragePerSpeculative.Text);
                //    //customerAccountsVo.OtherCharges = double.Parse(txtOtherCharges.Text);
                //}
                //else
                //{
                //    customerAccountsVo.BrokerageDeliveryPercentage = 0.0;
                //    customerAccountsVo.BrokerageSpeculativePercentage = 0.0;
                //    customerAccountsVo.OtherCharges = 0.0;

                //}

                tradeAccountId = customerAccountBo.CreateCustomerEQAccount(customerAccountsVo, userVo.UserId);
                //Txt_ServiceTax.Text = string.Empty;


                //if (rbtnYes.Checked)
                //{
                //foreach (GridViewRow gvr in this.gvDPAccounts.Rows)
                //{
                //    if (((CheckBox)gvr.FindControl("chkId")).Checked == true)
                //    {

                //        dpAccountId = int.Parse(gvDPAccounts.DataKeys[gvr.RowIndex].Value.ToString());
                //        customerAccountBo.CreateEQTradeDPAssociation(tradeAccountId, dpAccountId, isDefault, userVo.UserId);
                //    }
                //}
                //}
                //DataSet TradeNum;
                //TradeNum = checkAccBo.CheckTradeNoAvailability(Id);

                //if (!CheckEQAccDetails(TradeNum))
                //{
                if (Request.QueryString["prevPage"] != null && Request.QueryString["prevPage"] == "MultipleEqEntry")
                {
                    string queryString = "?prevPage=TradeAccAdd";
                    // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('RMMultipleEqTransactionsEntry','" + queryString + "');", true);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('RMMultipleEqTransactionsEntry','" + queryString + "');", true);
                }
                else if (Request.QueryString["prevPage"] != null && Request.QueryString["prevPage"] == "EquityManualSingleTransaction")
                {
                    string queryString = "?prevPage=TradeAccAdd";
                    //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('EquityManualSingleTransaction','" + queryString + "');", true);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('EquityManualSingleTransaction','" + queryString + "');", true);
                }

                else if (Request.QueryString["Equitypopup"] == "1" && Request.QueryString["Equitypopup"] != null)
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Message", "alert('Trade Account Added Successfully');", true);
                }

                else
                {
                    //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountView','none');", true);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountView','none');", true);
                }
                //}
                //else
                //{
                //    Sample.Text = "Fail";
                //}
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerEQAccountAdd.ascx:btnSubmit_Click()");
                object[] objects = new object[6];
                objects[0]   = customerAccountsVo;
                objects[1]   = portfolioId;
                objects[2]   = tradeAccountId;
                objects[3]   = dpAccountId;
                objects[4]   = isDefault;
                objects[5]   = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }