/// <summary> /// Updates a resource override. /// </summary> /// <param name="resourceOverride"></param> /// <returns></returns> public Response <ResourceOverridesViewModel> UpdateResourceOverrides(ResourceOverridesViewModel resourceOverride) { const string apiUrl = baseRoute + "UpdateResourceOverrides"; return (communicationManager.Put <ResourceOverridesModel, Response <ResourceOverridesModel> >(resourceOverride.ToModel(), apiUrl) .ToViewModel()); }
/// <summary> /// Converts viewmodel to model /// </summary> /// <param name="model">The model.</param> /// <returns></returns> public static ResourceOverridesModel ToModel(this ResourceOverridesViewModel model) { if (model == null) { return(null); } var entity = new ResourceOverridesModel { ResourceOverrideID = model.ResourceOverrideID, ResourceID = model.ResourceID, ResourceTypeID = model.ResourceTypeID, OverrideDate = model.OverrideDate, FacilityID = model.FacilityID, Comments = model.Comments, ModifiedOn = model.ModifiedOn }; return(entity); }
/// <summary> /// Converts model to viewmodel /// </summary> /// <param name="entity">The entity.</param> /// <returns></returns> public static ResourceOverridesViewModel ToViewModel(this ResourceOverridesModel entity) { if (entity == null) { return(null); } var model = new ResourceOverridesViewModel { ResourceOverrideID = entity.ResourceOverrideID, ResourceID = entity.ResourceID, ResourceTypeID = entity.ResourceTypeID, OverrideDate = entity.OverrideDate, FacilityID = entity.FacilityID, Comments = entity.Comments, ModifiedOn = entity.ModifiedOn }; return(model); }
public Response <ResourceOverridesViewModel> UpdateResourceOverrides(ResourceOverridesViewModel resourceOverride) { var response = resourceRepository.UpdateResourceOverrides(resourceOverride); return(response); }
public Response <ResourceOverridesViewModel> AddResourceOverrides(ResourceOverridesViewModel resourceOverride) { return(resourceRepository.AddResourceOverrides(resourceOverride)); }