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";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();

            if (!string.IsNullOrEmpty(Session["advisorVo"].ToString()))
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
            }
            if (Request.Form["ctrl_EquityReports$btnView"] != "View Report")
            {
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                rmVo = (RMVo)Session[SessionContents.RmVo];

                BindPeriodDropDown();
                txtCustomer_autoCompleteExtender.ContextKey       = advisorVo.advisorId.ToString();
                txtParentCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString();
                if (!IsPostBack)
                {
                    CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                    DataSet ds = customerTransactionBo.GetLastTradeDate();
                    if (ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["WTD_Date"] != null)
                    {
                        txtAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                    }
                }

                if (IsPostBack && !string.IsNullOrEmpty(Request.Form["ctrl_EquityReports$hidTabIndex"]))
                {
                    activeTabIndex = Convert.ToInt32(Request.Form["ctrl_EquityReports$hidTabIndex"]);
                }
            }
        }
        protected void btnCancel_Click(object sender, EventArgs e)
        {
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
            int userId = ((UserVo)Session["userVo"]).UserId;

            try
            {
                if (mfTransactionVo != null)
                {
                    customerTransactionBo.CancelMFTransaction(mfTransactionVo, userId);
                }
                btnCancel.Visible = false;
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('TransactionsView','none');", true);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewMFTransaction.ascx:btnCancel_Click(object sender, EventArgs e)");
                object[] objects = new object[1];
                objects[0]   = mfTransactionVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void btnMap_Click(object sender, EventArgs e)
        {
            int  MfTransId       = 0;
            int  OriginalTransId = 0;
            bool bResult         = false;
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();

            foreach (GridViewRow row in gvRejectedTransactions.Rows)
            {
                if (((RadioButton)row.FindControl("rdRejectId")).Checked)
                {
                    MfTransId = int.Parse(gvRejectedTransactions.DataKeys[row.RowIndex].Value.ToString());
                    break;
                }
            }
            foreach (GridViewRow row in gvOriginalTransactions.Rows)
            {
                if (((RadioButton)row.FindControl("rdOriginalId")).Checked)
                {
                    OriginalTransId = int.Parse(gvOriginalTransactions.DataKeys[row.RowIndex].Value.ToString());
                    break;
                }
            }
            bResult = customerTransactionBo.UpdateRejectedTransactionStatus(MfTransId, OriginalTransId);

            if (bResult)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Transactions Updated Succesfully');", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Transactions Not Updated');", true);
            }
            ShowTransactions();
        }
Exemple #5
0
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
            string HiddenVal     = hdnStatusValue.Value;
            int    transactionId = 0;

            if (Session["TransactionId"] != null)
            {
                transactionId = int.Parse(Session["TransactionId"].ToString());
            }
            if (HiddenVal == "1")
            {
                if (hddeletiontype.Value == "Bulk")
                {
                    string transid = Session["TransId"].ToString();
                    customerTransactionBo.BulkEqTransactionDeletion(transid);

                    ddlAction.SelectedIndex = 0;
                }
                else
                {
                    customerTransactionBo.DeleteEquityTransaction(transactionId);
                }
            }
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('EquityTransactionsView','none');", true);
        }
        public override JobStatus Start(JobParams JP, out string ErrorMsg)
        {
            ErrorMsg = "";
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();

            try
            {
                customerTransactionBo.RunMFTRansactionsCancellationJob();
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "DailyValuation.ascx.cs:CreateAdviserEODLog()");
                object[] objects = new object[1];

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

            return(JobStatus.SuccessFull);
        }
        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();
            }
        }
