public IHttpActionResult PostCUL(CUL cUL) { if (cUL == null) { return(BadRequest("CUL object is not present the request body")); } try { cUL.CreatedDate = DateTime.Now; cULsService.InsertCUL(cUL); var culs = cULsService.GetCULs(); var html = Helpers.RenderPartial("~/Views/Shared/Partial/CULs/CULsItemsList.cshtml", culs); return(Ok(html)); } catch (Exception ex) { return(InternalServerError(ex)); } }
public void DeleteCUL(CUL cul) { cULsRepository.Delete(cul.AutoMapObject <CUL, DB.CUL>()); }
public int InsertCUL(CUL cul) { var res = cULsRepository.Insert(cul.AutoMapObject <CUL, DB.CUL>()); return(res.CULId); }
public void UpdateCUL(CUL cul) { var original = cULsRepository.GetById(c => c.CULId == cul.CULId); cULsRepository.Update(original, cul.AutoMapObject <CUL, DB.CUL>()); }