private void LoadReport() { ShareListBAL shareBal = new ShareListBAL(); DataTable dtParticipatoryInfo = new DataTable(); dtParticipatoryInfo = shareBal.GetParticipatoryInfo(); ShareListBO shareListBo = new ShareListBO(); shareListBo.DtTo = dtTo; shareListBo.DtFrom = dtFrom; shareListBo.WorkStation = workStation; DataTable dataTable = new DataTable(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); string TempWorkstation = ""; int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Workstation_wise_Trade_Share_List); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (workStation == "All") { TempWorkstation = recordLevelFilteringBAL.FilterWorkStation_All(workStation, resourceId, criteriaId); if (TempWorkstation == "All") { dataTable = shareBal.GetShareInfo(shareListBo); } else { dataTable = shareBal.GetShareInfo(shareListBo); dataTable.Rows.Clear(); } } else { dataTable = shareBal.GetShareInfo(shareListBo); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation(workStation, resourceId, criteriaId); if (TempWorkstation == "") { dataTable.Rows.Clear(); } } crShareReport crShareListReport = new crShareReport(); ((TextObject)crShareListReport.ReportDefinition.ReportObjects["txtCompanyName"]).Text = dtParticipatoryInfo.Rows[0]["Name"].ToString(); ((TextObject)crShareListReport.ReportDefinition.ReportObjects["txtBranchName"]).Text = dtParticipatoryInfo.Rows[0]["Branch_Name"].ToString() + " Branch" + dtParticipatoryInfo.Rows[0]["Address"].ToString(); if (shareListBo.DtFrom != null && shareListBo.DtTo != null) { ((TextObject)crShareListReport.ReportDefinition.Sections[2].ReportObjects["txtReportDuration"]).Text = "From " + shareListBo.DtFrom.ToShortDateString() + " To " + shareListBo.DtTo.ToShortDateString(); } crShareListReport.SetDataSource(dataTable); CrvShareList.ReportSource = crShareListReport; }
private void GetCommonOpexReport(DateTime fromDate, DateTime toDate) { try { cr_CommonExpenditureReport objcrCommonOpex = new cr_CommonExpenditureReport(); DataTable dataTable = new DataTable(); frmReportViewer objReportviewer = new frmReportViewer(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); int TempBranchId = -2; OpexBAL objOpexBal = new OpexBAL(); int BranchId = Int32.Parse(ddlBranchList.SelectedValue.ToString()); int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Common_Expenditure); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (BranchId == 0) { TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterWorkStation_All(BranchId.ToString(), resourceId, criteriaId)); if (TempBranchId == 0) { dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId); } else { dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId); dataTable.Rows.Clear(); } } else { TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(BranchId.ToString(), resourceId, criteriaId)); dataTable = objOpexBal.GetCommonOpexReport(fromDate, toDate, TempBranchId); } objcrCommonOpex.SetDataSource(dataTable); GetCommonInfo(); ((TextObject)objcrCommonOpex.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcrCommonOpex.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; ((TextObject)objcrCommonOpex.ReportDefinition.Sections[2].ReportObjects["txtReport"]).Text = "Common Expenditure"; ((TextObject)objcrCommonOpex.ReportDefinition.Sections[2].ReportObjects["txtFrom"]).Text = fromDate.ToString("yyyy"); ((TextObject)objcrCommonOpex.ReportDefinition.Sections[2].ReportObjects["txtTo"]).Text = toDate.ToString("yyyy"); ((TextObject)objcrCommonOpex.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = ddlBranchList.Text; objReportviewer.crvReportViewer.ReportSource = objcrCommonOpex; objReportviewer.crvReportViewer.ShowGroupTreeButton = false; objReportviewer.Text = "Common Expenditure"; objReportviewer.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void SetExistingPrevillizeState() { RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Trade_Summery_Report_default); criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); isAllLimit = recordLevelFilteringBAL.Check_All_Limit(resourceId, criteriaId); isAllHide = recordLevelFilteringBAL.Check_All_Hide(resourceId, criteriaId); isExistLimit = recordLevelFilteringBAL.isExistLimit(resourceId, criteriaId); isExistHide = recordLevelFilteringBAL.isExistHide(resourceId, criteriaId); }
private void ShowMonthlyExpenseReport(DateTime FromDate, DateTime ToDate) { try { AssetInformationBAL objAssetInfoBal = new AssetInformationBAL(); DataTable dtMonthlyExpenseInfo = new DataTable(); cr_MonthlyExpenseReport objcrMonthlyExpenseInfo = new cr_MonthlyExpenseReport(); frmReportViewer objfrmMonthlyExpenseInfo = new frmReportViewer(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); int TempBranchId = -2; dtMonthlyExpenseInfo = objAssetInfoBal.GetMonthlyCapexReport(FromDate, ToDate); int branchid = Int32.Parse(dtMonthlyExpenseInfo.Rows[0][10].ToString()); int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Monthly_Expense_List); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchid.ToString(), resourceId, criteriaId)); if (TempBranchId == -1) { dtMonthlyExpenseInfo.Rows.Clear(); } objcrMonthlyExpenseInfo.SetDataSource(dtMonthlyExpenseInfo); ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtFromDate"]).Text = "Fom: " + dtpFromDate.Value.ToString("MM-dd-yyyy"); ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtToDate"]).Text = "To: " + dtpToDate.Value.ToString("MM-dd-yyyy"); GetCommonInfo(); ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; objfrmMonthlyExpenseInfo.Text = "Monthly Expense Report"; objfrmMonthlyExpenseInfo.crvReportViewer.ReportSource = objcrMonthlyExpenseInfo; objfrmMonthlyExpenseInfo.Show(); } catch (Exception) { throw; } }
private void GetCurrentAssetList() { try { AssetInformationBAL objAssetInformationBal = new AssetInformationBAL(); DataTable dtCurrentAssetList = new DataTable(); frmReportViewer objfrmReportViewer = new frmReportViewer(); cr_CurrentAssetList objcrCurrentAssetList = new cr_CurrentAssetList(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); dtCurrentAssetList = objAssetInformationBal.GetCurrentAssetInfo(); int TempBranchId = -2; int branchid = Int32.Parse(dtCurrentAssetList.Rows[0][8].ToString()); int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Current_Asset_List); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchid.ToString(), resourceId, criteriaId)); if (TempBranchId == -1) { dtCurrentAssetList.Rows.Clear(); } objcrCurrentAssetList.SetDataSource(dtCurrentAssetList); GetCommonInfo(); ((TextObject)objcrCurrentAssetList.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcrCurrentAssetList.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; objfrmReportViewer.crvReportViewer.ReportSource = objcrCurrentAssetList; objfrmReportViewer.crvReportViewer.DisplayGroupTree = false; objfrmReportViewer.Text = "Current Asset List"; objfrmReportViewer.Show(); } catch (Exception) { throw; } }
private void GetCustomizedOpexReport(DateTime fromDate, DateTime toDate) { try { cr_CustomizedOpex objcrcustomizedOpex = new cr_CustomizedOpex(); DataTable dataTable = new DataTable(); frmReportViewer objReportviewer = new frmReportViewer(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); OpexBAL objOpexBal = new OpexBAL(); int TempBranchId = -2; int BranchId = Int32.Parse(ddlBranchList.SelectedValue.ToString()); int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Daily_Expenditure_Customized_Opex); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (BranchId == 0) { TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterWorkStation_All(BranchId.ToString(), resourceId, criteriaId)); if (BranchId != TempBranchId) { MessageBox.Show("You are restricted"); return; } else { dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId); } } else { TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(BranchId.ToString(), resourceId, criteriaId)); if (BranchId != TempBranchId) { MessageBox.Show("You are restricted"); return; } else { dataTable = objOpexBal.GetCustomizedOpexReport(fromDate, toDate, TempBranchId); } } objcrcustomizedOpex.SetDataSource(dataTable); GetCommonInfo(); ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtReport"]).Text = "Daily Opex Report: Customized"; ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtFrom"]).Text = fromDate.ToString("MMMM-yyyy"); ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtTo"]).Text = toDate.ToString("MMMM-yyyy"); ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = ddlBranchList.Text; objReportviewer.crvReportViewer.ReportSource = objcrcustomizedOpex; objReportviewer.crvReportViewer.DisplayGroupTree = true; objReportviewer.Text = "Daily Opex Report: Customized"; objReportviewer.Show(); } catch (Exception) { throw; } }
private void GetDailyDaywiseOpexReport(DateTime fromDate, DateTime toDate) { try { cr_groupByBranchDailyOpexReport objcrDailyOpex = new cr_groupByBranchDailyOpexReport(); DataTable dataTable = new DataTable(); frmReportViewer objReportviewer = new frmReportViewer(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); OpexBAL objOpexBal = new OpexBAL(); int TempBranchId = -2; int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Daily_Expenditure_group_By_Branch_Daily_Opex_Report); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); int branchId = Int32.Parse(ddlBranchList.SelectedValue.ToString()); if (branchId == 0) { TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterWorkStation_All(branchId.ToString(), resourceId, criteriaId)); if (TempBranchId == 0) { dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId); } else { //dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, branchId); //dataTable.Rows.Clear(); MessageBox.Show("You are restricted"); return; } } else if (branchId != 0) { TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchId.ToString(), resourceId, criteriaId)); if (branchId != TempBranchId) { MessageBox.Show("You are restricted"); return; } dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId); } objcrDailyOpex.SetDataSource(dataTable); GetCommonInfo(); ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtReportTitle"]).Text = "Day wise Daily Opex "; ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtFromDate"]).Text = fromDate.ToString("dd-MMM-yyyy"); ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtToDate"]).Text = toDate.ToString("dd-MMM-yyyy"); ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtBranchName"]).Text = ddlBranchList.Text; objReportviewer.crvReportViewer.ReportSource = objcrDailyOpex; objReportviewer.Text = "Daily Opex Report : Day wise"; objReportviewer.Show(); } catch (Exception) { throw; } }
//private void GetReport(int BranchID, int CatgId, int FreqId, DateTime fromDate, DateTime toDate, string Grouping) //{ // try // { // if (Grouping == Indication_ExpenseReports.Expense_Grouping_Monthly) // { // cr_MonthlyOpex objcrmonthlyopex = new cr_MonthlyOpex(); // DataTable datatable = new DataTable(); // frmReportViewer objreportviewer = new frmReportViewer(); // RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL(); // ExpenseEntryBAL exbal = new ExpenseEntryBAL(); // int tempbranchid = -2; // int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex); // int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid); // if (BranchID == Indication_BrokerBranch.HeadOffice_ID) // { // tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid)); // if (BranchID != tempbranchid) // { // MessageBox.Show("you are restricted"); // return; // } // else // { // datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate); // } // } // else // { // tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid)); // if (BranchID != tempbranchid) // { // MessageBox.Show("you are restricted"); // return; // } // else // { // datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate); // } // } // objcrmonthlyopex.SetDataSource(datatable); // GetCommonInfo(); // ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName; // ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text = "Branch name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; // ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtreport"]).Text = Selected_CategoryType_Name +" Report: Monthly Wise"; // ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-mmm-yyyy"); // ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy"); // ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtbranchname"]).Text = _branchName; // objreportviewer.crvReportViewer.ReportSource = objcrmonthlyopex; // objreportviewer.Text = Selected_CategoryType_Name + " Report: Monthly wise"; // objreportviewer.Show(); // } // else if (Grouping == Indication_ExpenseReports.Expense_Grouping_Daily) // { // cr_DailyOpex objctDailyOpex = new cr_DailyOpex(); // DataTable datatable = new DataTable(); // frmReportViewer objreportviewer = new frmReportViewer(); // RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL(); // ExpenseEntryBAL exbal = new ExpenseEntryBAL(); // int tempbranchid = -2; // int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex); // int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid); // if (BranchID == Indication_BrokerBranch.HeadOffice_ID) // { // tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid)); // if (BranchID != tempbranchid) // { // MessageBox.Show("you are restricted"); // return; // } // else // { // datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate); // } // } // else // { // tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid)); // if (BranchID != tempbranchid) // { // MessageBox.Show("you are restricted"); // return; // } // else // { // datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate); // } // } // objctDailyOpex.SetDataSource(datatable); // GetCommonInfo(); // ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName; // ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; // ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtreport"]).Text = Selected_CategoryType_Name+" Report: Daily Wise"; // ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-mmm-yyyy"); // ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy"); // //((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtbranchname"]).Text = _branchName; // objreportviewer.crvReportViewer.ReportSource = objctDailyOpex; // objreportviewer.Text = Selected_CategoryType_Name + " Report: Daily wise"; // objreportviewer.Show(); // } // else if (Grouping == Indication_ExpenseReports.Expense_Grouping_Yearly) // { // cr_YearlyOPex objctYearlyOpex = new cr_YearlyOPex(); // DataTable datatable = new DataTable(); // frmReportViewer objreportviewer = new frmReportViewer(); // RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL(); // ExpenseEntryBAL exbal = new ExpenseEntryBAL(); // int tempbranchid = -2; // int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex); // int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid); // if (BranchID == Indication_BrokerBranch.HeadOffice_ID) // { // tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid)); // if (BranchID != tempbranchid) // { // MessageBox.Show("you are restricted"); // return; // } // else // { // datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate); // } // } // else // { // tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid)); // if (BranchID != tempbranchid) // { // MessageBox.Show("you are restricted"); // return; // } // else // { // datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate); // } // } // objctYearlyOpex.SetDataSource(datatable); // GetCommonInfo(); // ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName; // ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text = "branch name:" + _branchName + "," + _branchAddress + ". phone:" + _branchContactNumber; // ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtreport"]).Text = Selected_CategoryType_Name+ " Report: Yearly wise"; // ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-mmm-yyyy"); // ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy"); // ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtbranchname"]).Text = _branchName; // objreportviewer.crvReportViewer.ReportSource = objctYearlyOpex; // objreportviewer.Text = Selected_CategoryType_Name + " Report: Yearly wise"; // objreportviewer.Show(); // } // } // catch (Exception) // { // throw; // } //} private void GetReport(int BranchID, int CatgId, int FreqId, DateTime fromDate, DateTime toDate, string Grouping) { try { cr_ExpenseReport objcrmonthlyopex = new cr_ExpenseReport(); DataTable datatable = new DataTable(); frmReportViewer objreportviewer = new frmReportViewer(); RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL(); ExpenseEntryBAL exbal = new ExpenseEntryBAL(); bool IsExpensedate = false; int tempbranchid = -2; int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex); int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid); if (rd_ExpenseDate.Checked) { IsExpensedate = rd_ExpenseDate.Checked; } if (BranchID == Indication_BrokerBranch.HeadOffice_ID) { tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid)); if (BranchID != tempbranchid) { MessageBox.Show("you are restricted"); return; } else { datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate, IsExpensedate); } } else { tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid)); if (BranchID != tempbranchid) { MessageBox.Show("you are restricted"); return; } else { datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate, IsExpensedate); } } ParameterDiscreteValue pdv = new ParameterDiscreteValue(); pdv.Value = (object)Grouping; objcrmonthlyopex.SetDataSource(datatable); GetCommonInfo(); ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName; ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;; ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-MMM-yyyy") + " To " + toDate.ToString("dd-MMM-yyyy"); //((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy"); ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtDate"]).Text = IsExpensedate ? "Expense Date" : "Payment Date"; objcrmonthlyopex.ParameterFields["GroupingDate"].CurrentValues.Add(pdv); objreportviewer.crvReportViewer.ReportSource = objcrmonthlyopex; objreportviewer.Text = "Expense Report "; objreportviewer.Show(); } catch (Exception) { throw; } }
public void ShowTradeSummeryReport() { _workStation = ""; _branchId = GlobalVariableBO._branchId; _FromDate = dtpFrom.Value; _toDate = dtpTo.Value; _marketType = chkMarketType.Checked; _workStation = ddlWorkStation.Text; if (_workStation == "All") { _workStation = "0"; } TradeSummeryBAL tradeSummeryBal = new TradeSummeryBAL(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); GetCommonInfo(); resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Trade_Summery_Report_default); criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (_marketType) { crSpotTradeSummery crSpotTradeSumm = new crSpotTradeSummery(); SpotTradeSummeryReportViewer spotTradeSummeryReport = new SpotTradeSummeryReportViewer(); DataTable dtSpotTradeSummery = new DataTable(); string TempWorkstation = ""; // SetExistingPrevillizeState(); // FilterAllWorkStation if (_workStation == "0") { TempWorkstation = recordLevelFilteringBAL.FilterWorkStation_All(_workStation, resourceId, criteriaId); if (TempWorkstation != "") { dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); } //else if (!isAllLimit && !isAllHide && !isExistLimit && !isExistHide) //{ // dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); //} else { dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); dtSpotTradeSummery.Rows.Clear(); } } else { dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation(_workStation, resourceId, criteriaId); if (TempWorkstation == "") { dtSpotTradeSummery.Rows.Clear(); } } crSpotTradeSumm.SetDataSource(dtSpotTradeSummery); ((TextObject)crSpotTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)crSpotTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtDuration"]).Text = "From " + _FromDate.ToString("dd-MMM-yyyy") + " To " + _toDate.ToString("dd-MMM-yyyy"); ((TextObject)crSpotTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; spotTradeSummeryReport.crvSpotTradeSummery.ReportSource = crSpotTradeSumm; spotTradeSummeryReport.crvSpotTradeSummery.DisplayGroupTree = false; spotTradeSummeryReport.Show(); } else { crTradeSummery crTradeSumm = new crTradeSummery(); TradeSummeryReportViewer tradeSummeryReport = new TradeSummeryReportViewer(); DataTable dtTradeSummery = new DataTable(); DataTable dtCashFlow = new DataTable(); string TempWorkstation = ""; //int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Trade_Summery_Report_default); //int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (_workStation == "0") { //isAllLimit = recordLevelFilteringBAL.Check_All_Limit(resourceId, criteriaId); //isAllHide = recordLevelFilteringBAL.Check_All_Hide(resourceId, criteriaId); //isExistLimit = recordLevelFilteringBAL.isExistLimit(resourceId, criteriaId); //isExistHide = recordLevelFilteringBAL.isExistHide(resourceId, criteriaId); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation_All(_workStation, resourceId, criteriaId); if (TempWorkstation != "") { dtTradeSummery = tradeSummeryBal.GetTradeSummery(_workStation, _FromDate, _toDate); dtCashFlow = tradeSummeryBal.GetCashflowReport(_FromDate, _toDate); } else { dtTradeSummery = tradeSummeryBal.GetTradeSummery(_workStation, _FromDate, _toDate); dtCashFlow = tradeSummeryBal.GetCashflowReport(_FromDate, _toDate); dtTradeSummery.Rows.Clear(); dtCashFlow.Rows.Clear(); } } else { dtCashFlow = tradeSummeryBal.GetCashflowReport(_FromDate, _toDate); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation(_workStation, resourceId, criteriaId); if (TempWorkstation == "") { dtCashFlow.Rows.Clear(); } dtTradeSummery = tradeSummeryBal.GetTradeSummery(TempWorkstation, _FromDate, _toDate); } crTradeSumm.SetDataSource(dtTradeSummery); ((TextObject)crTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtDuration"]).Text = "From " + _FromDate.ToString("dd-MMM-yyyy") + " To " + _toDate.ToString("dd-MMM-yyyy"); ((TextObject)crTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)crTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; crTradeSumm.Subreports[0].SetDataSource(dtCashFlow); tradeSummeryReport.crvTradeSummery.ReportSource = crTradeSumm; tradeSummeryReport.Show(); } }