Ejemplo n.º 1
0
 public DataAccountUser RegisterAccountUser(DataAccountUser accountUser)
 {
     _ncEntities.AddToAccountUsers(accountUser);
     _ncEntities.SaveChanges();
     return accountUser;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// To update accountUser Details with remaining information
        /// </summary>
        /// <param name="accountUser"></param>
        /// <returns></returns>
        public bool UpdateAccountUser(DataAccountUser accountUser)
        {
            try
            {
                var accountUserDetails = _ncEntities.AccountUsers.SingleOrDefault(x => x.Id == accountUser.Id);
                if (accountUserDetails != null)
                {
                    accountUserDetails.FirstName = accountUser.FirstName;
                    accountUserDetails.MiddleName = accountUser.MiddleName;
                    accountUserDetails.LastName = accountUser.LastName;
                    accountUserDetails.Sex = accountUser.Sex;
                    accountUserDetails.DOB = accountUser.DOB;
                    accountUserDetails.AddressId = accountUser.AddressId;
                }
                _ncEntities.SaveChanges();

                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }