public static parking_location MapBuildingForCreate(CarParkBuildingModel model)
        {
            var entity = new parking_location();

            MapBuildingForEdit(model, entity);
            return(entity);
        }
 public static BuildingResource Map(parking_location location)
 {
     return(new BuildingResource
     {
         Id = location.Id,
         Name = location.Name,
         Longitude = location.Longitude,
         Latitude = location.Latitude
     });
 }
        public static CarParkBuildingModel MapBuildingForDisplay(parking_location model)
        {
            infringementEntities entity = new infringementEntities();

            return(new CarParkBuildingModel {
                Id = model.Id,
                Name = model.Name,
                SortOrder = model.SortOrder ?? 0,
                Address = model.Address,
                CityId = model.CityId,
                Description = model.Description,
                Latitude = model.Latitude,
                Longitude = model.Longitude
            });
        }
 public static void MapBuildingForEdit(CarParkBuildingModel model, parking_location entity)
 {
     entity.Name        = model.Name;
     entity.SortOrder   = model.SortOrder;
     entity.Address     = model.Address;
     entity.CityId      = model.CityId;
     entity.Description = model.Description;
     if (model.Latitude != null && model.Latitude != "")
     {
         entity.Latitude = model.Latitude.ToString().Trim();
     }
     else
     {
         entity.Latitude = model.Latitude;
     }
     if (model.Longitude != null && model.Longitude != "")
     {
         entity.Longitude = model.Longitude.ToString().Trim();
     }
     else
     {
         entity.Longitude = model.Longitude;
     }
 }