Exemple #1
0
 public Guid?SaveAndUpdatePathedNomination(PathedDTO pathedNom, bool IsSave)
 {
     //if (IsSave)
     //    return SavePathedNomination(pathedNom);
     //else
     return(UpdatePathedNomination(pathedNom));
 }
Exemple #2
0
        public ActionResult LoadHybridPathedPartial(PathedDTO model)
        {
            ShipperReturnByIdentity currentIdentityValues = GetValueFromIdentity();

            model.DunsNo    = currentIdentityValues.ShipperDuns;
            model.companyId = String.IsNullOrEmpty(currentIdentityValues.CompanyId) ? 0 : int.Parse(currentIdentityValues.CompanyId);
            model.ShipperID = new Guid(currentIdentityValues.UserId);
            if (model.PathedNomsList == null)
            {
                TempData["status"] = "Please fill row.";
                // return RedirectToAction("Index", new { BatchId = Mainmodel.Id, pipelineId = model.PipelineID });
                return(RedirectToAction("Index", new { pipelineDuns = model.PipelineDuns }));
            }
            Guid?transactionID = _pathedNominationService.SaveAndUpdatePathedNomination(model, true);

            if (transactionID != null)
            {
                TempData["status"] = "Data saved successfully";
            }
            else
            {
                TempData["status"] = "Data saving failed";
            }
            //  return RedirectToAction("Index", new { BatchId = Mainmodel.Id, pipelineId = model.PipelineID });
            return(RedirectToAction("Index", new { pipelineDuns = model.PipelineDuns }));
        }
Exemple #3
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));
        }
Exemple #4
0
        public ActionResult AddPathedHybrid(string pipelineDuns)
        {
            PathedDTO mainmodel = new PathedDTO();

            mainmodel.PipelineDuns = pipelineDuns;
            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;

            mainmodel.PathedNomsList = new List <PathedNomDetailsDTO>();

            var      item      = new PathedNomDetailsDTO();
            DateTime todayDate = DateTime.Now.Date;

            item.StartDate        = new DateTime(todayDate.Year, todayDate.Month, todayDate.Day, 09, 00, 00);// todayDate;
            item.EndDate          = new DateTime(todayDate.AddDays(1).Year, todayDate.AddDays(1).Month, (todayDate.AddDays(1).Day), 09, 00, 00);
            item.CycleID          = 1;
            item.NomSubCycle      = "Y";
            item.MaxRate          = "Y";
            item.ProcessingRights = "Y";
            item.CreatedDate      = DateTime.Now;
            item.QuantityType     = "R";
            mainmodel.PathedNomsList.Add(item);

            return(PartialView("_AddHybridPathedRow", mainmodel));
        }
