public ShoppingDataViewModel() { orders = new List <Order>(); SuperMarketEntities db = new SuperMarketEntities(); orders = db.Orders.ToList(); }
private MainController() { Database.SetInitializer(new DropCreateDatabaseAlways <SupermarketContext>()); //Database.SetInitializer(new MigrateDatabaseToLatestVersion<SupermarketContext, Configuration>()); this.sQLServerContext = new SupermarketContext(); this.mySqlContext = new SuperMarketEntitiesModel(); this.excelConnection = new OleDbConnection(); this.sqliteContext = new SuperMarketEntities(); }
public void Export(SuperMarketEntities sqliteContext) { var query = MongoDbProvider.db.LoadData <MongoDbProductFormat>().AsQueryable(); foreach (var item in query) { sqliteContext.Products.Add(new Product() { ProductId = item.ProductId, ProductName = item.ProductName, VendorName = item.VendorName, TotalIncomes = item.TotalIncomes }); } sqliteContext.SaveChanges(); }
public IList <SqliteExcelFormat> GetDataForExcelFile(SuperMarketEntities sqliteContext, SupermarketContext sqlServerContext) { IList <SqliteExcelFormat> data; data = sqliteContext.Products.Include("TaxTables.Tax").Select(x => new SqliteExcelFormat { Vendor = x.VendorName, Incomes = x.TotalIncomes, TaxPercentage = x.TaxTable.Tax, ProductId = x.ProductId }).ToList(); foreach (var item in data) { //item.Expenses = sqlServerContext.Expenses.Where(x => x.Vendor.VendorName == item.Vendor).Select(x => x.ExpenseValue).First(); var vendorId = sqlServerContext.Products.Where(x => item.ProductId == x.Id).Select(x => x.VendorId).First(); item.Expenses = sqlServerContext.Expenses.Where(x => x.VendorId == vendorId).Select(x => x.ExpenseValue).First(); } return(data); }
public OrderProvider() { db = new SuperMarketEntities(); }
public ProductController() { ctx = new SuperMarketEntities(); }
public void Export(SuperMarketEntities sqliteContext, SupermarketContext sqlServerContext, string fileName) { IList <SqliteExcelFormat> data = GetDataForExcelFile(sqliteContext, sqlServerContext); CreateExcelFile(fileName, data); }
public AccountProvider(string connectionString) { db = new SuperMarketEntities(connectionString); }
public AccountProvider() { db = new SuperMarketEntities(); }
public ProductTypeProvider(string connectionString) { db = new SuperMarketEntities(connectionString); }
public ProductTypeProvider() { db = new SuperMarketEntities(); }
public InventoryProvider() { db = new SuperMarketEntities(); }