public async Task <bool> EditServiceProgramAsync(ServiceProgramViewModel entity, int id) { var ent = await _programRepository.GetById(id); if (ent != null) { ent.OpenHour = entity.OpenHour; ent.OpenMinute = entity.OpenMinute; ent.CloseHour = entity.CloseHour; ent.CloseMinute = entity.CloseMinute; return(await _programRepository.Update(ent)); } else { return(await Task.FromResult(false)); } }
public async Task <JsonResult> Put(ServiceProgramViewModel entity, int id) { return(Json(await _locationProgramService.EditServiceProgramAsync(entity, id))); }
public async Task <JsonResult> Post(ServiceProgramViewModel entity) { return(Json(await _locationProgramService.AddServiceProgram(entity))); }
public async Task <int> AddServiceProgram(ServiceProgramViewModel entity) { return(await _programRepository.Insert( _mapper.Map <ServiceProgramViewModel, ServiceProgram>(entity))); }