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();
            }
        }
Beispiel #2
0
        private void BindGrid()
        {
            if (Request.QueryString["systematicId"] != null && Request.QueryString["AccountId"] != null && Request.QueryString["schemeplanCode"] != null && Request.QueryString["amount"] != null && Request.QueryString["SIPStartDate"] != null)
            {
                mfTransactionList = customerTransactionBo.GetCustomerTransactionsBookSIP(advisorVo.advisorId, customerId, systematicId, IsSourceAA, AccountId, schemeplanCode, amount, SIPStartDate);
            }
            else
            {
                if (Request.QueryString["strPortfolio"] != null)
                {
                    string portfolio = Request.QueryString["strPortfolio"].ToString();
                    if (portfolio != "MyPortfolio")
                    {
                        ddlPortfolioGroup.SelectedItem.Value = "0";
                        ddlPortfolioGroup.SelectedItem.Text  = "UnManaged";
                    }
                    else
                    {
                        ddlPortfolioGroup.SelectedItem.Value = "1";
                        ddlPortfolioGroup.SelectedItem.Text  = "Managed";
                    }
                }

                DataSet ds = new DataSet();
                if (txtFrom.SelectedDate != null)
                {
                    fromDate = DateTime.Parse(txtFrom.SelectedDate.ToString());
                }
                if (txtTo.SelectedDate != null)
                {
                    toDate = DateTime.Parse(txtTo.SelectedDate.ToString());
                }
                schemePlanCode    = Convert.ToInt32(ViewState["SchemePlanCode"]);
                mfTransactionList = customerTransactionBo.GetCustomerTransactionsBook(advisorVo.advisorId, customerId, fromDate, toDate, int.Parse(ddlPortfolioGroup.SelectedItem.Value.ToString()), int.Parse(hdnAmc.Value), 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 (Cache["ViewTransaction" + userVo.UserId] == null)
                {
                    Cache.Insert("ViewTransaction" + userVo.UserId, dtMFTransactions);
                }
                else
                {
                    Cache.Remove("ViewTransaction" + userVo.UserId);
                    Cache.Insert("ViewTransaction" + userVo.UserId, dtMFTransactions);
                }
                gvTransationBookMIS.CurrentPageIndex = 0;
                gvTransationBookMIS.DataSource       = dtMFTransactions;
                Session["gvMFTransactions"]          = dtMFTransactions;
                gvTransationBookMIS.DataBind();
                pnlTransactionBook.Visible = true;
                //ErrorMessage.Visible = false;
                gvTransationBookMIS.Visible = true;
                btnExport.Visible           = true;
                trNoRecords.Visible         = false;
            }
            else
            {
                gvTransationBookMIS.DataSource = dtMFTransactions;
                gvTransationBookMIS.DataBind();
                //hdnRecordCount.Value = "0";
                //ErrorMessage.Visible = true;
                trNoRecords.Visible        = true;
                pnlTransactionBook.Visible = true;
                btnExport.Visible          = false;
            }
        }