Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("ID, fullName")] UserProfile profile)
        {
            var returnUser = await _profiles.GetUserProfile(profile.fullName);

            if (returnUser != null)
            {
                return(RedirectToAction("UserIndex", "Home", new { userID = returnUser.ID }));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    await _profiles.CreateUserProfile(profile);

                    return(RedirectToAction("UserIndex", "Home", new { userID = profile.ID }));
                }
            }
            return(RedirectToAction("UserProfiles", "Create"));
        }
Esempio n. 2
0
 /// <summary>
 /// 创建用户
 /// </summary>
 /// <param name="up"></param>
 /// <returns></returns>
 public bool CreateUserProfile(UserProfileInfo up)
 {
     return(dal.CreateUserProfile(up));
 }