Esempio n. 1
0
        private List <PNLTransactionItem> GetPNLTransactionalData()
        {
            PNLSelection selection = (PNLSelection)Session["PNLReportSelection"];

            ELT.BL.ReportingBL ReportBL = new ReportingBL();
            if (Session["PNLReportData"] == null)
            {
                var    user = GetCurrentELTUser();
                string ELT_account_number = user.elt_account_number;
                if (ELT_account_number == null)
                {
                    Response.Redirect("~/Account/Login", true);
                }
                if (Session["PNLReportData"] == null)
                {
                    Session["PNLReportData"]
                        = ReportBL.GetPNLTransactionItem(int.Parse(ELT_account_number), selection);
                }
            }

            var model = (List <PNLTransactionItem>)Session["PNLReportData"];

            if (selection.ImportExport != "All")
            {
                model = (from c in model where c.ImportExport == selection.ImportExport select c).ToList();
            }
            if (selection.AirOcean != "All")
            {
                model = (from c in model where c.AirOcean == selection.AirOcean select c).ToList();
            }

            return(model);
        }
Esempio n. 2
0
        private PNLMasterModel GetPNLMasterModel()
        {
            PNLSelection   selection    = (PNLSelection)Session["PNLReportSelection"];
            string         KeyFieldName = "ID";
            PNLMasterModel model        = new PNLMasterModel()
            {
                KeyFieldName = KeyFieldName, Begin = selection.PeriodBegin, End = selection.PeriodEnd, MAWB = selection.MAWB
            };

            model.PNLTransactionItems = GetPNLTransactionalData();
            model.ImportExport        = selection.ImportExport;
            model.MAWB     = selection.MAWB;
            model.AirOcean = selection.AirOcean;
            return(model);
        }
Esempio n. 3
0
        public ActionResult PNL()
        {
            CheckAccess();
            PNLMasterModel model          = new PNLMasterModel();
            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 = "PNL", typeName = TypeName }));
            }
            if (Request["PeriodBegin"] == null || Request["ReSelect"] != null)
            {
                Session["PNLReportData"] = null;
                ViewBag.IsSelected       = false;
                if (Session["RefreshPNL"] == null)
                {
                    RefreshPNL();
                    Session["RefreshPNL"] = true;
                }
            }
            else
            {
                PNLSelection ReportSelection = new PNLSelection();
                CultureInfo  ci = new CultureInfo("en-US");
                ReportSelection.PeriodBegin   = Convert.ToDateTime(Request["PeriodBegin"], ci);
                ReportSelection.PeriodEnd     = Convert.ToDateTime(Request["PeriodEnd"], ci);
                ReportSelection.MAWB          = Convert.ToString(Request["MAWB"]);
                ReportSelection.AirOcean      = Convert.ToString(Request["AirOcean"]);
                ReportSelection.ImportExport  = Convert.ToString(Request["ImportExport"]);
                ReportSelection.MAWB          = Convert.ToString(Request["MAWB"]);
                Session["PNLReportSelection"] = ReportSelection;
                model = GetPNLMasterModel();
                ViewBag.IsSelected = true;
            }
            return(View(model));
        }