private List <TrialBalanceItem> GetTrialBalanceTransactionalData() { TrialBalanceSelection selection = (TrialBalanceSelection)Session["TrialBalanceReportSelection"]; ViewBag.AsOf = selection.PeriodEnd.ToShortDateString(); ViewBag.Branch = selection.Branch; 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["TrialBalanceMasterReportData"] == null) { var user = GetCurrentELTUser(); string ELT_account_number = user.elt_account_number; if (ELT_account_number == null) { Response.Redirect("~/Account/Login", true); } Session["TrialBalanceMasterReportData"] = ReportBL.GetTrialBalanceItem(ELT_account_number, selection); } var model = (List <TrialBalanceItem>)Session["TrialBalanceMasterReportData"]; var returnvalue = from m in model select m; return(model); }
public ActionResult TrialBalance(string param) { CheckAccess(); //http://e-logitech.net/IFF_MAIN/ASPX/Reports/Accounting/GLSelection.aspx?parm=trial 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 = "TrialBalance", typeName = TypeName })); } if (Request["PeriodEnd"] == null || Request["ReSelect"] != null) { Session["TrialBalanceMasterReportData"] = null; ViewBag.IsSelected = false; } else { TrialBalanceSelection ReportSelection = new TrialBalanceSelection(ELT_account_number); CultureInfo ci = new CultureInfo("en-US"); ReportSelection.PeriodEnd = Convert.ToDateTime(Request["PeriodEnd"], ci); ReportSelection.Branch = Convert.ToString(Request["Branch"]); Session["TrialBalanceReportSelection"] = ReportSelection; ViewBag.IsSelected = true; return(View("TrialBalance", GetTrialBalanceTransactionalData())); } return(View()); }