Пример #1
0
        public static Models.AccountDetailsModel GetAccountDetails(Guid userId)
        {
            var dataItem = GetContext().GetAdditionalUserInfo(userId).Single();
            var result   = new Models.AccountDetailsModel {
                UserId = dataItem.UserId, Email = dataItem.Email, FirstName = dataItem.FirstName, LastName = dataItem.LastName, Phone = dataItem.Phone
            };

            return(result);
        }
Пример #2
0
        public RedirectResult Details(AccountDetailsModel model)
        {

            Data.CRUD.UpdateUser(model, SessionItems.CurrentUser.UserId);
            return new RedirectResult("../Home");
        }
Пример #3
0
 public static void UpdateUser(AccountDetailsModel accountDetailsModel, int userId)
 {
     using (var context = DataContext.GetContext())
     {
         var existingItem = context.Users.Single(a => a.UserId == accountDetailsModel.UserId);
         existingItem.Email = accountDetailsModel.Email;
         existingItem.FirstName = accountDetailsModel.FirstName;
         existingItem.LastName = accountDetailsModel.LastName;
         existingItem.Phone = accountDetailsModel.Phone;
         existingItem.LastModifiedBy = userId;
         existingItem.LastModifiedOn = DateTime.Now;
         context.SaveChanges();
     }
 }
Пример #4
0
 public static Models.AccountDetailsModel GetAccountDetails(Guid userId)
 {
     var dataItem = GetContext().GetAdditionalUserInfo(userId).Single();
     var result = new Models.AccountDetailsModel {  UserId = dataItem.UserId, Email = dataItem.Email, FirstName = dataItem.FirstName, LastName = dataItem.LastName, Phone = dataItem.Phone };
     return result;
 }
Пример #5
0
 public static void SaveAccountDetails(Models.AccountDetailsModel accountDetailsModel)
 {
     GetContext().SaveAdditionalUserInfo(accountDetailsModel.UserId, accountDetailsModel.Email, accountDetailsModel.FirstName, accountDetailsModel.LastName, accountDetailsModel.Phone);
 }