Exemple #8
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();

            try
            {
                if (mfTransactionVo != null)
                {
                    if (mfTransactionVo.TransactionStatusCode == 1)
                    {
                        //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Message", "confirm('Are you sure you want to delete transaction?');", true);
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "showmessage('1');", true);
                    }
                    else if (mfTransactionVo.TransactionStatusCode == 2)
                    {
                        if (!string.IsNullOrEmpty(mfTransactionVo.OriginalTransactionNumber))
                        {
                            //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Message", "confirm('Origional transaction not found.Please make sure if origional already deleted.Want to delete Cancel alone?');", true);
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "showmessage('2');", true);
                        }
                        else
                        {
                            //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Message", "confirm('Origional transaction will autometically deleted on deleting cancel.Want to delete?');", true);
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "showmessage('1');", true);
                        }
                    }
                    else if (mfTransactionVo.TransactionStatusCode == 3)
                    {
                        //Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "showmessage('2');", true);
                        if (!string.IsNullOrEmpty(mfTransactionVo.OriginalTransactionNumber))
                        {
                            //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Message", "confirm('Origional transaction not found.Please make sure if origional already deleted.Want to delete Cancel alone?');", true);
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "showmessage('2');", true);
                        }
                        else
                        {
                            //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Message", "confirm('Origional transaction will autometically deleted on deleting cancel.Want to delete?');", true);
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "showmessage('1');", true);
                        }
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewMFTransaction.ascx:btnDelete_Click(object sender, EventArgs e)");
                object[] objects = new object[1];
                objects[0]   = mfTransactionVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Exemple #9
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 btnCancel_Click(object sender, EventArgs e)
        {
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
            int userId = ((UserVo)Session["userVo"]).UserId;

            try
            {
                if (eqTransactionVo != null)
                {
                    customerTransactionBo.CancelEquityTransaction(eqTransactionVo, userId);
                }
                btnCancel.Visible = false;
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('EquityTransactionsView','none');", true);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
        }
Exemple #11
0
        private void SetSystematicTransactions()
        {
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();

            mfSystematicTransactionReportVoList = new List <MFSystematicTransactionReportVo>();
            List <string> transactionTypeList = new List <string>();
            DateTime      fromDate            = new DateTime();
            DateTime      toDate             = new DateTime();
            DateBo        dateBo             = new DateBo();
            string        customerNameSearch = "";
            string        schemeNameSearch   = "";
            string        transType          = "";
            string        portfolioType      = "";
            string        viewType           = "";

            systematicTotalAmount = 0;
            originalAmountTotal   = 0;
            portfolioType         = ddlGroupPortfolioGroup.SelectedValue.ToString();
            viewType = ddlViewType.SelectedValue.ToString();
            if (gvSystematicTransactions.HeaderRow != null)
            {
                customerNameSearch = ((TextBox)gvSystematicTransactions.HeaderRow.FindControl("txtCustomerSearch")).Text;
                schemeNameSearch   = ((TextBox)gvSystematicTransactions.HeaderRow.FindControl("txtSchemeSearch")).Text;
                transType          = ((DropDownList)gvSystematicTransactions.HeaderRow.FindControl("ddlTranType")).SelectedValue.ToString();
                if (transType == "Select")
                {
                    transType = "";
                }
            }

            //if ((TextBox)gvSystematicTransactions.HeaderRow.FindControl("txtSchemeSearch") != null)
            //{

            //}

            //if ((DropDownList)gvSystematicTransactions.HeaderRow.FindControl("ddlTranType") != null)
            //{

            //}

            if (rbtnPickDate.Checked)
            {
                fromDate = DateTime.Parse(txtFromDate.Text.Trim());
                toDate   = DateTime.Parse(txtToDate.Text.Trim());
            }
            else
            {
                dateBo.CalculateFromToDatesUsingPeriod(ddlPeriod.SelectedValue, out fromDate, out toDate);
            }

            int adviserId = ((AdvisorVo)Session["advisorVo"]).advisorId;

            mfSystematicTransactionReportVoList      = customerTransactionBo.GetMFSystematicTransactionsReport(adviserId, fromDate, toDate, customerNameSearch, schemeNameSearch, transType, portfolioType, out transactionTypeList);
            ViewState["SystematicTransactionVoList"] = mfSystematicTransactionReportVoList;
            DataTable dtSystematicTransactionReport = new DataTable();
            DataRow   drSystematicTransactionReport;

            dtSystematicTransactionReport.Columns.Add("CustomerName");
            dtSystematicTransactionReport.Columns.Add("Folio");
            dtSystematicTransactionReport.Columns.Add("Scheme");
            dtSystematicTransactionReport.Columns.Add("SystematicType");
            dtSystematicTransactionReport.Columns.Add("SystematicAmount");
            dtSystematicTransactionReport.Columns.Add("SystematicDate");
            dtSystematicTransactionReport.Columns.Add("ActualAmount");
            dtSystematicTransactionReport.Columns.Add("ActualDate");
            dtSystematicTransactionReport.Columns.Add("RowId");

            if (mfSystematicTransactionReportVoList != null && mfSystematicTransactionReportVoList.Count != 0)
            {
                for (int i = 0; i < mfSystematicTransactionReportVoList.Count; i++)
                {
                    if (viewType == "ALL")
                    {
                        drSystematicTransactionReport    = dtSystematicTransactionReport.NewRow();
                        drSystematicTransactionReport[0] = mfSystematicTransactionReportVoList[i].CustomerName;
                        drSystematicTransactionReport[1] = mfSystematicTransactionReportVoList[i].FolioNum;
                        drSystematicTransactionReport[2] = mfSystematicTransactionReportVoList[i].SchemePlanName;
                        if (mfSystematicTransactionReportVoList[i].SystematicTransacionType != null && mfSystematicTransactionReportVoList[i].SystematicTransacionType != "")
                        {
                            drSystematicTransactionReport[3] = mfSystematicTransactionReportVoList[i].SystematicTransacionType;
                        }
                        else
                        {
                            drSystematicTransactionReport[3] = mfSystematicTransactionReportVoList[i].OriginalTransactionType;
                        }
                        if (mfSystematicTransactionReportVoList[i].SystematicAmount != 0)
                        {
                            drSystematicTransactionReport[4] = mfSystematicTransactionReportVoList[i].SystematicAmount.ToString("f2");
                        }
                        else
                        {
                            drSystematicTransactionReport[4] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].SystematicTransactionDate != null && mfSystematicTransactionReportVoList[i].SystematicTransactionDate != DateTime.MinValue)
                        {
                            drSystematicTransactionReport[5] = mfSystematicTransactionReportVoList[i].SystematicTransactionDate.ToShortDateString();
                        }
                        else
                        {
                            drSystematicTransactionReport[5] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].OriginalTransactionAmount != 0)
                        {
                            drSystematicTransactionReport[6] = mfSystematicTransactionReportVoList[i].OriginalTransactionAmount.ToString("f2");
                        }
                        else
                        {
                            drSystematicTransactionReport[6] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].OriginalTransactionDate != null && mfSystematicTransactionReportVoList[i].OriginalTransactionDate != DateTime.MinValue)
                        {
                            drSystematicTransactionReport[7] = mfSystematicTransactionReportVoList[i].OriginalTransactionDate.ToShortDateString();
                        }
                        else
                        {
                            drSystematicTransactionReport[7] = "-";
                        }
                        drSystematicTransactionReport[8] = i;
                        dtSystematicTransactionReport.Rows.Add(drSystematicTransactionReport);
                        systematicTotalAmount = systematicTotalAmount + mfSystematicTransactionReportVoList[i].SystematicAmount;
                        originalAmountTotal   = originalAmountTotal + mfSystematicTransactionReportVoList[i].OriginalTransactionAmount;
                    }
                    else if (viewType == "NAT" && (mfSystematicTransactionReportVoList[i].OriginalTransactionDate == DateTime.MinValue ||
                                                   mfSystematicTransactionReportVoList[i].OriginalTransactionDate == null) &&
                             (mfSystematicTransactionReportVoList[i].OriginalTransactionType == "" || mfSystematicTransactionReportVoList[i].OriginalTransactionType == null))
                    {
                        drSystematicTransactionReport    = dtSystematicTransactionReport.NewRow();
                        drSystematicTransactionReport[0] = mfSystematicTransactionReportVoList[i].CustomerName;
                        drSystematicTransactionReport[1] = mfSystematicTransactionReportVoList[i].FolioNum;
                        drSystematicTransactionReport[2] = mfSystematicTransactionReportVoList[i].SchemePlanName;
                        if (mfSystematicTransactionReportVoList[i].SystematicTransacionType != null && mfSystematicTransactionReportVoList[i].SystematicTransacionType != "")
                        {
                            drSystematicTransactionReport[3] = mfSystematicTransactionReportVoList[i].SystematicTransacionType;
                        }
                        else
                        {
                            drSystematicTransactionReport[3] = mfSystematicTransactionReportVoList[i].OriginalTransactionType;
                        }
                        if (mfSystematicTransactionReportVoList[i].SystematicAmount != 0)
                        {
                            drSystematicTransactionReport[4] = mfSystematicTransactionReportVoList[i].SystematicAmount.ToString("f2");
                        }
                        else
                        {
                            drSystematicTransactionReport[4] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].SystematicTransactionDate != null && mfSystematicTransactionReportVoList[i].SystematicTransactionDate != DateTime.MinValue)
                        {
                            drSystematicTransactionReport[5] = mfSystematicTransactionReportVoList[i].SystematicTransactionDate.ToShortDateString();
                        }
                        else
                        {
                            drSystematicTransactionReport[5] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].OriginalTransactionAmount != 0)
                        {
                            drSystematicTransactionReport[6] = mfSystematicTransactionReportVoList[i].OriginalTransactionAmount.ToString("f2");
                        }
                        else
                        {
                            drSystematicTransactionReport[6] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].OriginalTransactionDate != null && mfSystematicTransactionReportVoList[i].OriginalTransactionDate != DateTime.MinValue)
                        {
                            drSystematicTransactionReport[7] = mfSystematicTransactionReportVoList[i].OriginalTransactionDate.ToShortDateString();
                        }
                        else
                        {
                            drSystematicTransactionReport[7] = "-";
                        }
                        drSystematicTransactionReport[8] = i;
                        dtSystematicTransactionReport.Rows.Add(drSystematicTransactionReport);
                        systematicTotalAmount = systematicTotalAmount + mfSystematicTransactionReportVoList[i].SystematicAmount;
                        originalAmountTotal   = originalAmountTotal + mfSystematicTransactionReportVoList[i].OriginalTransactionAmount;
                    }
                    else if (viewType == "NST" && (mfSystematicTransactionReportVoList[i].SystematicTransacionType == "" || mfSystematicTransactionReportVoList[i].SystematicTransacionType == null) &&
                             mfSystematicTransactionReportVoList[i].SystematicAmount == 0)
                    {
                        drSystematicTransactionReport    = dtSystematicTransactionReport.NewRow();
                        drSystematicTransactionReport[0] = mfSystematicTransactionReportVoList[i].CustomerName;
                        drSystematicTransactionReport[1] = mfSystematicTransactionReportVoList[i].FolioNum;
                        drSystematicTransactionReport[2] = mfSystematicTransactionReportVoList[i].SchemePlanName;
                        if (mfSystematicTransactionReportVoList[i].SystematicTransacionType != null && mfSystematicTransactionReportVoList[i].SystematicTransacionType != "")
                        {
                            drSystematicTransactionReport[3] = mfSystematicTransactionReportVoList[i].SystematicTransacionType;
                        }
                        else
                        {
                            drSystematicTransactionReport[3] = mfSystematicTransactionReportVoList[i].OriginalTransactionType;
                        }
                        if (mfSystematicTransactionReportVoList[i].SystematicAmount != 0)
                        {
                            drSystematicTransactionReport[4] = mfSystematicTransactionReportVoList[i].SystematicAmount.ToString("f2");
                        }
                        else
                        {
                            drSystematicTransactionReport[4] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].SystematicTransactionDate != null && mfSystematicTransactionReportVoList[i].SystematicTransactionDate != DateTime.MinValue)
                        {
                            drSystematicTransactionReport[5] = mfSystematicTransactionReportVoList[i].SystematicTransactionDate.ToShortDateString();
                        }
                        else
                        {
                            drSystematicTransactionReport[5] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].OriginalTransactionAmount != 0)
                        {
                            drSystematicTransactionReport[6] = mfSystematicTransactionReportVoList[i].OriginalTransactionAmount.ToString("f2");
                        }
                        else
                        {
                            drSystematicTransactionReport[6] = "-";
                        }
                        if (mfSystematicTransactionReportVoList[i].OriginalTransactionDate != null && mfSystematicTransactionReportVoList[i].OriginalTransactionDate != DateTime.MinValue)
                        {
                            drSystematicTransactionReport[7] = mfSystematicTransactionReportVoList[i].OriginalTransactionDate.ToShortDateString();
                        }
                        else
                        {
                            drSystematicTransactionReport[7] = "-";
                        }
                        drSystematicTransactionReport[8] = i;
                        dtSystematicTransactionReport.Rows.Add(drSystematicTransactionReport);
                        systematicTotalAmount = systematicTotalAmount + mfSystematicTransactionReportVoList[i].SystematicAmount;
                        originalAmountTotal   = originalAmountTotal + mfSystematicTransactionReportVoList[i].OriginalTransactionAmount;
                    }
                }
                if (dtSystematicTransactionReport.Rows.Count != 0)
                {
                    gvSystematicTransactions.DataSource = dtSystematicTransactionReport;
                    gvSystematicTransactions.DataBind();

                    gvSystematicTransactions.Visible  = true;
                    pnlSystematicTransactions.Visible = true;
                    BindGridSearchBoxes(transactionTypeList, transType, customerNameSearch, schemeNameSearch);
                }
                else
                {
                    drSystematicTransactionReport    = dtSystematicTransactionReport.NewRow();
                    drSystematicTransactionReport[0] = "";
                    drSystematicTransactionReport[1] = "";
                    drSystematicTransactionReport[2] = "";
                    drSystematicTransactionReport[3] = "";
                    drSystematicTransactionReport[4] = "";
                    drSystematicTransactionReport[5] = "";
                    drSystematicTransactionReport[6] = "";
                    drSystematicTransactionReport[7] = "";
                    drSystematicTransactionReport[8] = "";
                    dtSystematicTransactionReport.Rows.Add(drSystematicTransactionReport);

                    gvSystematicTransactions.DataSource = dtSystematicTransactionReport;
                    gvSystematicTransactions.DataBind();
                    gvSystematicTransactions.Visible  = true;
                    pnlSystematicTransactions.Visible = true;
                    BindGridSearchBoxes(transactionTypeList, transType, customerNameSearch, schemeNameSearch);
                    trErrorMessage.Visible = true;
                }
            }
            else
            {
                drSystematicTransactionReport    = dtSystematicTransactionReport.NewRow();
                drSystematicTransactionReport[0] = "";
                drSystematicTransactionReport[1] = "";
                drSystematicTransactionReport[2] = "";
                drSystematicTransactionReport[3] = "";
                drSystematicTransactionReport[4] = "";
                drSystematicTransactionReport[5] = "";
                drSystematicTransactionReport[6] = "";
                drSystematicTransactionReport[7] = "";
                dtSystematicTransactionReport.Rows.Add(drSystematicTransactionReport);

                gvSystematicTransactions.DataSource = dtSystematicTransactionReport;
                gvSystematicTransactions.DataBind();
                gvSystematicTransactions.Visible  = true;
                pnlSystematicTransactions.Visible = true;
                BindGridSearchBoxes(transactionTypeList, transType, customerNameSearch, schemeNameSearch);
                trErrorMessage.Visible = true;
            }
        }
        private void ShowTransactions()
        {
            gvRejectedTransactions.DataSource = null;
            gvRejectedTransactions.DataBind();
            gvOriginalTransactions.DataSource = null;
            gvOriginalTransactions.DataBind();
            pnlRejectedTransactions.Visible = false;
            pnlOriginalTransactions.Visible = false;
            lblRejectedTransactions.Visible = false;
            lblOriginalTransactions.Visible = false;
            tdOriginalTransactions.Visible  = false;
            tdRejectedTransactions.Visible  = false;
            btnMap.Visible = false;
            if (ddlPortfolios.SelectedValue.ToString() != "NA")
            {
                int adviserId = 0;
                if (Session["advisorVo"] != null)
                {
                    adviserId = ((AdvisorVo)Session["advisorVo"]).advisorId;
                }
                int portfolioId = 0;
                if (txtCustomerId.Value.ToString() != "" && ddlPortfolios.SelectedValue.ToString() != "NA")
                {
                    portfolioId = int.Parse(ddlPortfolios.SelectedValue.ToString());
                }
                List <MFTransactionVo> mfRejectTransactionVoList = new List <MFTransactionVo>();

                CustomerTransactionBo customerTransactionBo  = new CustomerTransactionBo();
                DataTable             dtRejectedTransactions = new DataTable();

                DataRow drRejectedTransaction;



                dtRejectedTransactions.Columns.Add("MFTransId");
                dtRejectedTransactions.Columns.Add("CustomerName");
                dtRejectedTransactions.Columns.Add("Scheme");
                dtRejectedTransactions.Columns.Add("Folio");
                dtRejectedTransactions.Columns.Add("Date");
                dtRejectedTransactions.Columns.Add("Units");
                dtRejectedTransactions.Columns.Add("Price");
                dtRejectedTransactions.Columns.Add("Amount");
                dtRejectedTransactions.Columns.Add("TransactioType");



                mfRejectTransactionVoList = customerTransactionBo.GetMFRejectTransactions(portfolioId, adviserId);


                if (mfRejectTransactionVoList != null)
                {
                    for (int i = 0; i < mfRejectTransactionVoList.Count; i++)
                    {
                        drRejectedTransaction    = dtRejectedTransactions.NewRow();
                        drRejectedTransaction[0] = mfRejectTransactionVoList[i].TransactionId;
                        drRejectedTransaction[1] = mfRejectTransactionVoList[i].CustomerName;
                        drRejectedTransaction[2] = mfRejectTransactionVoList[i].SchemePlan;
                        drRejectedTransaction[3] = mfRejectTransactionVoList[i].Folio;
                        drRejectedTransaction[4] = mfRejectTransactionVoList[i].TransactionDate.ToShortDateString();
                        drRejectedTransaction[5] = mfRejectTransactionVoList[i].Units.ToString("f2");
                        drRejectedTransaction[6] = mfRejectTransactionVoList[i].Price.ToString("f2");
                        drRejectedTransaction[7] = mfRejectTransactionVoList[i].Amount.ToString("f2");
                        drRejectedTransaction[8] = mfRejectTransactionVoList[i].TransactionType;
                        dtRejectedTransactions.Rows.Add(drRejectedTransaction);
                    }
                    gvRejectedTransactions.DataSource = dtRejectedTransactions;

                    gvRejectedTransactions.DataBind();
                    //((RadioButton)gvRejectedTransactions.Rows[0].Cells[0].FindControl("rdRejectId")).Checked = true;
                    gvRejectedTransactions.Visible  = true;
                    lblRejectedTransactions.Visible = true;
                    pnlRejectedTransactions.Visible = true;
                    tdRejectedTransactions.Visible  = true;
                    lblRejectedTransactions.Text    = "Select a Rejected Transaction To Map";
                }
                else
                {
                    lblRejectedTransactions.Visible = true;
                    lblRejectedTransactions.Text    = "No Rejection Transactions Available";
                    pnlRejectedTransactions.Visible = false;
                    tdRejectedTransactions.Visible  = false;
                }
            }
            else
            {
                gvRejectedTransactions.Visible  = false;
                lblRejectedTransactions.Visible = false;
                tdRejectedTransactions.Visible  = false;
                pnlRejectedTransactions.Visible = false;
            }
        }
        private void ShowOriginalTransactions(int MFTransId)
        {
            bool isAvailable = true;

            if (ddlPortfolios.SelectedValue.ToString() != "NA")
            {
                //int portfolioId = int.Parse(ddlPortfolios.SelectedValue.ToString());

                List <MFTransactionVo> mfOriginalTransactionVoList = new List <MFTransactionVo>();
                CustomerTransactionBo  customerTransactionBo       = new CustomerTransactionBo();

                DataTable dtOriginalTransactions = new DataTable();

                DataRow drOriginalTransaction;



                dtOriginalTransactions.Columns.Add("MFTransId");
                dtOriginalTransactions.Columns.Add("Scheme");
                dtOriginalTransactions.Columns.Add("Folio");
                dtOriginalTransactions.Columns.Add("Date");
                dtOriginalTransactions.Columns.Add("Units");
                dtOriginalTransactions.Columns.Add("Price");
                dtOriginalTransactions.Columns.Add("Amount");
                dtOriginalTransactions.Columns.Add("TransactioType");


                mfOriginalTransactionVoList = customerTransactionBo.GetMFOriginalTransactions(MFTransId);

                if (mfOriginalTransactionVoList != null)
                {
                    for (int i = 0; i < mfOriginalTransactionVoList.Count; i++)
                    {
                        drOriginalTransaction    = dtOriginalTransactions.NewRow();
                        drOriginalTransaction[0] = mfOriginalTransactionVoList[i].TransactionId;
                        drOriginalTransaction[1] = mfOriginalTransactionVoList[i].SchemePlan;
                        drOriginalTransaction[2] = mfOriginalTransactionVoList[i].Folio;
                        drOriginalTransaction[3] = mfOriginalTransactionVoList[i].TransactionDate.ToShortDateString();
                        drOriginalTransaction[4] = mfOriginalTransactionVoList[i].Units.ToString("f2");
                        drOriginalTransaction[5] = mfOriginalTransactionVoList[i].Price.ToString("f2");
                        drOriginalTransaction[6] = mfOriginalTransactionVoList[i].Amount.ToString("f2");
                        drOriginalTransaction[7] = mfOriginalTransactionVoList[i].TransactionType;
                        dtOriginalTransactions.Rows.Add(drOriginalTransaction);
                    }
                    gvOriginalTransactions.DataSource = dtOriginalTransactions;

                    gvOriginalTransactions.DataBind();
                    ((RadioButton)gvOriginalTransactions.Rows[0].Cells[0].FindControl("rdOriginalId")).Checked = true;
                    gvOriginalTransactions.Visible  = true;
                    lblOriginalTransactions.Visible = true;
                    pnlOriginalTransactions.Visible = true;
                    lblOriginalTransactions.Text    = "Similar Original Transactions. Select Matching Transaction and Click on the button 'Map Transaction below'";
                    tdOriginalTransactions.Visible  = true;
                }
                else
                {
                    lblOriginalTransactions.Visible = true;
                    lblOriginalTransactions.Text    = "No Similar Original Transactions Available";
                    pnlOriginalTransactions.Visible = false;
                    tdOriginalTransactions.Visible  = false;
                    isAvailable = false;
                }
            }
            else
            {
                gvOriginalTransactions.Visible = false;


                lblOriginalTransactions.Visible = false;

                pnlOriginalTransactions.Visible = false;
                tdOriginalTransactions.Visible  = false;
                isAvailable = false;
            }
            if (isAvailable)
            {
                btnMap.Visible = true;
            }
            else
            {
                btnMap.Visible = false;
            }
        }
        private bool SaveEquityTransaction()
        {
            EQTransactionVo       eqTransactionVo       = new EQTransactionVo();
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();

            try
            {
                // dt = productEquityBo.GetBrokerCode(portfolioId, ddlTradeAcc.SelectedItem.Text.ToString());

                eqTransactionVo.IsSourceManual = 1;
                eqTransactionVo.Brokerage      = float.Parse(txtBrokerage.Text);
                //eqTransactionVo.BrokerCode = dt.Rows[0]["XB_BrokerCode"].ToString();

                if (ddlTransactionType.SelectedItem.Text.ToString() == "Purchase")
                {
                    eqTransactionVo.BuySell         = "B";
                    eqTransactionVo.TransactionCode = 1;
                }
                if (ddlTransactionType.SelectedItem.Text.ToString() == "Sell")
                {
                    eqTransactionVo.BuySell         = "S";
                    eqTransactionVo.TransactionCode = 2;
                }
                if (ddlTransactionType.SelectedItem.Text.ToString() == "Holdings")
                {
                    eqTransactionVo.BuySell         = "B";
                    eqTransactionVo.TransactionCode = 13;
                }
                if (txtParentCustomerId.Value != string.Empty)
                {
                    eqTransactionVo.CustomerId = Convert.ToInt32(txtParentCustomerId.Value); //customerVo.CustomerId;
                }
                eqTransactionVo.IsCorpAction = 0;
                if (rdoDelivery.Checked)
                {
                    eqTransactionVo.IsSpeculative = 0;
                }
                else if (rdoSpeculative.Checked)
                {
                    eqTransactionVo.IsSpeculative = 1;
                }
                //eqTransactionVo.EducationCess = (float)tempEducation;
                eqTransactionVo.ScripCode = Convert.ToInt32(hidScrip.Value);
                //eqTransactionVo.Exchange = ddlExchange.SelectedItem.Value.ToString();
                if (txtOtherCharges.Text != string.Empty)
                {
                    eqTransactionVo.OtherCharges = float.Parse(txtOtherCharges.Text);
                }
                if (txtQuantity.Text != string.Empty)
                {
                    eqTransactionVo.Quantity = float.Parse(txtQuantity.Text);
                }
                //eqTransactionVo.IsSpeculative = 0;
                eqTransactionVo.TradeType = "D";



                // eqTransactionVo.AccountId = ;
                if (txtRate.Text != string.Empty)
                {
                    eqTransactionVo.Rate = float.Parse(txtRate.Text);
                }
                //eqTransactionVo.RateInclBrokerage = float.Parse(txtRateIncBrokerage.Text);
                //temp = decimal.Round(Convert.ToDecimal(tempService), 3);
                //eqTransactionVo.ServiceTax = (float)temp;
                if (txtSTT.Text != string.Empty)
                {
                    eqTransactionVo.STT = float.Parse(txtSTT.Text);
                }

                eqTransactionVo.TradeDate = Convert.ToDateTime(txtTransactionDate.Text.Trim());// DateTime.Parse(txtTradeDate.Text);//ddlDay.SelectedItem.Text.ToString() + "/" + ddlMonth.SelectedItem.Value.ToString() + "/" + ddlYear.SelectedItem.Value.ToString()
                //eqTransactionVo.TradeTotal = float.Parse(txtTotal.Text);
                if (ddlTradeAccountNos.SelectedValue != "-1")
                {
                    eqTransactionVo.AccountId = int.Parse(ddlTradeAccountNos.SelectedValue);
                }
                //long.Parse(ddlTradeAcc.SelectedItem.Text.ToString());

                if (customerTransactionBo.AddEquityTransaction(eqTransactionVo, eqTransactionVo.CustomerId))
                {
                    CustomerPortfolioBo customerPortfolioBo = new CustomerPortfolioBo();
                    AdvisorVo           advisorVo           = new AdvisorVo();
                    advisorVo = (AdvisorVo)Session["advisorVo"];

                    customerPortfolioBo.UpdateAdviserDailyEODLogRevaluateForTransaction(advisorVo.advisorId, "EQ", eqTransactionVo.TradeDate);
                }
                //btnSubmit.Enabled = false;
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "EquityManualSingleTransaction.ascx:btnSubmit_Click()");
                object[] objects = new object[3];
                //objects[0] = portfolioId; ;
                //objects[1] = eqTransactionVo;
                //objects[2] = customerVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(false);
        }
