public static void UpdateSuppostOnline(this SuppostOnline suppostOnline, SuppostOnlineViewModel suppostOnlineVM) { suppostOnline.ID = suppostOnlineVM.ID; suppostOnline.Name = suppostOnlineVM.Name; suppostOnline.Department = suppostOnlineVM.Department; suppostOnline.Skype = suppostOnlineVM.Skype; suppostOnline.Email = suppostOnlineVM.Email; suppostOnline.Status = suppostOnlineVM.Status; suppostOnline.DisplayOrder = suppostOnlineVM.DisplayOrder; }
public HttpResponseMessage Post(HttpRequestMessage request, SuppostOnlineViewModel suppostOnlineVm) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } else { SuppostOnline newSuppostOnline = new SuppostOnline(); newSuppostOnline.UpdateSuppostOnline(suppostOnlineVm); var category = _suppostOnlineService.Add(newSuppostOnline); _suppostOnlineService.SaveChanges(); response = request.CreateResponse(HttpStatusCode.Created, category); } return response; })); }
public void Update(SuppostOnline suppostOnline) { _suppostOnlineRepository.Update(suppostOnline); }
public SuppostOnline Add(SuppostOnline suppostOnline) { return(_suppostOnlineRepository.Add(suppostOnline)); }