Пример #1
0
        public ActionResult Index(string pipelineDuns)
        {
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();

            PipelineDTO pipe = new PipelineDTO();

            if (Request["pipelineDuns"] == null || string.IsNullOrEmpty(pipelineDuns))
            {
                var pipes = GetPipelines();
                pipelineDuns = pipes.Count > 0 ? pipes.FirstOrDefault().DUNSNo : string.Empty;
                pipe         = pipes.Count > 0 ? pipes.FirstOrDefault() : new PipelineDTO();
            }
            else
            {
                pipelineDuns = Request["pipelineDuns"] != null ? Request["pipelineDuns"].ToString() : pipelineDuns;
                var pipes = GetPipelines();
                pipe = pipes.Count > 0 ? pipes.Where(a => a.DUNSNo == pipelineDuns).FirstOrDefault() : new PipelineDTO();
            }

            if (pipe != null && (pipe.ModelTypeID == (int)NomType.Pathed || pipe.ModelTypeID == (int)NomType.HyPathedNonPathed))
            {
                return(RedirectToAction("Index", "PathedNomination", new { pipelineDuns = pipe.DUNSNo }));
            }
            else if (pipe != null && (pipe.ModelTypeID == (int)NomType.PNT || pipe.ModelTypeID == (int)NomType.HyNonPathedPNT || pipe.ModelTypeID == (int)NomType.HyPathedPNT))
            {
                return(RedirectToAction("Index", "Batch", new { pipelineDuns = pipe.DUNSNo }));
            }


            NonPathedDTO model = new NonPathedDTO();

            DateTime todayDate = DateTime.Now.Date;

            model.StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            model.EndDate   = model.StartDate.AddMonths(2);
            model.UserId    = Guid.Parse(currentIdentityValues.UserId);
            int status = -1;

            model.ShipperDuns  = currentIdentityValues.ShipperDuns;
            model.PipelineDuns = pipe.DUNSNo;
            model = nonPathedService.GetNonPathedNominations(pipe.DUNSNo, status, model.StartDate, model.EndDate, model.ShipperDuns, model.UserId.GetValueOrDefault());
            model = UpdateCounterPartyAndLocNameInNonPathed(model);
            model.PipelineDuns = pipe.DUNSNo;
            ViewBag.StatusID   = metadataFileStatusService.GetNomStatus();
            ViewBag.Cycles     = ICycleIndicator.GetCycles();
            var notifier = _notifierEntityService.GetNotifierEntityForNoms(currentIdentityValues.UserId);

            ViewBag.NotifierEntity = notifier;

            return(View(model));
        }
Пример #2
0
        public ActionResult LoadHybridNonPathedPartial(string pipelineDuns)
        {
            string   PipelineDuns = "";
            DateTime todayDate    = DateTime.Now.Date;
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();
            int status = -1;

            NonPathedDTO model = nonPathedService.GetNonPathedNominations(PipelineDuns, status, DateTime.MinValue, DateTime.MaxValue, currentIdentityValues.ShipperDuns, new Guid(currentIdentityValues.UserId));

            model = UpdateCounterPartyAndLocNameInNonPathed(model);
            if (model == null)
            {
                model = new NonPathedDTO();
            }
            model.PipelineDuns = pipelineDuns;
            var CycleIndicator = _cycleIndicator.GetCycles();

            ViewBag.Cycles = CycleIndicator;
            return(PartialView("_NonPathedHybrid", model));
        }