protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         DropDownList ddlAction   = (DropDownList)sender;
         GridViewRow  gvr         = (GridViewRow)ddlAction.NamingContainer;
         int          selectedRow = gvr.RowIndex;
         EQAccountId = int.Parse(gvEQAcc.DataKeys[selectedRow].Value.ToString());
         Session["EQAccountVoRow"] = CustomerTransactionBo.GetCustomerEQAccountDetails(EQAccountId, portfolioId);
         if (ddlAction.SelectedValue.ToString() == "Edit")
         {
             Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountAdd','action=Edit');", true);
         }
         if (ddlAction.SelectedValue.ToString() == "View")
         {
             Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountAdd','action=View');", true);
         }
     }
     catch (Exception Ex)
     {
         BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
         NameValueCollection      FunctionInfo = new NameValueCollection();
         FunctionInfo.Add("Method", "CustomerMFFolioView.ascx:ddlAction_OnSelectedIndexChange()");
         object[] objects = new object[1];
         objects[0]   = FolioId;
         FunctionInfo = exBase.AddObject(FunctionInfo, objects);
         exBase.AdditionalInformation = FunctionInfo;
         ExceptionManager.Publish(exBase);
         throw exBase;
     }
 }
        public void SetBrokerage()
        {
            if (txtRate.Text != "" && txtBroker.Text != "")
            {
                double brokerage, otherCharges;

                CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                CustomerAccountsVo    customerAccountsVo    = new CustomerAccountsVo();
                customerAccountsVo = customerTransactionBo.GetCustomerEQAccountDetails(int.Parse(ddlTradeAcc.SelectedItem.Value.ToString()), portfolioId);
                // Stax= Service Tax
                if (eqTransactionVo.IsSpeculative != 1)
                {
                    brokerage = double.Parse(txtRate.Text) * (customerAccountsVo.BrokerageDeliveryPercentage / 100);
                }
                else
                {
                    brokerage = double.Parse(txtRate.Text) * (customerAccountsVo.BrokerageSpeculativePercentage / 100);
                }
                otherCharges      = double.Parse(txtRate.Text) * (customerAccountsVo.OtherCharges / 100);
                txtBrokerage.Text = Math.Round(brokerage, 4).ToString();

                txtOtherCharge.Text = Math.Round(otherCharges, 4).ToString();

                Calculate();
            }
        }
        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";
            }
        }
Exemple #4
0
        public void SetBrokerage()
        {
            if (txtRate.Text != "" && txtBroker.Text != "")
            {
                double brokerage, otherCharges;

                CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                CustomerAccountsVo    customerAccountsVo    = new CustomerAccountsVo();

                customerAccountsVo = customerTransactionBo.GetCustomerEQAccountDetails(int.Parse(ddlTradeAcc.SelectedItem.Value.ToString()), portfolioId);
                // Stax= Service Tax
                //if (txtBrokerage.Text == "")
                //{
                if (rbtnDelivery.Checked)
                {
                    brokerage         = double.Parse(txtRate.Text) * (customerAccountsVo.BrokerageDeliveryPercentage / 100);
                    txtBrokerage.Text = Math.Round(brokerage, 4).ToString();
                }
                else
                {
                    brokerage         = double.Parse(txtRate.Text) * (customerAccountsVo.BrokerageSpeculativePercentage / 100);
                    txtBrokerage.Text = Math.Round(brokerage, 4).ToString();
                }
                //}

                //if (txtOtherCharge.Text == "")
                //{
                otherCharges = double.Parse(txtRate.Text) * (customerAccountsVo.OtherCharges / 100);
                if (txtOtherCharge.Text == "")
                {
                    txtOtherCharge.Text = "0";
                }
                if (otherCharges != 0)
                {
                    txtOtherCharge.Text = Math.Round(otherCharges, 4).ToString();
                }
                else
                {
                    txtOtherCharge.Text = (double.Parse(txtRate.Text) * double.Parse(txtOtherCharge.Text) / 100).ToString();
                }
                //}

                Calculate();
            }
        }
        protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                //DropDownList ddlAction = (DropDownList)sender;
                //GridViewRow gvr = (GridViewRow)ddlAction.NamingContainer;
                //int selectedRow = gvr.RowIndex;

                RadComboBox  ddlAction   = (RadComboBox)sender;
                GridDataItem gvr         = (GridDataItem)ddlAction.NamingContainer;
                int          selectedRow = gvr.ItemIndex + 1;

                EQAccountId               = int.Parse(gvEQAcc.MasterTableView.DataKeyValues[selectedRow - 1]["AccountId"].ToString());
                Session["AccountId"]      = EQAccountId;
                Session["EQAccountVoRow"] = CustomerTransactionBo.GetCustomerEQAccountDetails(EQAccountId, portfolioId);
                if (ddlAction.SelectedValue.ToString() == "Edit")
                {
                    if (hdnIsCustomerLogin.Value == "Customer" && hdnIsMainPortfolio.Value == "1")
                    {
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Permisssion denied for Manage Portfolio !!');", true);
                    }
                    else
                    {
                        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountAdd','action=Edit');", true);
                    }
                }
                if (ddlAction.SelectedValue.ToString() == "View")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountAdd','action=View');", true);
                }
                if (ddlAction.SelectedValue.ToString() == "Delete")
                {
                    if (hdnIsCustomerLogin.Value == "Customer" && hdnIsMainPortfolio.Value == "1")
                    {
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Permisssion denied for Manage Portfolio !!');", true);
                    }
                    else
                    {
                        bool CheckTradeAccAssociationWithTransactions;
                        CheckTradeAccAssociationWithTransactions = CustomerTransactionBo.CheckEQTradeAccNoAssociatedWithTransactions(EQAccountId);

                        if (CheckTradeAccAssociationWithTransactions == true)
                        {
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Trade Account can not be deleted as some Transactions are Associated with this Trade Account Number.');", true);
                        }
                        else if (CheckTradeAccAssociationWithTransactions == false)
                        {
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "ShowAlertToDelete();", true);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerMFFolioView.ascx:ddlAction_OnSelectedIndexChange()");
                object[] objects = new object[1];
                objects[0]   = FolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }