private void btnNewPortfolioReport_Click(object sender, EventArgs e) { //if (ValidationCheck()) // return; ShareDWBAL shareDwbal = new ShareDWBAL(); ShareLedgerBAL bal = new ShareLedgerBAL(); MoneyLadgerReportBAL moneyLedgerReportBal = new MoneyLadgerReportBAL(); DataTable dtPort = new DataTable(); frmReportViewer viewer = new frmReportViewer(); cr_NewPortfolioWithGL rpt = new cr_NewPortfolioWithGL(); DataTable dtCommission = shareDwbal.GetCommissionRate(txtCustCode.Text.Trim()); double CommissionRate = Convert.ToDouble(dtCommission.Rows[0][0].ToString()); //string AsOnDateeeeee=Convert.ToString dtPort = bal.PortfolioWithActualBEPRealizeGL(txtCustCode.Text.Trim(), CommissionRate, dtToDate.Value); DataTable dtCustBasicInfo = moneyLedgerReportBal.GetCustBasicInfo(txtCustCode.Text.Trim()); ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCustCode"]).Text = "Cust. Code: " + dtCustBasicInfo.Rows[0]["Cust_Code"].ToString(); ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtBOID"]).Text = "Cust. BO ID: " + dtCustBasicInfo.Rows[0]["BO_ID"].ToString(); ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCustName"]).Text = "Cust. Name: " + dtCustBasicInfo.Rows[0]["Cust_Name"].ToString(); ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["AsOnDate"]).Text = "As On: " + dtToDate.Value.ToString("dd MMMM yyyy") + ""; GetCommonInfo(); ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtBranchName"]).Text = _branchName + ", " + _branchAddress + ", " + "Phone: " + _branchContactNumber; ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtReportName"]).Text = "Portfolio Statement"; rpt.SetDataSource(dtPort); viewer.crvReportViewer.ReportSource = rpt; viewer.Show(); }
private void ShowPortFolioReportInvestorWise() { crIPOCustomerShareLedger objcr_DSE_22_1Report = new crIPOCustomerShareLedger(); DataTable dtProtofolioReportInvestorwise = new DataTable(); DESReportBal objPortfolioBal = new DESReportBal(); IPOShareLedgerPortfolioBAL objBAL = new IPOShareLedgerPortfolioBAL(); CustShareSummeryViewer objfrm_DSE_22_1_Report = new CustShareSummeryViewer(); string deposit = "0.00"; string withdraw = "0.00"; string balance = "0.00"; try { ShareLedgerBAL shareLedgerBal = new ShareLedgerBAL(); DataTable dtCustSummerybasic = new DataTable(); //RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(ResourceName.Customer_Share_Ledger_Share_Portfolio_Summery); //string T_Custcode = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Summery); //if (T_Custcode == "") //{ // MessageBox.Show("You are restricted"); // return; //} dtCustSummerybasic = shareLedgerBal.GetCustomerSummerBasicInfo(_custCode, dtToDate.Value); if (dtCustSummerybasic.Rows.Count != 0) { deposit = Convert.ToDouble(dtCustSummerybasic.Rows[0]["Dep_Amount"]).ToString("N"); withdraw = Convert.ToDouble(dtCustSummerybasic.Rows[0]["Withdraw_Amount"]).ToString("N"); balance = Convert.ToDouble(dtCustSummerybasic.Rows[0]["Head_Balance"]).ToString("N"); } //string temp_custCode = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Summery); //dtProtofolioReportInvestorwise = objPortfolioBal.Get_DSE_22_1_Report(_custCode, dtToDate.Value); dtProtofolioReportInvestorwise = objBAL.GetShareLedegerPortfolio(_custCode, dtToDate.Value); objcr_DSE_22_1Report.SetDataSource(dtProtofolioReportInvestorwise); GetCommonInfo(); ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtBranchInfo"]).Text = _branchAddress + ". Phone:" + _branchContactNumber; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtCustCode"]).Text = txtCustCode.Text; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtBOID"]).Text = txtAccountHolderBOId.Text; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtCustName"]).Text = txtAccountHolderName.Text; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtDeposit"]).Text = deposit; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtWithdraw"]).Text = withdraw; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtBalance"]).Text = balance; ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["asOnDate"]).Text = dtToDate.Value.ToString("dd/MMM/yyyy"); objfrm_DSE_22_1_Report.crvShareSummeryReportViewer.ReportSource = objcr_DSE_22_1Report; objfrm_DSE_22_1_Report.crvShareSummeryReportViewer.DisplayGroupTree = false; objfrm_DSE_22_1_Report.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Portfolio Report Investor Wise", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void ShowCustShareLedgerReport() { _branchId = GlobalVariableBO._branchId; _shareSummery = rdoShareSummery.Checked; _Details = rdoDetailShareLedger.Checked; _SpecificPeriod = rdoSpecificPeriodShareLedger.Checked; _fromDate = Convert.ToDateTime(dtFromDate.Value.ToShortDateString()); _toDate = Convert.ToDateTime(dtToDate.Value.ToShortDateString()); _custCode = txtCustCode.Text; ShareLedgerBAL shareLedgerBal = new ShareLedgerBAL(); _maxPriceDate = shareLedgerBal.GetMaxPriceDate(); LoadCommonInfo CmmInfo = new LoadCommonInfo(); if (_shareSummery) { ShowPortFolioReportInvestorWise(); } else if (_Details) { crShareDetails crShareDetail = new crShareDetails(); ShareDetailsViewer shareDetailViewer = new ShareDetailsViewer(); DataTable dtShareDetails = new DataTable(); string Temp_Custcode = ""; RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period); Temp_Custcode = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period); dtShareDetails = shareLedgerBal.GetShareDetails(Temp_Custcode); crShareDetail.SetDataSource(dtShareDetails); ///// Load Company Name ((TextObject)crShareDetail.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = CmmInfo.ShowCompanyName(); ///// Load Branch Name ((TextObject)crShareDetail.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = CmmInfo.BranchDetails(_branchId); shareDetailViewer.crvShareDetailsReportViewer.ReportSource = crShareDetail; shareDetailViewer.Show(); } else if (_SpecificPeriod) { //crSpecificShareLedger crSpecificShare = new crSpecificShareLedger(); crShareDetails crSpecificShare = new crShareDetails(); SpecificShareLedgerViewer specificShareLedgerViewer = new SpecificShareLedgerViewer(); DataTable dtSpecificShareLedger = new DataTable(); string Temp_Custcode = ""; RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period); Temp_Custcode = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period); dtSpecificShareLedger = shareLedgerBal.GetSpecificShareLedger(Temp_Custcode, _fromDate, _toDate); crSpecificShare.SetDataSource(dtSpecificShareLedger); ///// Load Company Name ((TextObject)crSpecificShare.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = CmmInfo.ShowCompanyName(); ///// Load Branch Name ((TextObject)crSpecificShare.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = CmmInfo.BranchDetails(_branchId); ((TextObject)crSpecificShare.ReportDefinition.Sections[2].ReportObjects["txtduration"]).Text = "Duration : " + dtFromDate.Value.ToString("dd-MMM-yyyy") + " To " + dtToDate.Value.ToString("dd-MMM-yyyy"); specificShareLedgerViewer.crvSpecificShareLedgerReportViewer.ReportSource = crSpecificShare; specificShareLedgerViewer.Show(); } else { MessageBox.Show("Please Select the report category first."); } }