Ejemplo n.º 1
0
        // GET: CustomUPRDRequest
        public ActionResult Index(string pipelineDuns)
        {
            CustomUPRDReqDTO dto  = new CustomUPRDReqDTO();
            var         pipelines = GetPipelines();
            PipelineDTO pipe      = pipelines.Where(a => a.DUNSNo == pipelineDuns).FirstOrDefault();

            if (pipe != null)
            {
                ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();
                ViewBag.NotifierEntity = _notifierEntityService.GetNotifierEntityOfUprdStatus();
                var pipelineEDISetting = pipelineEDISettingService.GetPipelineSetting((int)DataSet.Upload_of_Requests_for_Download_of_Posted_Datasets, pipe.DUNSNo, currentIdentityValues.ShipperDuns);
                if (pipelineEDISetting != null)
                {
                    dto.EndDate     = pipelineEDISetting.EndDate;
                    dto.StartDate   = pipelineEDISetting.StartDate;
                    dto.pipelineId  = pipe.ID;
                    dto.pipeDuns    = pipe.DUNSNo;
                    dto.shipperDuns = currentIdentityValues.ShipperDuns;
                    if (pipelineEDISetting.ForOacy)
                    {
                        dto.RequestFor = 1;
                    }
                    if (pipelineEDISetting.ForUnsc)
                    {
                        dto.RequestFor = 2;
                    }
                    if (pipelineEDISetting.ForSwnt)
                    {
                        dto.RequestFor = 3;
                    }
                }
            }
            return(View(dto));
        }
Ejemplo n.º 2
0
 public ActionResult Edit(PipelineDTO pipe)
 {
     if (ModelState.IsValid)
     {
         if (pipelinesService.UpdatePipeline(pipe))
         {
             return(RedirectToAction("Index"));
         }
     }
     return(View(pipe));
 }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
0
        public bool UpdatePipeline(PipelineDTO pipeDTO)
        {
            var pipe = _IPipelineRepository.GetById(pipeDTO.ID);

            if (pipe != null)
            {
                pipe.IsUprdActive = pipeDTO.IsUprdActive;
                pipe.ModelTypeID  = pipeDTO.ModelTypeID;
                _IPipelineRepository.Update(pipe);
                _IPipelineRepository.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            List <PipelineDTO> list = new List <PipelineDTO>();

            list = GetPipelines();

            var FilterResponse = list.Where(x => x.IsNoms || x.IsUPRD);

            if (FilterResponse == null)
            {
                FilterResponse = new List <PipelineDTO>();
            }

            if (FilterResponse != null)
            {
                var PipelineDuns = Request["pipelineDuns"] == null?Convert.ToString(FilterResponse.Select(a => a.DUNSNo).FirstOrDefault()) : Request["pipelineDuns"];

                string Absoluteurl     = HttpContext.Request.Url.AbsoluteUri;
                var    parpipelineDuns = HttpUtility.ParseQueryString(Absoluteurl.Substring(
                                                                          new[] { 0, Absoluteurl.IndexOf('?') }.Max()
                                                                          )).Get("pipelineDuns");
                PipelineDTO objPipeline = FilterResponse.Where(y => y.DUNSNo == parpipelineDuns).FirstOrDefault();

                if (objPipeline == null)
                {
                    objPipeline = FilterResponse.FirstOrDefault();
                }

                if (Absoluteurl.Contains("MOperationalCapacity") || Absoluteurl.Contains("MUnsubscribedCapacity") ||
                    Absoluteurl.Contains("Notices"))
                {
                    isPermission = (objPipeline.IsUPRD == true ? objPipeline.IsUPRD : false);
                }
                else if (Absoluteurl.Contains("PathedNomination") || Absoluteurl.Contains("NonPathed") || Absoluteurl.Contains("PNTNominations") ||
                         Absoluteurl.Contains("SQTSSummary") || Absoluteurl.Contains("Batch"))
                {
                    isPermission = (objPipeline.IsNoms == true ? objPipeline.IsNoms : false);
                }
                ViewBag.IsPermission = isPermission;

                ViewBag.objPipeline = objPipeline;

                base.OnActionExecuting(filterContext);
            }
        }
Ejemplo n.º 6
0
        public ActionResult Index(string pipelineDuns)
        {
            LocationsDTO            model = new LocationsDTO();
            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;
            }
            else
            {
                pipelineDuns = Request["pipelineDuns"] != null ? Request["pipelineDuns"].ToString() : pipelineDuns;
            }
            model.PipelineDuns = pipelineDuns;
            return(View(model));
        }
Ejemplo n.º 7
0
        public ActionResult Index(string val, string pipelineDuns)
        {
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();
            //if (pipelineId == null)
            //    pipelineId = currentIdentityValues.FirstSelectedPipeIdByUser;

            var value = val == null ? "loc" : val;

            ViewBag.SqtsType = value;
            if (value == "loc")
            {
                ViewBag.IsSqtsForLoc = true;
            }
            else
            {
                ViewBag.IsSqtsForLoc = false;
            }
            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)
            {
                // NomType modelType = _pipelineService.GetPathTypeByPipelineDuns(_pipelineService.GetDunsByPipelineID(pipelineId.Value));
                ViewBag.PipelineNomType = GetPathTypeByPipelineType(pipe.ModelTypeID);
                ViewBag.PipelineDuns    = pipe.DUNSNo;
            }
            return(View());
        }
Ejemplo n.º 8
0
        public ActionResult Index(string pipelineDuns)
        {
            if (TempData["status"] != null)
            {
                ViewBag.Status = TempData["status"] + "";
            }
            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();
            }
            // var pipe = pipelineService.GetPipeline(pipelineId);
            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.NonPathed)
            {
                return(RedirectToAction("Index", "NonPathed", new { pipelineDuns = pipe.DUNSNo }));
            }

            ViewBag.PipelineDuns = pipelineDuns;
            ViewBag.ModelTypeID  = pipe.ModelTypeID;
            ViewBag.Pipelinename = pipe.Name;
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();
            var notifier = _notifierEntityService.GetNotifierEntityForNoms(currentIdentityValues.UserId);//GetNotifierEntityofBatchTable();

            ViewBag.NotifierEntity = notifier;
            return(View());
        }