private List <IncomeStatementItem> GetIncomeStatementTransactionalData() { IncomeStatementSelection selection = (IncomeStatementSelection)Session["IncomeStatementReportSelection"]; ViewBag.PeriodBegin = selection.PeriodBegin.ToShortDateString(); ViewBag.PeriodEnd = selection.PeriodEnd.ToShortDateString(); foreach (var item in selection.BranchList) { if (item.Value == selection.Branch) { ViewBag.Branch = item.Text; } } ELT.BL.ReportingBL ReportBL = new ELT.BL.ReportingBL(); if (Session["IncomeStatementReportData"] == null) { var user = GetCurrentELTUser(); string ELT_account_number = user.elt_account_number; if (ELT_account_number == null) { Response.Redirect("~/Account/Login", true); } Session["IncomeStatementReportData"] = ReportBL.GetIncomeStatementItem(ELT_account_number, selection); } var model = (List <IncomeStatementItem>)Session["IncomeStatementReportData"]; return(model); }
public ActionResult IncomeStatement(string param) { CheckAccess(); //http://e-logitech.net/IFF_MAIN/ASPX/Reports/Accounting/GLSelection.aspx?parm=incom SetSubMenu(MainMenuContext.Accounting_Financial); if (param != null) { param = "?" + param; } ViewBag.Params = param; var user = GetCurrentELTUser(); string ELT_account_number = user.elt_account_number; if (ELT_account_number == null) { Response.Redirect("~/Account/Login", true); } ViewBag.EltAccountNumber = ELT_account_number; bool forwardToPrint = false; string TypeName = ""; foreach (string typeName in GridViewExportHelper.ExportTypes.Keys) { if (Request.Params[typeName] != null) { TypeName = typeName; forwardToPrint = true; } } if (forwardToPrint) { return(RedirectToAction("ExportTo", new { Operation = "IncomeStatement", typeName = TypeName })); } if (Request["PeriodEnd"] == null || Request["ReSelect"] != null) { Session["IncomeStatementReportData"] = null; ViewBag.IsSelected = false; } else { IncomeStatementSelection ReportSelection = new IncomeStatementSelection(ELT_account_number); CultureInfo ci = new CultureInfo("en-US"); ReportSelection.PeriodBegin = Convert.ToDateTime(Request["PeriodBegin"], ci); ReportSelection.PeriodEnd = Convert.ToDateTime(Request["PeriodEnd"], ci); ReportSelection.Branch = Convert.ToString(Request["Branch"]); Session["IncomeStatementReportSelection"] = ReportSelection; ViewBag.IsSelected = true; return(View("IncomeStatement", GetIncomeStatementTransactionalData())); } return(View()); }