コード例 #1
0
 public IActionResult SaveClient(ClientView CurrenClient)
 {
     if (ModelState.IsValid)
     {
         if (CurrenClient.Id == 0)
         {
             //post client
             WebActions.AddClient(CurrenClient);
             return(RedirectToAction("Index"));
         }
         else
         {
             //put client
             WebActions.EditClient(CurrenClient);
             return(RedirectToAction("Index"));
         }
     }
     else
     {
         return(BadRequest(ModelState));
     }
 }