Esempio n. 1
0
        public void AddBusiness(AddBusinessViewModel model)
        {
            var business = new BetterReviews.Database.Entities.Business();

            business.Name           = model.BusinessName;
            business.EmailAddress   = model.EmailAddress;
            business.WebsiteAddress = model.WebsiteAddress;
            business.PhoneNumber    = model.PhoneNumber;

            business.Address          = new Address();
            business.Address.Address1 = model.Address;
            business.Address.City     = model.City;
            business.Address.ZipCode  = model.ZipCode;
            business.Address.Country  = model.Country;
            business.Address.State    = model.State;

            business.BusinessCategoryId = model.BusinessCategoryId.Value;

            _database.Businesses.Add(business);
            _database.SaveChanges();
        }
Esempio n. 2
0
        public void SaveUserProfile(string userId, RegisterViewModel model)
        {
            var ctx = new BetterReviewsEntities();

            var profile = new UserProfile()
            {
                FirstName = model.FirstName,
                LastName  = model.LastName,
                UserId    = userId
            };

            ctx.UserProfiles.Add(profile);
            ctx.SaveChanges();
        }