예제 #1
0
        public CustomWebApplicationFactory() : base()
        {
            // Open connections
            DBConnection = new SqliteConnection("DataSource=:memory:");
            DBConnection.Open();

            try
            {
                var options = new DbContextOptionsBuilder <hihDataContext>()
                              .UseSqlite(DBConnection)
                              .Options;

                // Create the schema in the database
                CurrentDataContext = new hihDataContext(options, true);
                CurrentDataContext.Database.EnsureCreated();

                // Setup the tables
                DataSetupUtility.InitializeSystemTables(CurrentDataContext);
                DataSetupUtility.InitializeHomeDefineAndMemberTables(CurrentDataContext);
            }
            catch
            {
                // Error occurred
            }
            finally
            {
            }
        }
 public void InitHome3TestData(hihDataContext context)
 {
     if (!this.IsHome3DataInitialized)
     {
         DataSetupUtility.CreateTestingData_Home3(context);
         this.IsHome3DataInitialized = true;
     }
 }
 public void InitBlogTestData(hihDataContext context)
 {
     if (!this.IsBlogDataInitialized)
     {
         DataSetupUtility.CreateTestingData_Blog(context);
         this.IsBlogDataInitialized = true;
     }
 }
        public hihDataContext GetCurrentDataContext()
        {
            var options = new DbContextOptionsBuilder <hihDataContext>()
                          .UseSqlite(DBConnection, action =>
            {
                action.UseRelationalNulls();
            })
                          .UseQueryTrackingBehavior(QueryTrackingBehavior.TrackAll)
                          .EnableSensitiveDataLogging()
                          .Options;

            var context = new hihDataContext(options, true);

            return(context);
        }
 public FinanceOrderSRulesController(hihDataContext context)
 {
     _context = context;
 }
 public FinancePlansController(hihDataContext context)
 {
     _context = context;
 }
예제 #7
0
 public BlogPostTagsController(hihDataContext context)
 {
     _context = context;
 }
예제 #8
0
 public DBVersionsController(hihDataContext context)
 {
     _context = context;
 }
예제 #9
0
 public CurrenciesController(hihDataContext context)
 {
     _context = context;
 }
예제 #10
0
 public BlogUserSettingsController(hihDataContext context)
 {
     _context = context;
 }
예제 #11
0
 public LanguagesController(hihDataContext context)
 {
     _context = context;
 }
예제 #12
0
 public void DeleteFinanceControlCenter(hihDataContext context, int ccid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_fin_controlcenter WHERE ID = " + ccid.ToString());
 }
예제 #13
0
 public void DeleteBlogPost(hihDataContext context, int postid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_blog_post WHERE ID = " + postid.ToString());
 }
 public FinanceAccountCategoriesController(hihDataContext context)
 {
     _context = context;
 }
예제 #15
0
 public void DeleteBlogCollection(hihDataContext context, int collid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_blog_coll WHERE ID = " + collid.ToString());
 }
예제 #16
0
 public void DeleteLearnObject(hihDataContext context, int ctgyid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_learn_obj WHERE ID = " + ctgyid.ToString());
 }
예제 #17
0
 public void DeleteFinanceDocument(hihDataContext context, int docid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_fin_document WHERE ID = " + docid.ToString());
 }
예제 #18
0
 public void DeleteFinancePlan(hihDataContext context, int planid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_fin_plan WHERE ID = " + planid.ToString());
 }
예제 #19
0
 public void DeleteFinanceOrder(hihDataContext context, int ordid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_fin_order WHERE ID = " + ordid.ToString());
 }
 public BlogPostCollectionsController(hihDataContext context)
 {
     _context = context;
 }
예제 #21
0
 public LearnCategoriesController(hihDataContext context)
 {
     _context = context;
 }
 public FinanceTransactionTypesController(hihDataContext context)
 {
     _context = context;
 }
예제 #23
0
 public void DeleteFinanceAccount(hihDataContext context, int acntid)
 {
     context.Database.ExecuteSqlRaw("DELETE FROM t_fin_account WHERE ID = " + acntid.ToString());
 }
 public FinanceReportByAccountsController(hihDataContext context)
 {
     _context = context;
 }
 public LearnObjectsController(hihDataContext context)
 {
     _context = context;
 }