public IHttpActionResult Get() { if (divisi.Get() == null) { return(Content(HttpStatusCode.NotFound, "Data Divisi is Empty!")); } return(Ok(divisi.Get())); }
public IEnumerable <StudyDivisionContract> Get() { return(divisionsRepository .Get() .Select(d => new StudyDivisionContract { Oid = d.Oid, Name = d.GetNameByLanguage(language), Alias = d.Alias }) .OrderBy(d => d.Name)); }
public ChangeActivityOutput <DivisionDto, long> ChangeActivity(ChangeActivityInput input) { DivisionRepository.Includes.Add(r => r.LastModifierUser); DivisionRepository.Includes.Add(r => r.CreatorUser); DivisionRepository.Includes.Add(r => r.Teams); Division divisionEntity = DivisionRepository.Get(input.EntityId); if (divisionEntity == null) { throw new CityQuestItemNotFoundException(CityQuestConsts.CityQuestItemNotFoundExceptionMessageBody, "\"Division\""); } if (!DivisionPolicy.CanChangeActivityForEntity(divisionEntity)) { throw new CityQuestPolicyException(CityQuestConsts.CQPolicyExceptionChangeActivityDenied, "\"Division\""); } divisionEntity.IsActive = input.IsActive == null ? !divisionEntity.IsActive : (bool)input.IsActive; DivisionDto newDivisionDto = (divisionEntity).MapTo <DivisionDto>(); DivisionRepository.Update(divisionEntity); DivisionRepository.Includes.Clear(); return(new ChangeActivityOutput <DivisionDto, long>() { Entity = newDivisionDto }); }
public UpdateOutput <DivisionDto, long> Update(UpdateInput <DivisionDto, long> input) { Division newDivisionEntity = input.Entity.MapTo <Division>(); if (newDivisionEntity == null) { throw new CityQuestItemNotFoundException(CityQuestConsts.CityQuestItemNotFoundExceptionMessageBody, "\"Division\""); } if (!DivisionPolicy.CanUpdateEntity(newDivisionEntity)) { throw new CityQuestPolicyException(CityQuestConsts.CQPolicyExceptionUpdateDenied, "\"Division\""); } DivisionRepository.Includes.Add(r => r.LastModifierUser); DivisionRepository.Includes.Add(r => r.CreatorUser); DivisionRepository.Includes.Add(r => r.Teams); DivisionRepository.Update(newDivisionEntity); DivisionDto newDivisionDto = (DivisionRepository.Get(newDivisionEntity.Id)).MapTo <DivisionDto>(); DivisionRepository.Includes.Clear(); return(new UpdateOutput <DivisionDto, long>() { UpdatedEntity = newDivisionDto }); }
public DeleteOutput <long> Delete(DeleteInput <long> input) { Division divisionEntityForDelete = DivisionRepository.Get(input.EntityId); if (divisionEntityForDelete == null) { throw new CityQuestItemNotFoundException(CityQuestConsts.CityQuestItemNotFoundExceptionMessageBody, "\"Division\""); } if (!DivisionPolicy.CanDeleteEntity(divisionEntityForDelete)) { throw new CityQuestPolicyException(CityQuestConsts.CQPolicyExceptionDeleteDenied, "\"Division\""); } DivisionRepository.Delete(divisionEntityForDelete); return(new DeleteOutput <long>() { DeletedEntityId = input.EntityId }); }
public HttpResponseMessage GetPersonalById(HttpRequestMessage request, int Id) { PersonalDivisionSection personal = (from per in personalRepo.GetWithoutTracking().Where(a => a.IsDeleted != true && a.PersonalID == Id) join div in divisionRepo.GetWithoutTracking() on per.DivisionID equals div.DivisionID join sec in sectionRepo.GetWithoutTracking() on per.SectionID equals sec.SectionID select new PersonalDivisionSection { persoanl = per, division = div, section = sec, }).FirstOrDefault(); List <Division> division = divisionRepo.Get().ToList(); List <Section> section = sectionRepo.Get().ToList(); PersonalData personaldata = new PersonalData(); personaldata.personalDivisionSection = personal; personaldata.divisionData = division; personaldata.sectionData = section; return(Request.CreateResponse(HttpStatusCode.OK, personaldata)); }
public HttpResponseMessage GetDivision(HttpRequestMessage request) { List <Division> result = divisionRepo.Get().ToList(); return(request.CreateResponse(HttpStatusCode.OK, result)); }
public IHttpActionResult Get() { var getdata = _repository.Get(); return(Ok(getdata)); }
public IEnumerable <DivisionVM> Get() { return(division.Get()); }