Exemple #15
0
        static void Main(string[] args)
        {
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();

            customerTransactionBo.RunMFTRansactionsCancellationJob();
        }
        protected void BindTransactionDetails(int AccountId, int schemePlanCode, RadGrid gvChildDetails)
        {
            CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();

            mfTransactionList = customerTransactionBo.GetCustomerTransactionsBook(advisorVo.advisorId, customerId, Convert.ToDateTime("01-01-1990"), DateTime.Now, 1, 0, AccountId, schemePlanCode);
            if (mfTransactionList.Count != 0)
            {
                DataTable dtMFTransactions = new DataTable();
                dtMFTransactions.Columns.Add("TransactionId");
                dtMFTransactions.Columns.Add("Customer Name");
                dtMFTransactions.Columns.Add("Folio Number");
                dtMFTransactions.Columns.Add("Scheme Name");
                dtMFTransactions.Columns.Add("Transaction Type");
                dtMFTransactions.Columns.Add("Transaction Date", typeof(DateTime));
                dtMFTransactions.Columns.Add("Price", typeof(double));
                dtMFTransactions.Columns.Add("Units", typeof(double));
                dtMFTransactions.Columns.Add("Amount", typeof(double));
                dtMFTransactions.Columns.Add("STT", typeof(double));
                dtMFTransactions.Columns.Add("Portfolio Name");
                dtMFTransactions.Columns.Add("TransactionStatus");
                dtMFTransactions.Columns.Add("Category");
                dtMFTransactions.Columns.Add("AMC");
                dtMFTransactions.Columns.Add("ADUL_ProcessId");
                dtMFTransactions.Columns.Add("CMFT_SubBrokerCode");
                dtMFTransactions.Columns.Add("PAISC_AssetInstrumentSubCategoryName");
                dtMFTransactions.Columns.Add("CreatedOn");
                dtMFTransactions.Columns.Add("CMFT_ExternalBrokerageAmount", typeof(double));
                dtMFTransactions.Columns.Add("CMFT_Area");
                dtMFTransactions.Columns.Add("CMFT_EUIN");
                dtMFTransactions.Columns.Add("CurrentNAV");
                dtMFTransactions.Columns.Add("DivReinvestment");
                dtMFTransactions.Columns.Add("DivFrequency");
                dtMFTransactions.Columns.Add("Channel");
                dtMFTransactions.Columns.Add("OrderNo");
                //dtMFTransactions.Columns.Add("TransactionNumber");
                dtMFTransactions.Columns.Add("CO_OrderDate");
                dtMFTransactions.Columns.Add("ELSSMaturityDate", typeof(DateTime));
                DataRow drMFTransaction;
                for (int i = 0; i < mfTransactionList.Count; i++)
                {
                    drMFTransaction    = dtMFTransactions.NewRow();
                    mfTransactionVo    = new MFTransactionVo();
                    mfTransactionVo    = mfTransactionList[i];
                    drMFTransaction[0] = mfTransactionVo.TransactionId.ToString();
                    drMFTransaction[1] = mfTransactionVo.CustomerName.ToString();
                    drMFTransaction[2] = mfTransactionVo.Folio.ToString();
                    drMFTransaction[3] = mfTransactionVo.SchemePlan.ToString();
                    drMFTransaction[4] = mfTransactionVo.TransactionType.ToString();
                    drMFTransaction[5] = mfTransactionVo.TransactionDate.ToShortDateString().ToString();
                    drMFTransaction[6] = decimal.Parse(mfTransactionVo.Price.ToString()).ToString("n4", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                    drMFTransaction[7] = mfTransactionVo.Units.ToString("f4");
                    //totalUnits = totalUnits + mfTransactionVo.Units;
                    drMFTransaction[8] = decimal.Parse(mfTransactionVo.Amount.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                    //totalAmount = totalAmount + mfTransactionVo.Amount;
                    drMFTransaction[9]  = decimal.Parse(mfTransactionVo.STT.ToString()).ToString("n4", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                    drMFTransaction[10] = mfTransactionVo.PortfolioName.ToString();
                    drMFTransaction[11] = mfTransactionVo.TransactionStatus.ToString();
                    drMFTransaction[12] = mfTransactionVo.Category;
                    drMFTransaction[13] = mfTransactionVo.AMCName;
                    if (mfTransactionVo.ProcessId == 0)
                    {
                        drMFTransaction[14] = "N/A";
                    }
                    else
                    {
                        drMFTransaction[14] = int.Parse(mfTransactionVo.ProcessId.ToString());
                    }
                    drMFTransaction[15]                = mfTransactionVo.SubBrokerCode;
                    drMFTransaction[16]                = mfTransactionVo.SubCategoryName;
                    drMFTransaction[17]                = mfTransactionVo.CreatedOn;
                    drMFTransaction[18]                = decimal.Parse(mfTransactionVo.BrokerageAmount.ToString());
                    drMFTransaction["CMFT_Area"]       = mfTransactionVo.Area.ToString();
                    drMFTransaction["CMFT_EUIN"]       = mfTransactionVo.EUIN.ToString();
                    drMFTransaction["DivReinvestment"] = mfTransactionVo.DivReinvestmen.ToString();;
                    drMFTransaction["DivFrequency"]    = mfTransactionVo.Divfrequency.ToString();;
                    drMFTransaction["Channel"]         = mfTransactionVo.channel.ToString();
                    drMFTransaction["OrderNo"]         = mfTransactionVo.orderNo;
                    drMFTransaction["CurrentNav"]      = mfTransactionVo.latestNav;
                    //drMFTransaction["TransactionNumber"] = mfTransactionVo.TrxnNo.ToString();
                    if (!string.IsNullOrEmpty(mfTransactionVo.OrdDate.ToString()) && (mfTransactionVo.OrdDate) != DateTime.MinValue)
                    {
                        drMFTransaction["CO_OrderDate"] = mfTransactionVo.OrdDate;
                    }
                    else
                    {
                        drMFTransaction["CO_OrderDate"] = "";
                    }
                    if (!string.IsNullOrEmpty(mfTransactionVo.ELSSMaturityDate.ToString()) && (mfTransactionVo.ELSSMaturityDate) != DateTime.MinValue)
                    {
                        drMFTransaction["ELSSMaturityDate"] = mfTransactionVo.ELSSMaturityDate;
                    }
                    //else
                    //{
                    //    drMFTransaction["ELSSMaturityDate"] = DateTime.MinValue;
                    //}

                    dtMFTransactions.Rows.Add(drMFTransaction);
                }
                if (gvChildDetails.Visible == false)
                {
                    gvChildDetails.Visible = true;
                    //btnDetails.Text = "-";
                }
                else if (gvChildDetails.Visible == true)
                {
                    gvChildDetails.Visible = false;
                    //buttonlink.Text = "+";
                }
                if (Cache["ViewTransaction" + userVo.UserId] == null)
                {
                    Cache.Insert("ViewTransaction" + userVo.UserId, dtMFTransactions);
                }
                else
                {
                    Cache.Remove("ViewTransaction" + userVo.UserId);
                    Cache.Insert("ViewTransaction" + userVo.UserId, dtMFTransactions);
                }
                gvChildDetails.CurrentPageIndex = 0;
                gvChildDetails.DataSource       = dtMFTransactions;
                //Session["gvMFTransactions"] = dtMFTransactions;
                gvChildDetails.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userVo = (UserVo)Session["UserVo"];


            if (Request.Form["ctrl_EquityReports$btnView"] != "View Report")
            {
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                if (!string.IsNullOrEmpty(Session[SessionContents.RmVo].ToString()))
                {
                    rmVo = (RMVo)Session[SessionContents.RmVo];
                }

                if (Session["UserType"] != null)
                {
                    if (Session["UserType"].ToString() == "Customer")
                    {
                        strFromCustomerDashBoard = true;
                    }
                }

                if (Session["UserType"].ToString().Trim() == "Customer" && strFromCustomerDashBoard == true)
                {
                    if (!string.IsNullOrEmpty(Session["CustomerVo"].ToString()))
                    {
                        customerVo = (CustomerVo)Session["CustomerVo"];
                    }
                    isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId);
                    if (isGrpHead == false)
                    {
                        TabPanel1.Visible = false;
                        TabPanel2.Visible = true;
                        if (!IsPostBack)
                        {
                            HdnIsGroupHeadReport.Value = "1";
                        }
                    }
                    else
                    {
                        TabPanel1.Visible = true;
                        TabPanel2.Visible = true;
                        if (!IsPostBack)
                        {
                            HdnIsGroupHeadReport.Value = "0";
                        }
                    }
                    CustomerLogin               = true;
                    hndCustomerLogin.Value      = "true";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                    trCustomerButton.Visible    = true;
                    trAdminRmButton.Visible     = false;
                }
                else
                {
                    hndCustomerLogin.Value      = "false";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                    trCustomerButton.Visible    = false;
                    trAdminRmButton.Visible     = true;
                }

                BindPeriodDropDown();

                if (!string.IsNullOrEmpty(Session["advisorVo"].ToString()))
                {
                    advisorVo = (AdvisorVo)Session["advisorVo"];
                }

                if (!IsPostBack)
                {
                    txtFromDate.Text = DateTime.Now.AddMonths(-1).ToString("dd-MM-yyyy");
                    txtToDate.Text   = DateTime.Now.ToString("dd-MM-yyyy");
                    CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                    DataSet ds = customerTransactionBo.GetLastTradeDate();
                    if (ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["WTD_Date"] != null)
                    {
                        txtAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                    }
                    txtFromDate.Text = DateTime.Now.AddMonths(-1).ToString("dd-MM-yyyy");
                    txtToDate.Text   = DateTime.Now.ToString("dd-MM-yyyy");
                    if (CustomerLogin == true)
                    {
                        trCustomerGrHead.Visible    = true;
                        trAdminCustomer.Visible     = false;
                        trAdminIndiCustomer.Visible = false;
                        trCustomerInd.Visible       = true;
                        trStepIndi.Visible          = false;
                        trStepGrHead.Visible        = false;
                        hdnCustomerId1.Value        = customerVo.CustomerId.ToString();
                        ShowGroupCustomers();
                        IndivisulCustomerLogin();
                    }
                    else
                    {
                        trCustomerGrHead.Visible    = false;
                        trAdminCustomer.Visible     = true;
                        trAdminIndiCustomer.Visible = true;
                        trCustomerInd.Visible       = false;
                        trStepIndi.Visible          = true;
                        trStepGrHead.Visible        = true;


                        if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                        {
                            txtCustomer_autoCompleteExtender.ContextKey          = rmVo.RMId.ToString();
                            txtParentCustomer_autoCompleteExtender.ContextKey    = rmVo.RMId.ToString();
                            txtCustomer_autoCompleteExtender.ServiceMethod       = "GetMemberCustomerName";
                            txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName";
                        }
                        else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin" || Session[SessionContents.CurrentUserRole].ToString() == "Ops")
                        {
                            txtCustomer_autoCompleteExtender.ContextKey          = advisorVo.advisorId.ToString();
                            txtParentCustomer_autoCompleteExtender.ContextKey    = advisorVo.advisorId.ToString();
                            txtCustomer_autoCompleteExtender.ServiceMethod       = "GetAdviserCustomerName";
                            txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName";
                        }
                    }
                }

                if (IsPostBack && !string.IsNullOrEmpty(Request.Form["ctrl_EquityReports$hidTabIndex"]))
                {
                    activeTabIndex = Convert.ToInt32(Request.Form["ctrl_EquityReports$hidTabIndex"]);
                }
            }
        }
Exemple #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userVo = (UserVo)Session["UserVo"];

            //ddlReportSubType.Attributes.Add("onchange", "ChangeDates()");
            rdoGroup.Attributes.Add("onClick", "javascript:ChangeCustomerSelectionTextBox(value);");
            rdoIndividual.Attributes.Add("onClick", "javascript:ChangeCustomerSelectionTextBox(value);");
            rdoCustomerGroup.Attributes.Add("onClick", "javascript:ChangeGroupOrSelf(value);");
            rdoCustomerIndivisual.Attributes.Add("onClick", "javascript:ChangeGroupOrSelf(value);");

            if (!string.IsNullOrEmpty(Session["advisorVo"].ToString()))
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
            }
            // cvAsOnDate.ValueToCompare = DateTime.Now.ToShortDateString();

            if (Request.Form["ctrl_MFReports$tabViewAndEmailReports$tabpnlViewReports$btnViewReport"] != "View Report" && Request.Form["ctrl_MFReports$tabViewAndEmailReports$tabpnlEmailReports$btnEmailReport"] != "Email Report")
            {
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                if (!string.IsNullOrEmpty(Session[SessionContents.RmVo].ToString()))
                {
                    rmVo = (RMVo)Session[SessionContents.RmVo];
                }

                if (Session["UserType"] != null)
                {
                    if (Session["UserType"].ToString() == "Customer")
                    {
                        strFromCustomerDashBoard = true;
                    }
                }

                if (userVo.UserType == "Customer" || strFromCustomerDashBoard == true)
                {
                    if (!string.IsNullOrEmpty(Session["CustomerVo"].ToString()))
                    {
                        customerVo = (CustomerVo)Session["CustomerVo"];
                    }
                    CustomerLogin               = true;
                    hndCustomerLogin.Value      = "true";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                    tabpnlEmailReports.Visible  = false;
                }
                else
                {
                    hndCustomerLogin.Value      = "false";
                    Session["hndCustomerLogin"] = hndCustomerLogin.Value;
                }

                BindPeriodDropDown();

                //if (CustomerLogin == false)
                //{
                //    txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                //    txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                //}
                if (!IsPostBack)
                {
                    ddlMFTransactionTypeBind();
                    if (CustomerLogin == true)
                    {
                        trCustomerName.Visible  = true;
                        trIndCustomer.Visible   = false;
                        trGroupCustomer.Visible = false;
                        IndivisulCustomerLogin();

                        trAdvisorRadioList.Visible  = false;
                        trCustomerRadioList.Visible = true;

                        trAdminRM.Visible  = false;
                        trCustomer.Visible = true;

                        isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId);
                        if (isGrpHead == false)
                        {
                            trCustomerRadioList.Visible   = false;
                            rdoCustomerIndivisual.Checked = true;
                            divGroupCustomers.Visible     = false;
                            hndSelfOrGroup.Value          = "self";
                            ShowFolios();
                        }
                        else
                        {
                            rdoCustomerGroup.Checked = true;
                            hndSelfOrGroup.Value     = "";
                        }
                    }
                    else
                    {
                        trCustomerName.Visible  = false;
                        trIndCustomer.Visible   = true;
                        trGroupCustomer.Visible = true;

                        trAdvisorRadioList.Visible  = true;
                        trCustomerRadioList.Visible = false;

                        trAdminRM.Visible  = true;
                        trCustomer.Visible = false;
                    }


                    //tabpnlEmailReports.Visible = false;
                    if (CustomerLogin == false)
                    {
                        //This for Customer Search AutoCompelete TextBox Dynamic Assign Service Method.
                        //if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                        //{
                        //    txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                        //    txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString();
                        //    txtCustomer_autoCompleteExtender.ServiceMethod = "GetMemberCustomerName";
                        //    txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName";
                        //}
                        //else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin")
                        //{
                        //    txtCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString();
                        //    txtParentCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString();
                        //    txtCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserCustomerName";
                        //    txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName";

                        //}


                        //ListBox horizontal Scorling enabled false
                        LBCustomer.HorizontalScrollEnabled       = false;
                        LBSelectCustomer.HorizontalScrollEnabled = false;

                        CustomerBo customerBo          = new CustomerBo();
                        DataTable  dtGroupCustomerList = new DataTable();
                        //dtGroupCustomerList = customerBo.GetParentCustomerName("BULKMAIL", int.Parse(rmVo.RMId.ToString()));
                        if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                        {
                            tabpnlEmailReports.Visible = true;
                            dtGroupCustomerList        = customerBo.GetParentCustomerName("BULKMAIL", int.Parse(rmVo.RMId.ToString()));
                        }
                        else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin")
                        {
                            tabpnlEmailReports.Visible = true;
                            dtGroupCustomerList        = customerBo.GetAdviserGroupCustomerName("BULKMAIL", int.Parse(advisorVo.advisorId.ToString()));
                        }
                        else if (Session[SessionContents.CurrentUserRole].ToString() == "BM")
                        {
                            tabpnlEmailReports.Visible = false;
                        }

                        LBCustomer.DataSource     = dtGroupCustomerList;
                        LBCustomer.DataTextField  = "C_FirstName";
                        LBCustomer.DataValueField = "C_CustomerId";
                        LBCustomer.DataBind();
                    }
                    CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo();
                    DataSet ds = customerTransactionBo.GetLastTradeDate();
                    if (ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["WTD_Date"] != null)
                    {
                        txtAsOnDate.Text      = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtFromDate.Text      = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtToDate.Text        = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtEmailAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtEmailFromDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                        txtEmailToDate.Text   = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString();
                    }
                    //Transaction Subreport search invissible intitialy..
                    //trTranFilter1.Visible = false;
                    //trTranFilter2.Visible = false;
                    tabViewAndEmailReports.ActiveTabIndex = 0;
                    //ShowFolios();
                }
                if (CustomerLogin == false)
                {
                    if (Session[SessionContents.CurrentUserRole].ToString() == "RM")
                    {
                        hidBMLogin.Value = "False";
                        txtCustomer_autoCompleteExtender.ContextKey          = rmVo.RMId.ToString();
                        txtParentCustomer_autoCompleteExtender.ContextKey    = rmVo.RMId.ToString();
                        txtCustomer_autoCompleteExtender.ServiceMethod       = "GetMemberCustomerName";
                        txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName";
                    }
                    else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin")
                    {
                        hidBMLogin.Value = "False";
                        txtCustomer_autoCompleteExtender.ContextKey          = advisorVo.advisorId.ToString();
                        txtParentCustomer_autoCompleteExtender.ContextKey    = advisorVo.advisorId.ToString();
                        txtCustomer_autoCompleteExtender.ServiceMethod       = "GetAdviserCustomerName";
                        txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName";
                    }
                    else if (Session[SessionContents.CurrentUserRole].ToString() == "BM")
                    {
                        hidBMLogin.Value = "true";
                        txtCustomer_autoCompleteExtender.ContextKey          = rmVo.RMId.ToString();
                        txtParentCustomer_autoCompleteExtender.ContextKey    = rmVo.RMId.ToString();
                        txtCustomer_autoCompleteExtender.ServiceMethod       = "GetBMIndividualCustomerNames";
                        txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetBMParentCustomerNames";
                    }
                }

                if (IsPostBack && !string.IsNullOrEmpty(Request.Form["ctrl_MFReports$hidTabIndex"]))
                {
                    activeTabIndex = Convert.ToInt32(Request.Form["ctrl_MFReports$hidTabIndex"]);
                    tabViewAndEmailReports.ActiveTabIndex = activeTabIndex;
                }
            }
        }