protected void Page_Load(object sender, EventArgs e)
 {
     using (var context = new videogamesmgmtEntities())
     {
         Session["consoleid"] = context.consoles.OrderByDescending(c => c.Console_ID).FirstOrDefault().Console_ID;
     }
     setConsolesGrid();
 }
 public void setConsolesGrid()
 {
     using (var context = new videogamesmgmtEntities())
     {
         var cat = (from r in context.consoles select r).ToList();
         consolegrid.DataSource = cat;
         consolegrid.DataBind();
     }
 }
Exemplo n.º 3
0
 public void getCategoriesGrid()
 {
     gameid = (int)Session["gameid"];
     using (var context = new videogamesmgmtEntities())
     {
         var cat = (from vg in context.videogames join vgc in context.videogamescategories on vg.Game_ID equals vgc.VGCat_Game_ID join cm in context.categoriesmasters on vgc.VGCat_Category_ID equals cm.Category_ID where vg.Game_ID == gameid select new { GameName = vg.Game_Name, GameCat = cm.Category_Name }).ToList();
         categoriesgrid.DataSource = cat;
         categoriesgrid.DataBind();
     }
 }
 public void getConsolesGrid()
 {
     gameid = (int)Session["gameid"];
     using (var context = new videogamesmgmtEntities())
     {
         var cat = (from vg in context.videogames join vgc in context.videogamesconsoles on vg.Game_ID equals vgc.VGCon_Game_ID join cm in context.consoles on vgc.VGCon_Console_ID equals cm.Console_ID where vg.Game_ID == gameid select new { ReleaseID = vgc.VGCon_ID, GameName = vg.Game_Name, ConsoleName = cm.Console_Name, ConsoleType = cm.Console_Type }).ToList();
         consolesgrid.DataSource = cat;
         consolesgrid.DataBind();
     }
 }
Exemplo n.º 5
0
 public void getContentsGrid()
 {
     gameid  = (int)Session["gameid"];
     VGConID = (int)Session["selectedvgconid"];
     using (var context = new videogamesmgmtEntities())
     {
         var cat = (from vg in context.videogames join vgc in context.videogamesconsoles on vg.Game_ID equals vgc.VGCon_Game_ID join con in context.consoles on vgc.VGCon_Console_ID equals con.Console_ID where vg.Game_ID == gameid join gc in context.gamecontents on vgc.VGCon_ID equals gc.GC_VGCon_ID join cm in context.conditionsmasters on gc.GC_Condition_ID equals cm.Condition_ID join gcom in context.gamecomletenesses on gc.GC_Completeness_ID equals gcom.Completeness_ID select new { Collection_ID = vgc.VGCon_ID, Console_Name = con.Console_Name, Game_Name = vg.Game_Name, GameCompleteness = gcom.Completeness_Description, GameCondition = cm.Condition_Name, PurchaseAmount = gc.GC_AmtPurchased, CurMktValue = gc.GC_CurMarketValue, PurchaseDate = gc.GC_DatePurchased }).Where(r => r.Collection_ID == VGConID).ToList();
         contentsgrid.DataSource = cat;
         contentsgrid.DataBind();
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     gameid = (int)Session["gameid"];
     using (var context = new videogamesmgmtEntities())
     {
         var addedgame = (from r in context.videogames select r).Where(w => w.Game_ID == gameid).ToList();
         selectedGameGrid.DataSource = addedgame;
         selectedGameGrid.DataBind();
         getCategoriesGrid();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     gameid = (int)Session["gameid"];
     using (var context = new videogamesmgmtEntities())
     {
         Session["vgconid"] = context.videogamesconsoles.OrderByDescending(c => c.VGCon_ID).FirstOrDefault().VGCon_ID;
         var addedgame = (from r in context.videogames select r).Where(w => w.Game_ID == gameid).ToList();
         selectedGameGrid.DataSource = addedgame;
         selectedGameGrid.DataBind();
     }
     getConsolesGrid();
 }
Exemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     gameid  = (int)Session["gameid"];
     VGConID = (int)Session["selectedvgconid"];
     using (var context = new videogamesmgmtEntities())
     {
         //Session["vgconid"] = context.videogamesconsoles.OrderByDescending(c => c.VGCon_ID).FirstOrDefault().VGCon_ID;
         var addedgame = (from vg in context.videogames join vgc in context.videogamesconsoles on vg.Game_ID equals vgc.VGCon_Game_ID join cm in context.consoles on vgc.VGCon_Console_ID equals cm.Console_ID where vg.Game_ID == gameid select new { Collection_ID = vgc.VGCon_ID, Console_Name = cm.Console_Name, Game_Name = vg.Game_Name }).Where(w => w.Collection_ID == VGConID).ToList();
         selectedGameGrid.DataSource = addedgame;
         selectedGameGrid.DataBind();
     }
     getContentsGrid();
 }
Exemplo n.º 9
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     using (var context = new videogamesmgmtEntities())
     {
         var _videogamescategories = context.Set <videogamescategory>();
         _videogamescategories.Add(new videogamescategory {
             VGCat_Game_ID = (int)Session["gameid"], VGCat_Category_ID = Convert.ToInt32(ddlCategories.SelectedValue)
         });
         context.SaveChanges();
         //Response.Write("Category Added Successfully");
     }
     getCategoriesGrid();
 }
 protected void bthAdd_Click(object sender, EventArgs e)
 {
     using (var context = new videogamesmgmtEntities())
     {
         Session["consoleid"] = Convert.ToInt32(Session["consoleid"]) + 1;
         var consoles = context.Set <console>();
         consoles.Add(new console {
             Console_ID = Convert.ToInt32(Session["consoleid"]), Console_Name = txtConsoleName.Text, Console_Type = ddlConsoleType.SelectedValue
         });
         context.SaveChanges();
     }
     setConsolesGrid();
 }
Exemplo n.º 11
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     using (var context = new videogamesmgmtEntities())
     {
         VGConID = (int)Session["selectedvgconid"];
         var _gamecontents = context.Set <gamecontent>();
         _gamecontents.Add(new gamecontent {
             GC_VGCon_ID = VGConID, GC_Completeness_ID = Convert.ToInt32(ddlgamecompleteness.SelectedValue), GC_Condition_ID = Convert.ToInt32(ddlgamecondition.SelectedValue), GC_AmtPurchased = Convert.ToInt32(txtAmtPurchased.Text), GC_CurMarketValue = Convert.ToInt32(txtCurMarketValue.Text), GC_DatePurchased = CalPurchaseDate.SelectedDate
         });
         context.SaveChanges();
         // Response.Write("Successfully added contents for this game!!");
     }
     getContentsGrid();
 }
 protected void addButton_Click(object sender, EventArgs e)
 {
     using (var context = new videogamesmgmtEntities())
     {
         Session["vgconid"] = Convert.ToInt32(Session["vgconid"]) + 1;
         VGConID            = (int)Session["vgconid"];
         var _videogamesconsoles = context.Set <videogamesconsole>();
         _videogamesconsoles.Add(new videogamesconsole {
             VGCon_ID = VGConID, VGCon_Game_ID = gameid, VGCon_Console_ID = Convert.ToInt32(ddlconsoles.SelectedValue)
         });
         context.SaveChanges();
         // Response.Write("Successfully added console for this game!!");
     }
     getConsolesGrid();
 }