예제 #1
0
 public IHttpActionResult FetchAllByShelve(MasterShelve shelve)
 {
     try
     {
         return(Ok(_readerModuleService.FetchAllByShelve(shelve.ShelveId)));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
예제 #2
0
 public IHttpActionResult FetchCompleteShelve(MasterShelve shelve)
 {
     try
     {
         return(Ok(_shelveService.FetchCompleteShelve(shelve.ShelveId)));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
예제 #3
0
 public IHttpActionResult Save(MasterShelve data)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     try
     {
         return(Ok(_shelveService.Save(data)));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
예제 #4
0
        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);
        }
예제 #5
0
 public void Delete(MasterShelve data)
 {
     _shelveRepository.Delete(data);
     _shelveRepository.Commit();
 }