public ActionResult Show(int id) { //Debug.WriteLine("I Want to show a Store with id " + id") ; //to show data for an individual store //query to select a store from the list of the stores. string main_query = "select * from stores where StoreID = @id"; var pk_parameter = new SqlParameter("@id", id); Store Store = db.Stores.SqlQuery(main_query, pk_parameter).FirstOrDefault(); //find data about all makeupproducts that store has (through id) string aside_query = "select * from MakeupProducts inner join StoreMakeupProducts on MakeupProducts.MakeupProductID = StoreMakeupProducts.MakeupProduct_MakeupProductID where StoreMakeupProducts.Store_StoreID=@id"; var fk_parameter = new SqlParameter("@id", id); List <MakeupProduct> AvailableMakeupProducts = db.MakeupProducts.SqlQuery(aside_query, fk_parameter).ToList(); string all_makeupProducts_query = "select * from MakeupProducts"; List <MakeupProduct> AllMakeupProducts = db.MakeupProducts.SqlQuery(all_makeupProducts_query).ToList(); //using the viewmodel to get all the makeupproducts list available on that store. ShowStore viewmodel = new ShowStore(); viewmodel.store = Store; viewmodel.makeupProducts = AvailableMakeupProducts; viewmodel.all_makeupProducts = AllMakeupProducts; return(View(viewmodel)); }
public RefreshTVShowsJob() { _showStore = new ShowStore(); _refreshShowTask = new RefreshShowTask(); }