Beispiel #1
0
        /// <summary>
        /// The method to create user.
        /// </summary>
        /// <param name="user">The domain user object.</param>
        /// <returns>Return true or false; true indicates user creation is successful.</returns>
        public bool CreateUser(user.User user)
        {
            dbContext.Users.Add(MapUser(user));
            var result = dbContext.SaveChanges();

            return(result > 0 ? true : false);
        }
Beispiel #2
0
 private User MapUser(user.User user)
 {
     return(new User()
     {
         Name = user.Name,
         Password = user.Password,
         UpdateDate = DateTime.Today,
         CreateDate = DateTime.Today,
         UsersTotalProductQuantity = user.UsersTotalProductQuantity,
         UserName = user.UserName
     });
 }
Beispiel #3
0
 public IHttpActionResult CreateProduct(user.User user)
 {
     userOrc = new UserOrc();
     return(Ok(userOrc.CreateUser(user)));
 }