Exemplo n.º 1
0
 /// <summary>
 /// Hire Group Detail mapper for hire group web to entity
 /// </summary>
 /// <param name="source"></param>
 /// <returns></returns>
 public static HireGroupDetailForHireGroup CreateFromForHireGroupDetail(this DomainModels.HireGroupDetail source)
 {
     return(new HireGroupDetailForHireGroup
     {
         HireGroupDetailId = source.HireGroupDetailId,
         VehicleCategoryId = source.VehicleCategoryId,
         VehicleModelId = source.VehicleModelId,
         VehicleMakeId = source.VehicleMakeId,
         VehicleCategoryCodeName = source.VehicleCategory.VehicleCategoryCode + " - " + source.VehicleCategory.VehicleCategoryName,
         VehicleModelCodeName = source.VehicleModel.VehicleModelCode + " - " + source.VehicleModel.VehicleModelName,
         VehicleMakeCodeName = source.VehicleMake.VehicleMakeCode + " - " + source.VehicleMake.VehicleMakeName,
         VehicleModelYear = source.ModelYear,
     });
 }
Exemplo n.º 2
0
 /// <summary>
 ///  Create web model from entity
 /// </summary>
 public static HireGroupDetailContent CreateFrom(this DomainModel.HireGroupDetail source)
 {
     return(new HireGroupDetailContent
     {
         HireGroupDetailId = source.HireGroupDetailId,
         HireGroup = source.HireGroup != null
                 ? source.HireGroup.HireGroupCode + " - " + source.HireGroup.HireGroupName
                 : string.Empty,
         VehicleMake = source.VehicleMake != null
                 ? source.VehicleMake.VehicleMakeCode + " - " + source.VehicleMake.VehicleMakeName
                 : string.Empty,
         VehicleModel = source.VehicleModel != null
                 ? source.VehicleModel.VehicleModelCode + " - " + source.VehicleModel.VehicleModelName
                 : string.Empty,
         VehicleCategory = source.VehicleCategory != null
                 ? source.VehicleCategory.VehicleCategoryCode + " - " + source.VehicleCategory.VehicleCategoryName
                 : string.Empty,
         ModelYear = source.ModelYear,
         HireGroupId = source.HireGroupId,
     });
 }
Exemplo n.º 3
0
        public static HireGroupDetailForAddtionalCharge CreateFromForAddtionalCharge(this DomainModel.HireGroupDetail source)
        {
            string hireGroup = source.HireGroup != null
                ? source.HireGroup.HireGroupCode + " - " + source.HireGroup.HireGroupName
                : string.Empty;
            string vehicleMake = source.VehicleMake != null
                ? source.VehicleMake.VehicleMakeCode + " - " + source.VehicleMake.VehicleMakeName
                : string.Empty;
            string vehicleModel = source.VehicleModel != null
                ? source.VehicleModel.VehicleModelCode + " - " + source.VehicleModel.VehicleModelName
                : string.Empty;
            string vehicleCategory = source.VehicleCategory != null
                ? source.VehicleCategory.VehicleCategoryCode + " - " + source.VehicleCategory.VehicleCategoryName
                : string.Empty;
            string modelYear = source.ModelYear.ToString();

            return(new HireGroupDetailForAddtionalCharge
            {
                HireGroupDetailId = source.HireGroupDetailId,
                HireGroupDetailCodeName = hireGroup + " | " + vehicleMake + " | " + vehicleModel + " | " + vehicleCategory + " | " + modelYear
            });
        }