private void AssignMSD2ToInput(Msd2 msd2) { MSD23 = new MSD23(TempData.GetKeep <MSD23>(MSD23Key)); MSD23.Year = msd2.Year; MSD23.Quarter = msd2.Quarter; MSD23.Port = msd2.ReportingPort; MSD23.PortName = _helperService.GetPortNameByCode(msd2.ReportingPort); Input.GrossWeightInwards = (double)msd2.GrossWeightInward; Input.UnitsInwards = msd2.TotalUnitsInward; Input.InwardsUnitDescription = msd2.InwardUnitDescription; Input.PassengerVehiclesInwards = msd2.PassengerVehiclesInward; Input.GrossWeightOutwards = (double)msd2.GrossWeightOutward; Input.UnitsOutwards = msd2.TotalUnitsOutward; Input.OutwardsUnitDescription = msd2.OutwardUnitDescription; Input.PassengerVehiclesOutwards = msd2.PassengerVehiclesOutward; Input.GrossWeightInwardsDescription = msd2.InwardGrossWeightDescription; Input.GrossWeightOutwardsDescription = msd2.OutwardGrossWeightDescription; IsInwardBoxVisible = msd2.InwardGrossWeightDescription == null ? false : true; IsInwardUnitBoxVisible = msd2.InwardUnitDescription == null ? false : true; IsOutwardBoxVisible = msd2.OutwardGrossWeightDescription == null ? false : true; IsOutwardUnitBoxVisible = msd2.OutwardUnitDescription == null ? false : true; }
private void AssignMSD3ToInput(Msd3 msd3) { var localMSD3 = CustomExtensions.NotNullOrEmpty(TempData) && TempData[MSD3Key] != null ? new MSD3ViewModel(TempData.GetKeep <MSD3ViewModel>(MSD3Key)) : new MSD3ViewModel();; MSD3VM.AgentSummary.Clear(); MSD23 = new MSD23(TempData.GetKeep <MSD23>(MSD23Key)); MSD23.Year = msd3.Year; MSD23.Quarter = msd3.Quarter; MSD23.Port = msd3.ReportingPort; MSD23.PortName = _helperService.GetPortNameByCode(msd3.ReportingPort); foreach (Msd3agents msd3Agent in msd3.Msd3agents) { Agent agent = new Agent { Id = Guid.NewGuid(), ShippingAgent = _context.OrgList.Where(s => s.OrgId == msd3Agent.SenderId) .Select(s => s.OrgId.ToString() + " - " + s.OrgName.ToString()).FirstOrDefault() }; MSD3VM.AgentSummary.Add(agent); localMSD3.AgentSummary.Add(agent); } ; TempData.Put(MSD3Key, localMSD3); }