Beispiel #1
0
        public ActionResult OceanExport()
        {
            CheckAccess();
            OceanReportMasterModel model = new OceanReportMasterModel();
            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 = "OceanExport", typeName = TypeName }));
            }
            if (Request["PeriodBegin"] == null || Request["ReSelect"] != null)
            {
                Session["OceanExportMasterReportData"] = null;
                ViewBag.IsSelected = false;
            }
            else
            {
                ReportSelection ReportSelection = new ReportSelection();
                CultureInfo     ci = new CultureInfo("en-US");
                ReportSelection.PeriodBegin  = Convert.ToDateTime(Request["PeriodBegin"], ci);
                ReportSelection.PeriodEnd    = Convert.ToDateTime(Request["PeriodEnd"], ci);
                ReportSelection.CategorizeBy = Convert.ToString(Request["CategorizeBy"]);
                ReportSelection.WeightScale  = Convert.ToString(Request["WeightScale"]);
                ReportSelection.AnalysisOn   = Convert.ToString(Request["chkAnalysisOn"]);


                Session["OceanExportReportSelection"] = ReportSelection;
                model = GetOceanExportMasterModel();

                model.PeriodBegin  = ReportSelection.PeriodBegin;
                model.PeriodEnd    = ReportSelection.PeriodEnd;
                model.CategorizeBy = ReportSelection.CategorizeBy;
                model.WeightScale  = ReportSelection.WeightScale;
                model.AnalysisOn   = ReportSelection.AnalysisOn;

                ViewBag.IsSelected = true;
            }
            return(View(model));
        }
Beispiel #2
0
        private AirReportMasterModel GetAirExportMasterModel()
        {
            ReportSelection selection    = (ReportSelection)Session["AirExportReportSelection"];
            string          KeyFieldName = selection.CategorizeBy;

            Session["KeyFieldName"] = selection.CategorizeBy;

            AirReportMasterModel model = new AirReportMasterModel()
            {
                KeyFieldName = KeyFieldName
            };
            var data = GetAirExportTransactionalData();

            if (KeyFieldName == "Agent")
            {
                model.Elements = data.GroupBy(d => d.Agent).Select(grp => grp.First()).ToList();
            }
            if (KeyFieldName == "Shipper")
            {
                model.Elements = data.GroupBy(d => d.Shipper).Select(grp => grp.First()).ToList();
            }
            if (KeyFieldName == "Carrier")
            {
                model.Elements = data.GroupBy(d => d.Carrier).Select(grp => grp.First()).ToList();
            }

            if (KeyFieldName == "Consignee")
            {
                model.Elements = data.GroupBy(d => d.Consignee).Select(grp => grp.First()).ToList();
            }

            if (KeyFieldName == "Origin")
            {
                model.Elements = data.GroupBy(d => d.Origin).Select(grp => grp.First()).ToList();
            }

            if (KeyFieldName == "Destination")
            {
                model.Elements = data.GroupBy(d => d.Destination).Select(grp => grp.First()).ToList();
            }

            if (KeyFieldName == "Sale_Rep")
            {
                model.Elements = data.GroupBy(d => d.Sale_Rep).Select(grp => grp.First()).ToList();
            }
            return(model);
        }
Beispiel #3
0
        private List <OceanTransactionItem> GetOceanExportTransactionalData()
        {
            ReportSelection selection = (ReportSelection)Session["OceanExportReportSelection"];


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

            var model = (List <OceanTransactionItem>)Session["OceanExportMasterReportData"];

            return(model);
        }