private void InstallStripe(Model.Models.DashoorContext context) { context.SettingDictionaries.Add(new Model.Models.SettingDictionary() { SettingID = 1, Name = "StripeApiKey", Value = "sk_test_kUNQFEh3YLbEFEa38tbeMJLV", Created = DateTime.Now, LastUpdated = DateTime.Now, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.SettingDictionaries.Add(new Model.Models.SettingDictionary() { SettingID = 1, Name = "StripePublishableKey", Value = "pk_test_EfbP8SfcALEJ8Jk2JxtSxmqe", Created = DateTime.Now, LastUpdated = DateTime.Now, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.SettingDictionaries.Add(new Model.Models.SettingDictionary() { SettingID = 1, Name = "StripeClientID", Value = "ca_6Rh18px61rjCEZIav5ItunZ1mKD8YjvU", Created = DateTime.Now, LastUpdated = DateTime.Now, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); }
private void InstallPictures(Model.Models.DashoorContext context) { for (int i = 1; i <= 9; i++) { context.Pictures.Add(new Model.Models.Picture() { MimeType = "image/jpeg", ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.SaveChanges(); context.ListingPictures.Add(new Model.Models.ListingPicture() { ListingID = i, PictureID = i, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); // Copy files var pathFrom = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/images/sample/listing"), string.Format("{0}.{1}", i.ToString("00000000"), "jpg")); var pathTo = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/images/listing"), string.Format("{0}.{1}", i.ToString("00000000"), "jpg")); File.Copy(pathFrom, pathTo, true); } }
private void InstallCategories(Model.Models.DashoorContext context) { context.Categories.Add(new Model.Models.Category() { Name = "Massage", Description = "Massage", Parent = 0, Enabled = true, Ordering = 0, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.Categories.Add(new Model.Models.Category() { Name = "Facial", Description = "Facial Care", Parent = 0, Enabled = true, Ordering = 1, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.Categories.Add(new Model.Models.Category() { Name = "Skin Care", Description = "Skin Care", Parent = 0, Enabled = true, Ordering = 2, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); }
private void InstallDisqus(Model.Models.DashoorContext context) { context.SettingDictionaries.Add(new Model.Models.SettingDictionary() { SettingID = 1, Name = "Disqus_ShortName", Value = "Dashoor", Created = DateTime.Now, LastUpdated = DateTime.Now, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); }
private void InstallListingTypes(Model.Models.DashoorContext context) { context.ListingTypes.Add(new Dashoor.Model.Models.ListingType() { Name = "Offer", ButtonLabel = "Book", OrderTypeID = (int)Enum_ListingOrderType.DateRange, OrderTypeLabel = "Number of days", PriceUnitLabel = "Per day", PaymentEnabled = true, PriceEnabled = true, ShippingEnabled = false, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.SaveChanges(); }
public async Task <ActionResult> Install(InstallModel model) { System.Data.Entity.Database.SetInitializer(new DashoorDatabaseInitializer(model)); // initialize and create database using (var context = new Model.Models.DashoorContext()) { context.Database.Initialize(true); context.SaveChanges(); } // Sign in user var user = UserManager.FindByEmail(model.Email); await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false); InstallPlugins(); return(RedirectToAction("Index", "Home", new { area = "" })); }
private void InstallCategoryTypes(Model.Models.DashoorContext context) { context.CategoryListingTypes.Add(new Dashoor.Model.Models.CategoryListingType() { CategoryID = 1, ListingTypeID = 1, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.CategoryListingTypes.Add(new Dashoor.Model.Models.CategoryListingType() { CategoryID = 2, ListingTypeID = 1, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); context.CategoryListingTypes.Add(new Dashoor.Model.Models.CategoryListingType() { CategoryID = 3, ListingTypeID = 1, ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added }); }