コード例 #1
0
        public JsonResult SaveUser(AdminUserInfo userinfo)
        {
            var userID = UserID;

            try
            {
                if (userinfo.id == 0 && adminUserBLL.ExistsAdminUserName(userinfo.UserName))
                {
                    return(Json(new { Error = 1, Message = "此賬號已被佔用" }));
                }
                var falg = adminUserBLL.SaveAdminUserInfo(userinfo);
                if (falg)
                {
                    return(Json(new { Error = 0 }));
                }
                else
                {
                    return(Json(new { Error = 1 }));
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                return(Json(new { Error = 1, Message = ex.Message }));
            }
        }