Exemple #5
0
        private Guid?UpdatePathedNomination(PathedDTO pathedNom)
        {
            try
            {
                bool isFly         = false;
                Guid TransactionID = Guid.Empty;
                foreach (var nom in pathedNom.PathedNomsList)
                {
                    isFly = false;
                    V4_Batch batch = BatchRepository.GetByTransactionID(nom.TransactionId);
                    if (batch != null)
                    {
                        ContractsDTO flyCon = new ContractsDTO();
                        // Contract con = contractService.GetContractByContractNo(nom.Contract, pathedNom.PipelineID);
                        //if (con == null)
                        //{
                        //    isFly = true;
                        //    flyCon = AddContractOnFly(nom.Contract, pathedNom.PipelineID, pathedNom.companyId, pathedNom.ShipperID.ToString(),nom.FuelPercentage);
                        //   // nom.FuelPercentage = flyCon.FuelPercentage;
                        //}
                        //else
                        //{
                        //   // nom.FuelPercentage = con.FuelPercentage;
                        //}
                        TransactionID       = batch.TransactionID;
                        batch.FlowStartDate = nom.StartDate;
                        batch.FlowEndDate   = nom.EndDate;
                        batch.CycleId       = nom.CycleID;
                        batch.NomTypeID     = (int)NomType.Pathed;
                        batch.NomSubCycle   = nom.NomSubCycle;
                        batch.CreatedBy     = pathedNom.ShipperID.ToString();
                        BatchRepository.Update(batch);
                        BatchRepository.SaveChages();

                        List <V4_Nomination> storedNom = NominationsRepository.GetAllNomsByTransactionId(batch.TransactionID);
                        if (storedNom != null && storedNom.Count > 0)
                        {
                            NominationsRepository.deleteAll(storedNom);
                        }
                        V4_Nomination nomination = new V4_Nomination();
                        nomination.AssignIdentification  = nom.AssocContract;
                        nomination.AssociatedContract    = nom.ActCode;
                        nomination.BidTransportationRate = nom.BidTransportRate;
                        nomination.BidupIndicator        = nom.BidUp;
                        nomination.CapacityTypeIndicator = nom.CapacityType;
                        // nomination.ContractNumber = !string.IsNullOrEmpty(flyCon.RequestNo) ? flyCon.RequestNo : nom.Contract;
                        nomination.ContractNumber               = nom.Contract;
                        nomination.DealType                     = nom.DealType;
                        nomination.DeliveryLocationIdentifer    = nom.DelLocID;
                        nomination.DeliveryLocationName         = nom.DelLoc;
                        nomination.DeliveryLocationPropCode     = nom.DelLocProp;
                        nomination.DeliveryRank                 = nom.DelRank;
                        nomination.DelQuantity                  = string.IsNullOrEmpty(nom.DelQuantity.ToString()) ? 0 : Convert.ToInt32(nom.DelQuantity);
                        nomination.DownstreamContractIdentifier = nom.DownContract;
                        nomination.DownstreamIdentifier         = nom.DownID;
                        nomination.DownstreamName               = nom.DownName;
                        nomination.DownstreamPackageId          = nom.DownPkgID;
                        nomination.DownstreamPropCode           = nom.DownIDProp;
                        nomination.DownstreamRank               = nom.DownRank;
                        nomination.ExportDecleration            = nom.Export;
                        nomination.FuelPercentage               = nom.FuelPercentage;
                        //nomination.ImbalancePeriod= not in pathedDTO
                        nomination.MaxRateIndicator            = nom.MaxRate;
                        nomination.NominationSubCycleIndicator = nom.NomSubCycle;
                        nomination.NominationUserData1         = nom.NomUserData1;
                        nomination.NominationUserData2         = nom.NomUserData2;
                        nomination.NominatorTrackingId         = NomTrackingID(9);
                        nomination.PackageId = nom.PkgID;
                        nomination.PathType  = "P";
                        nomination.ProcessingRightIndicator = nom.ProcessingRights;
                        nomination.Quantity = string.IsNullOrEmpty(nom.RecQty) ? 0 : Convert.ToInt32(nom.RecQty);
                        nomination.QuantityTypeIndicator     = "R";    // by default value "Receipt"
                        nomination.ReceiptLocationIdentifier = nom.RecLocID;
                        nomination.ReceiptLocationName       = nom.RecLocation;
                        nomination.receiptLocationPropCode   = nom.RecLocProp;
                        nomination.ReceiptRank = nom.RecRank;
                        nomination.ServiceProviderActivityCode = nom.ActCode;    //duplicate nomination.AssignIdentification
                        nomination.TransactionID   = batch.TransactionID;
                        nomination.TransactionType = nom.TransType;
                        var ttPathed = metadataTransactionTypeRepository.GetTTUsingIdentifier(nom.TransType, "P", pathedNom.PipelineID);
                        nomination.TransactionTypeDesc        = ttPathed != null ? ttPathed.Name : string.Empty;
                        nomination.UpstreamContractIdentifier = nom.UpKContract;
                        nomination.UpstreamIdentifier         = nom.UpID;
                        nomination.UpstreamName      = nom.UpName;
                        nomination.UpstreamPackageId = nom.UpPkgID;
                        nomination.UpstreamPropCode  = nom.UpIDProp;
                        nomination.UpstreamRank      = nom.UpRank;
                        nomination.UnitOfMeasure     = "BZ";
                        NominationsRepository.Add(nomination);
                        NominationsRepository.SaveChages();
                    }
                    else
                    {
                        SavePathedNomination(pathedNom, nom);
                    }
                }
                return(TransactionID);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Exemple #6
0
        private Guid?SavePathedNomination(PathedDTO pathedNom, PathedNomDetailsDTO pathed)
        {
            Guid transactionId = new Guid();

            try
            {
                ContractsDTO flyCon = new ContractsDTO();
                Contract     con    = contractService.GetContractByContractNo(pathed.Contract, pathedNom.PipelineID);
                if (con == null)
                {
                    flyCon = AddContractOnFly(pathed.Contract, pathedNom.PipelineID, pathedNom.companyId, pathedNom.ShipperID.ToString(), pathed.FuelPercentage);
                    //pathed.FuelPercentage = flyCon.FuelPercentage;
                }
                //else {
                //    pathed.FuelPercentage = con.FuelPercentage;
                //}


                Random ran  = new Random();
                string path = Path.GetRandomFileName();
                path = path.Replace(".", "");
                V4_Batch batch = new V4_Batch();
                batch.CreatedBy     = pathedNom.ShipperID.ToString();
                batch.CreatedDate   = DateTime.Now;
                batch.CycleId       = pathed.CycleID;
                batch.Description   = "Pathed Nomination" + DateTime.Now.ToString();
                batch.FlowEndDate   = pathed.EndDate;
                batch.FlowStartDate = pathed.StartDate;
                batch.NomSubCycle   = pathed.NomSubCycle;
                batch.IsActive      = true;

                //var nomType = PipelineTransactionTypeMapRepository.GetById(pathed.TransTypeMapId);
                //if (nomType==null || nomType.PathType=="P")
                //    batch.NomTypeID = (int)NomType.Pathed;
                //else if (nomType.PathType == "NP")
                //    batch.NomTypeID = (int)NomType.NonPathed;

                batch.NomTypeID                   = (int)NomType.Pathed;
                batch.PakageCheck                 = false;
                batch.PipelineID                  = pathedNom.PipelineID;
                batch.RankingCheck                = false;
                batch.ReferenceNumber             = ran.Next(999999999).ToString();
                batch.ScheduleDate                = DateTime.MaxValue;
                batch.ServiceRequester            = pathedNom.DunsNo;
                batch.ShowZeroCheck               = false;
                batch.ShowZeroDn                  = false;
                batch.ShowZeroUp                  = false;
                batch.StatusID                    = (int)NomStatus.Draft;
                batch.SubmitDate                  = DateTime.MaxValue;
                batch.TransactionSetControlNumber = path;
                batch.UpDnContractCheck           = false;
                batch.UpDnPkgCheck                = false;
                BatchRepository.Add(batch);
                BatchRepository.SaveChages();
                //if (nomType == null || nomType.PathType == "P")
                //{
                V4_Nomination nomination = new V4_Nomination();
                nomination.AssignIdentification  = pathed.AssocContract;
                nomination.AssociatedContract    = pathed.ActCode;
                nomination.BidTransportationRate = pathed.BidTransportRate;
                nomination.BidupIndicator        = pathed.BidUp;
                nomination.CapacityTypeIndicator = pathed.CapacityType;
                nomination.ContractNumber        = !string.IsNullOrEmpty(flyCon.RequestNo) ? flyCon.RequestNo : pathed.Contract;
                nomination.DealType = pathed.DealType;
                nomination.DeliveryLocationIdentifer = pathed.DelLocID;
                nomination.DeliveryLocationName      = pathed.DelLoc;
                nomination.DeliveryLocationPropCode  = pathed.DelLocProp;
                nomination.DeliveryRank = pathed.DelRank;
                nomination.DelQuantity  = string.IsNullOrEmpty(pathed.DelQuantity.ToString()) ? 0 : Convert.ToInt32(pathed.DelQuantity);
                nomination.DownstreamContractIdentifier = pathed.DownContract;
                nomination.DownstreamIdentifier         = pathed.DownID;
                nomination.DownstreamName      = pathed.DownName;
                nomination.DownstreamPackageId = pathed.DownPkgID;
                nomination.DownstreamPropCode  = pathed.DownIDProp;
                nomination.DownstreamRank      = pathed.DownRank;
                nomination.ExportDecleration   = pathed.Export;
                nomination.FuelPercentage      = pathed.FuelPercentage;
                //nomination.ImbalancePeriod= not in pathedDTO
                nomination.MaxRateIndicator            = pathed.MaxRate;
                nomination.NominationSubCycleIndicator = pathed.NomSubCycle;
                nomination.NominationUserData1         = pathed.NomUserData1;
                nomination.NominationUserData2         = pathed.NomUserData2;
                nomination.NominatorTrackingId         = NomTrackingID(9);
                nomination.PackageId = pathed.PkgID;
                //nomination.PathRank=pathed.p
                nomination.PathType = "P";
                nomination.ProcessingRightIndicator = pathed.ProcessingRights;
                nomination.Quantity = string.IsNullOrEmpty(pathed.RecQty) ? 0 : Convert.ToInt32(pathed.RecQty);
                nomination.QuantityTypeIndicator     = "R";   // By default value "Receipt"
                nomination.ReceiptLocationIdentifier = pathed.RecLocID;
                nomination.ReceiptLocationName       = pathed.RecLocation;
                nomination.receiptLocationPropCode   = pathed.RecLocProp;
                nomination.ReceiptRank = pathed.RecRank;
                //nomination.Route=pathed.
                nomination.ServiceProviderActivityCode = pathed.ActCode;    //duplicate nomination.AssignIdentification
                nomination.TransactionID   = batch.TransactionID;
                nomination.TransactionType = pathed.TransType;

                var ttPathed = metadataTransactionTypeRepository.GetTTUsingIdentifier(pathed.TransType, "P", pathedNom.PipelineID);
                if (ttPathed != null)
                {
                    nomination.TransactionTypeDesc = ttPathed.Name;
                }
                else
                {
                    nomination.TransactionTypeDesc = string.Empty;
                }

                nomination.UpstreamContractIdentifier = pathed.UpKContract;
                nomination.UpstreamIdentifier         = pathed.UpID;
                nomination.UpstreamName      = pathed.UpName;
                nomination.UpstreamPackageId = pathed.UpPkgID;
                nomination.UpstreamPropCode  = pathed.UpIDProp;
                nomination.UpstreamRank      = pathed.UpRank;
                nomination.UnitOfMeasure     = "BZ";
                NominationsRepository.Add(nomination);
                NominationsRepository.SaveChages();

                transactionId = batch.TransactionID;
                //}
                //else if (nomType.PathType == "NP")
                //{
                //    var ttPathed = metadataTransactionTypeRepository.GetTTUsingIdentifier(pathed.TransType, "NP", pathedNom.PipelineID);
                //    V4_Nomination nomRec= new V4_Nomination
                //    {
                //        TransactionID = batch.TransactionID,
                //        AssignIdentification = "",
                //        AssociatedContract = pathed.AssocContract,
                //        BidTransportationRate = pathed.BidTransportRate,
                //        BidupIndicator = pathed.BidUp,
                //        CapacityTypeIndicator = pathed.CapacityType,
                //        ContractNumber = pathed.Contract,
                //        DealType = pathed.DealType,
                //        DeliveryLocationIdentifer = "",
                //        DeliveryLocationPropCode = "",
                //        DeliveryRank = "",
                //        DelQuantity = 0,
                //        DownstreamContractIdentifier = "",
                //        DownstreamIdentifier = "",
                //        DownstreamPackageId = "",
                //        DownstreamPropCode = "",
                //        DownstreamRank = "",
                //        ExportDecleration = pathed.Export,
                //        FuelPercentage = pathed.FuelPercentage,
                //        ImbalancePeriod = "",
                //        MaxDeliveredQty = 0,
                //        MaxRateIndicator = pathed.MaxRate,
                //        NominationSubCycleIndicator = pathed.NomSubCycle,
                //        NominationUserData1 = "",
                //        NominationUserData2 = "",
                //        NominatorTrackingId = NomTrackingID(9),
                //        PackageId = pathed.PkgIDRec,
                //        PackageId2 = "",
                //        PathRank = "",
                //        PathType = "NPR",
                //        ProcessingRightIndicator = pathed.ProcessingRights,
                //        receiptLocationPropCode = pathed.RecLocProp,
                //        ReceiptLocationIdentifier = pathed.RecLocID,
                //        ReceiptRank = pathed.RecRank,
                //        Route = "",
                //        ServiceProviderActivityCode = "",
                //        TransactionType = pathed.TransType,
                //        TransactionTypeDesc = (ttPathed!=null)?ttPathed.Name:string.Empty,
                //        UnitOfMeasure = "BZ",
                //        UpstreamContractIdentifier = pathed.UpKContract,
                //        UpstreamIdentifier = pathed.UpID,
                //        UpstreamPackageId = pathed.UpPkgID,
                //        UpstreamPropCode = pathed.UpIDProp,
                //        UpstreamRank = pathed.UpRank,
                //        Quantity = string.IsNullOrEmpty(pathed.RecQty) ? 0 : Convert.ToInt32(pathed.RecQty),
                //        QuantityTypeIndicator = "R"
                //    };
                //    V4_Nomination nomDel = new V4_Nomination
                //    {
                //        TransactionID = batch.TransactionID,
                //        AssignIdentification = "",
                //        AssociatedContract = pathed.AssocContract,
                //        BidTransportationRate = pathed.BidTransportRate,
                //        BidupIndicator = pathed.BidUp,
                //        CapacityTypeIndicator = pathed.CapacityType,
                //        ContractNumber = pathed.Contract,
                //        DealType = pathed.DealType,
                //        DeliveryLocationIdentifer = pathed.DelLocID,
                //        DeliveryLocationPropCode = pathed.DelLocProp,
                //        DeliveryRank = pathed.DelRank,
                //        DelQuantity = Convert.ToInt32(pathed.DelQuantity),
                //        DownstreamContractIdentifier = pathed.DownContract,
                //        DownstreamIdentifier = pathed.DownID,
                //        DownstreamPackageId = pathed.DownPkgID,
                //        DownstreamPropCode = pathed.DownIDProp,
                //        DownstreamRank = pathed.DownRank,
                //        ExportDecleration = pathed.Export,
                //        FuelPercentage = pathed.FuelPercentage,
                //        ImbalancePeriod = "",
                //        MaxDeliveredQty = 0,
                //        MaxRateIndicator = pathed.MaxRate,
                //        NominationSubCycleIndicator = pathed.NomSubCycle,
                //        NominationUserData1 = "",
                //        NominationUserData2 = "",
                //        NominatorTrackingId = NomTrackingID(9),
                //        PackageId2 = "",
                //        PackageId = pathed.PkgID,
                //        PathRank = "",
                //        PathType = "NPD",
                //        ProcessingRightIndicator = pathed.ProcessingRights,
                //        receiptLocationPropCode = "",
                //        ReceiptLocationIdentifier = pathed.ProcessingRights,
                //        ReceiptRank = "",
                //        Route = "",
                //        ServiceProviderActivityCode = pathed.ActCode,
                //        TransactionType = pathed.TransType,
                //        TransactionTypeDesc = ttPathed!=null ? ttPathed.Name : string.Empty,
                //        UnitOfMeasure = "BZ",
                //        UpstreamContractIdentifier = "",
                //        UpstreamIdentifier = "",
                //        UpstreamPackageId = "",
                //        UpstreamPropCode = "",
                //        UpstreamRank = "",
                //        Quantity = 0,
                //        QuantityTypeIndicator = "D"
                //    };
                //   if (pathed.PathedHybridNonpathedType == 5 || pathed.PathedHybridNonpathedType == 7 || pathed.PathedHybridNonpathedType == 10)
                //    {
                //        NominationsRepository.Add(nomDel);
                //    }    //  5 7  10  delivery only   // receipt only- 3,9,   // both- 1,2,4,6,8
                //   else if (pathed.PathedHybridNonpathedType == 3 || pathed.PathedHybridNonpathedType == 9)
                //    {
                //        NominationsRepository.Add(nomRec);
                //    }
                //   else
                //    {
                //        NominationsRepository.Add(nomRec);
                //        NominationsRepository.Add(nomDel);
                //    }
                //    NominationsRepository.SaveChages();
                //}

                return(transactionId);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Exemple #7
0
 public void SavePathedBulkUpload(PathedDTO pathed, bool IsSave)
 {
     PathedNominationService.SaveAndUpdatePathedNomination(pathed, true);
 }
Exemple #8
0
        public PartialViewResult CopyHybridPathedRow(List <PathedNomDetailsDTO> PathedRecordToCopy, string pipelineDuns)
        {
            PathedDTO model = new PathedDTO();

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

            ViewBag.Cycles       = CycleIndicator;
            ViewBag.QuantityType = QuantityType;
            ViewBag.CapacityType = CapacityType;
            ViewBag.BidUp        = BidUp;
            ViewBag.Export       = Export;
            ViewBag.StatusID     = Status1;

            var item  = new PathedNomDetailsDTO();
            var today = DateTime.Now;

            if (PathedRecordToCopy[0].StartDate < today)
            {
                var time = PathedRecordToCopy[0].StartDate.TimeOfDay;
                item.StartDate = today.Date.Add(time);
            }
            else
            {
                item.StartDate = PathedRecordToCopy[0].StartDate;
            }

            if (PathedRecordToCopy[0].EndDate < today)
            {
                var nextDay = DateTime.Now.AddDays(1);
                var time1   = PathedRecordToCopy[0].EndDate.TimeOfDay;
                item.EndDate = nextDay.Date.Add(time1);
            }
            else
            {
                item.EndDate = PathedRecordToCopy[0].EndDate;
            }
            if (item.EndDate < item.StartDate)
            {
                var nextDay = item.StartDate.AddDays(1);
                var time1   = PathedRecordToCopy[0].EndDate.TimeOfDay;
                item.EndDate = nextDay.Date.Add(time1);
            }
            // item.StartDate = PathedRecordToCopy[0].StartDate.Date < DateTime.Now.Date ? DateTime.Now.Date : PathedRecordToCopy[0].StartDate.Date;
            // item.EndDate = PathedRecordToCopy[0].EndDate.Date < DateTime.Now.Date ? DateTime.Now.AddDays(1).Date : PathedRecordToCopy[0].EndDate.Date;
            item.CycleID          = PathedRecordToCopy[0].CycleID;
            item.Contract         = PathedRecordToCopy[0].Contract;
            item.NomSubCycle      = PathedRecordToCopy[0].NomSubCycle;
            item.TransType        = PathedRecordToCopy[0].TransType;
            item.TransTypeMapId   = PathedRecordToCopy[0].TransTypeMapId;
            item.RecLocation      = PathedRecordToCopy[0].RecLocation;
            item.RecLocProp       = PathedRecordToCopy[0].RecLocProp;
            item.RecLocID         = PathedRecordToCopy[0].RecLocID;
            item.UpName           = PathedRecordToCopy[0].UpName;
            item.UpIDProp         = PathedRecordToCopy[0].UpIDProp;
            item.UpID             = PathedRecordToCopy[0].UpID;
            item.DelLoc           = PathedRecordToCopy[0].DelLoc;
            item.DelLocID         = PathedRecordToCopy[0].DelLocID;
            item.DelLocProp       = PathedRecordToCopy[0].DelLocProp;
            item.DownID           = PathedRecordToCopy[0].DownID;
            item.DownIDProp       = PathedRecordToCopy[0].DownIDProp;
            item.DownName         = PathedRecordToCopy[0].DownName;
            item.QuantityType     = PathedRecordToCopy[0].QuantityType;
            item.MaxRate          = PathedRecordToCopy[0].MaxRate;
            item.CapacityType     = PathedRecordToCopy[0].CapacityType;
            item.BidUp            = PathedRecordToCopy[0].BidUp;
            item.Export           = PathedRecordToCopy[0].Export;
            item.ProcessingRights = PathedRecordToCopy[0].ProcessingRights;

            item.UpKContract = PathedRecordToCopy[0].UpKContract;
            item.RecQty      = PathedRecordToCopy[0].RecQty;
            item.RecRank     = PathedRecordToCopy[0].RecRank;

            item.DownContract = PathedRecordToCopy[0].DownContract;
            item.DelQuantity  = PathedRecordToCopy[0].DelQuantity;
            item.DelRank      = PathedRecordToCopy[0].DelRank;

            item.PkgID            = PathedRecordToCopy[0].PkgID;
            item.NomUserData1     = PathedRecordToCopy[0].NomUserData1;
            item.NomUserData2     = PathedRecordToCopy[0].NomUserData2;
            item.ActCode          = PathedRecordToCopy[0].ActCode;
            item.BidTransportRate = PathedRecordToCopy[0].BidTransportRate;
            item.AssocContract    = PathedRecordToCopy[0].AssocContract;
            item.DealType         = PathedRecordToCopy[0].DealType;
            item.FuelPercentage   = PathedRecordToCopy[0].FuelPercentage;

            item.UpPkgID   = PathedRecordToCopy[0].UpPkgID;
            item.DownPkgID = PathedRecordToCopy[0].DownPkgID;
            item.UpRank    = PathedRecordToCopy[0].UpRank;
            item.DownRank  = PathedRecordToCopy[0].DownRank;

            item.CreatedDate = DateTime.Now;

            model.PathedNomsList = new List <PathedNomDetailsDTO>();
            model.PathedNomsList.Add(item);

            return(PartialView("_AddHybridPathedRow", model));
        }