コード例 #1
0
 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;
 }
コード例 #2
0
 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;
     }));
 }
コード例 #3
0
 public void Update(SuppostOnline suppostOnline)
 {
     _suppostOnlineRepository.Update(suppostOnline);
 }
コード例 #4
0
 public SuppostOnline Add(SuppostOnline suppostOnline)
 {
     return(_suppostOnlineRepository.Add(suppostOnline));
 }