Пример #1
0
        private BusinessTripScheduleModel ConvertToModel(BusinessTripSchedule businessTripSchedule)
        {
            BusinessTripScheduleModel businessTripScheduleModel = new BusinessTripScheduleModel()
            {
                Id = businessTripSchedule.ID,
                BusinessTripManagementID = businessTripSchedule.BusinessTripManagementID,
                City           = businessTripSchedule.City,
                ContactCompany = businessTripSchedule.ContactCompany,
                ContactPhone   = businessTripSchedule.ContactPhone,
                Country        = businessTripSchedule.Country,
                DepartDate     = businessTripSchedule.DepartDate.Value.ToString(StringConstant.DateFormatddMMyyyy2),
                DepartTime     = $"{businessTripSchedule.DepartDate.Value.Hour}:{businessTripSchedule.DepartDate.Value.Minute}",
                DepartHour     = businessTripSchedule.DepartDate.Value.Hour,
                DepartMinute   = businessTripSchedule.DepartDate.Value.Minute,
                FlightName     = businessTripSchedule.FlightName,
                OtherSchedule  = businessTripSchedule.OtherSchedule
            };

            return(businessTripScheduleModel);
        }
Пример #2
0
        private List <BusinessTripScheduleModel> GetBusinessTripScheduleByParentId(string parentId)
        {
            List <BusinessTripScheduleModel> businessTripScheduleModelCollection = new List <BusinessTripScheduleModel>();

            int parentIdOut;

            if (!string.IsNullOrEmpty(parentId) && int.TryParse(parentId, out parentIdOut))
            {
                List <BusinessTripSchedule> businessTripScheduleCollection = _businessTripScheduleDAL.GetItemsByParentId(parentIdOut);
                if (businessTripScheduleCollection != null)
                {
                    foreach (BusinessTripSchedule businessTripSchedule in businessTripScheduleCollection)
                    {
                        BusinessTripScheduleModel businessTripScheduleModel = ConvertToModel(businessTripSchedule);
                        businessTripScheduleModelCollection.Add(businessTripScheduleModel);
                    }
                }
            }

            return(businessTripScheduleModelCollection);
        }