Example #1
0
        public ActionResult SaveNonPathedHybrid(NonPathedDTO model)
        {
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();

            model.ShipperDuns = currentIdentityValues.ShipperDuns;
            model.UserId      = Guid.Parse(currentIdentityValues.UserId);
            // var pipe = pipelineService.GetPipeline(model.PipelineId);
            model.PipelineDuns = model.PipelineDuns;
            model.CompanyId    = Convert.ToInt32(currentIdentityValues.CompanyId ?? "0");
            bool result = false;
            var  Id     = nonPathedService.SaveAllNonPathedNominations(model);

            result               = (Id == Guid.Empty) ? false : true;
            ViewBag.Cycles       = _cycleIndicator.GetCycles();
            ViewBag.SubmitStatus = result;
            if (result)
            {
                TempData["status"] = "Data saved successfully";
            }
            else
            {
                TempData["status"] = "Data saving failed";
            }
            return(RedirectToAction("Index", new { pipelineDuns = model.PipelineDuns }));
        }
Example #2
0
        public ActionResult Index(NonPathedDTO model, string Search)
        {
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();

            model.ShipperDuns = currentIdentityValues.ShipperDuns;
            model.UserId      = Guid.Parse(currentIdentityValues.UserId);
            string pipelineDuns = model.PipelineDuns;

            if (Search == null)
            {
                model.CompanyId = Convert.ToInt32(currentIdentityValues.CompanyId ?? "0");
                bool result = false;
                var  Id     = nonPathedService.SaveAllNonPathedNominations(model);
                result               = (Id == Guid.Empty) ? false : true;
                ViewBag.Cycles       = ICycleIndicator.GetCycles();
                ViewBag.SubmitStatus = result;
                return(RedirectToAction("Index", new { pipelineDuns = model.PipelineDuns }));
            }
            else
            {
                model = nonPathedService.GetNonPathedNominations(model.PipelineDuns, model.StatusId, model.StartDate, model.EndDate, model.ShipperDuns, model.UserId.GetValueOrDefault());
                model = UpdateCounterPartyAndLocNameInNonPathed(model);
                model.PipelineDuns = pipelineDuns;
                ViewBag.StatusID   = metadataFileStatusService.GetNomStatus();
                ViewBag.Cycles     = ICycleIndicator.GetCycles();
                var notifier = _notifierEntityService.GetNotifierEntityForNoms(currentIdentityValues.UserId);//.GetNotifierEntityofBatchTable();
                ViewBag.NotifierEntity = notifier;
                return(View(model));
            }
        }