Пример #1
0
 public JsonResult Create(UserIfo usr)
 {
     if (usr.UserNr == 0)
     {
         ResponseModel model = InvUserData.SaveUser(usr);
         if (model.status == 1)
         {
             return(Json(new { status = true, msg = "Successfuly saved." }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { status = false, msg = "Someething went wrong." }, JsonRequestBehavior.AllowGet));
         }
     }
     else
     {
         ResponseModel model = InvUserData.UpdateUser(usr);
         if (model.status == 1)
         {
             return(Json(new { status = true, msg = "Successfuly updated." }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { status = false, msg = "Someething went wrong." }, JsonRequestBehavior.AllowGet));
         }
     }
 }