Пример #1
0
        public JsonResult addUser(UserUserInfoEntity entity)
        {
            User user = UserService.AddEntity(new User {
                username = entity.username,
                password = entity.password,
                isSys    = entity.isSys
            });

            if (entity.isSys == "1")
            {
                UserAuthService.AddEntity(new UserAuth {
                    main = "0", users = "0", orders = "0", house = "0", others = "0", uid = user.uid
                });
            }

            UserInfo userInfo = UserInfoService.AddEntity(new UserInfo {
                name  = entity.name,
                sex   = entity.sex,
                phone = entity.phone
            });

            UserUserInfoService.AddEntity(new UserUserInfo {
                uid     = user.uid,
                uiid    = userInfo.uiid,
                pubTime = DateTime.Now.ToString("yyyyMMdd")
            });

            return(Json("success", JsonRequestBehavior.AllowGet));
        }