Exemple #1
0
        public ActionResult Save(string pipelineDuns)
        {
            BatchDetailDTO model = new BatchDetailDTO();

            model.Duns          = pipelineDuns;
            model.Description   = string.Empty;
            model.StartDateTime = DateTime.Now.Date;
            model.EndDateTime   = DateTime.Now.Date;
            model.CycleId       = 1;
            var CycleIndicator = ICycleIndicator.GetCycles();

            ViewBag.Cycles = new SelectList(CycleIndicator.AsEnumerable(), "Id", "Name", 1);


            var pipes = GetPipelines();
            var pipe  = pipes.Count > 0 ? pipes.Where(a => a.DUNSNo == pipelineDuns).FirstOrDefault() : new PipelineDTO();

            // NomType modelType = pipelineService.GetPathTypeByPipelineDuns(pipelineService.GetDunsByPipelineID(pipelineId));
            model.PipelineModelType = GetPathTypeByPipelineType(pipe.ModelTypeID);

            return(this.View(model));
        }
Exemple #2
0
        public ActionResult Index(SearchCriteriaOACY criteria)
        {
            ShipperReturnByIdentity currentIdentity = new ShipperReturnByIdentity();

            currentIdentity = GetValueFromIdentity();

            var model = new SearchCriteriaOACY();

            //model.PipelineID = criteria.PipelineID;
            model.EffectiveStartDate = criteria.EffectiveStartDate;
            model.keyword            = criteria.keyword;
            model.WatchListId        = criteria.WatchListId;
            model.Cycle    = criteria.Cycle;
            model.postTime = criteria.postTime == null ? DateTime.Now.Date + new TimeSpan(DateTime.Now.AddHours(-4).TimeOfDay.Hours, 0, 0) : criteria.postTime;
            var pipelineDuns = criteria.PipelineDuns; // piplineservice.GetDunsByPipelineID(criteria.PipelineID.Value);

            model.PipelineDuns = criteria.PipelineDuns;

            if (criteria.flagDefault)
            {
                var request = new RestRequest(string.Format("GetRecentOacyPostDate"), Method.GET);
                request.AddQueryParameter("PipelineDuns", pipelineDuns);
                var response = client.Execute <DateTime?>(request);
                model.postStartDate = response.Data != null ? response.Data : DateTime.Now.Date;
            }
            else
            {
                model.postStartDate = criteria.postStartDate;
            }
            //model.postEndDate = DateTime.Now.AddHours(-4);
            var CycleIndicator = ICycleIndicator.GetCycles();

            ViewBag.Cycles = new SelectList(CycleIndicator.AsEnumerable(), "Code", "Name", 1);
            var result = GetAllOacyDataAsync(model);

            model.OacyPerTransactionViewModel = result.Result.OacyPerTransactionViewModel;
            return(this.View(model));
        }
        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));
        }
Exemple #4
0
        public ActionResult LoadHybridPathedPartial(string pipelineDuns)
        {
            PathedDTO model = new PathedDTO();

            model.PathedNomsList = new List <PathedNomDetailsDTO>()
            {
                new PathedNomDetailsDTO()
                {
                    StartDate = DateTime.Now, EndDate = DateTime.Now, CycleID = 1
                }
            };
            model.PipelineDuns = pipelineDuns;
            DateTime todayDate = DateTime.Now.Date;
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();
            int status = -1;
            int pathedListTotalCount = _pathedNominationService.GetPathedListTotalCount(model.PipelineDuns, status, DateTime.MinValue, DateTime.Now.AddYears(1), currentIdentityValues.ShipperDuns, new Guid(currentIdentityValues.UserId));

            List <PathedNomDetailsDTO> nomlist = _pathedNominationService.GetPathedListWithPaging(model.PipelineDuns, status, DateTime.MinValue, DateTime.Now.AddYears(1), currentIdentityValues.ShipperDuns, new Guid(currentIdentityValues.UserId), new SortingPagingInfo()
            {
                CurrentPageIndex = 0, PageSize = pathedListTotalCount == 0 ? 1: pathedListTotalCount
            });

            model.PathedNomsList = UpdatePathedCounterPartyAndLoactionName(nomlist);

            var CycleIndicator = _cycleIndicator.GetCycles();
            var QuantityType   = _metadataQuantityTypeIndicatorService.GetQuantityTypes();
            var CapacityType   = _metadataCapacityTypeIndicatorService.GetCapacityTypes();
            var BidUp          = _metaDataBidUpIndicatorService.GetBidUpIndicator();
            var Export         = _metadataExportDeclarationService.GetExportDeclarations();
            var Status         = metadataFileStatusService.GetNomStatus();

            ViewBag.Cycles       = CycleIndicator;
            ViewBag.QuantityType = QuantityType;
            ViewBag.CapacityType = CapacityType;
            ViewBag.BidUp        = BidUp;
            ViewBag.Export       = Export;
            ViewBag.StatusID     = Status;
            return(PartialView("_Pathedhybrid", model));
        }