public IHttpActionResult FetchAllByShelve(MasterShelve shelve) { try { return(Ok(_readerModuleService.FetchAllByShelve(shelve.ShelveId))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult FetchCompleteShelve(MasterShelve shelve) { try { return(Ok(_shelveService.FetchCompleteShelve(shelve.ShelveId))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IHttpActionResult Save(MasterShelve data) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { return(Ok(_shelveService.Save(data))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public MasterShelve Save(MasterShelve data) { if (data.ShelveId == 0) { var institutionId = _securityService.GetCurrentInstitutionId(); data.InstitutionId = institutionId; } _shelveRepository.Save(data); if (data.Modules != null) { _readerModuleService.Save(data.Modules.ToList()); } _shelveRepository.Commit(); return(data); }
public void Delete(MasterShelve data) { _shelveRepository.Delete(data); _shelveRepository.Commit(); }