public void UpdateGame(int ID_Game, int ID_Developer, int ID_Publisher, string Game_Name, int Year_of_Publication, double Brutal_Rating, string Official_Site, bool Cyber_Discipline, bool Network_Mode) { //можно просто //var _context = new db_MinligareevMAContext(); using (db_MinligareevMAContext _context = new db_MinligareevMAContext()) { try { var game = _context.Games.Where(g => g.ID_Game == ID_Game).FirstOrDefault(); game.ID_Developer = ID_Developer; game.ID_Publisher = ID_Publisher; game.Game_Name = Game_Name; game.Year_of_Publication = Year_of_Publication; game.Brutal_Rating = Brutal_Rating; game.Official_Site = Official_Site; game.Cyber_Discipline = Cyber_Discipline; game.Network_Mode = Network_Mode; _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } } }
public void UpdatePublisher(int ID_Publisher, string Publisher_Name, string Official_Site) { using (db_MinligareevMAContext _context = new db_MinligareevMAContext()) { try { var publisher = _context.Publishers.Where(p => p.ID_Publisher == ID_Publisher).FirstOrDefault(); publisher.Publisher_Name = Publisher_Name; publisher.Official_Site = Official_Site; _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } } }
public void AddPublisher(string Publisher_Name, string Official_Site) { var _context = new db_MinligareevMAContext(); Publishers publisher = new Publishers(); publisher.Publisher_Name = Publisher_Name; publisher.Official_Site = Official_Site; try { _context.Publishers.Add(publisher); _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } }
public void UpdateGame_Exhibition(int ID_Game_Exhibition, int ID_Game, int ID_Exhibition, int Game_Rating_On_Exhibition) { using (db_MinligareevMAContext _context = new db_MinligareevMAContext()) { try { var GameExhibition = _context.Game_Exhibition.Where(ge => ge.ID_Game_Exhibition == ID_Game_Exhibition).FirstOrDefault(); GameExhibition.ID_Game = ID_Game; GameExhibition.ID_Exhibition = ID_Exhibition; GameExhibition.Game_Rating_On_Exhibition = Game_Rating_On_Exhibition; _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } } }
public void AddGame_Exhibition(int ID_Game, int ID_Exhibition, int Game_Rating_On_Exhibition) { var _context = new db_MinligareevMAContext(); Game_Exhibition GameExhibition = new Game_Exhibition(); GameExhibition.ID_Game = ID_Game; GameExhibition.ID_Exhibition = ID_Exhibition; GameExhibition.Game_Rating_On_Exhibition = Game_Rating_On_Exhibition; try { _context.Game_Exhibition.Add(GameExhibition); _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } }
public void UpdateGame_Area(int ID_Game_Area, int ID_Game, int ID_Area, int Area_Game_Cost) { using (db_MinligareevMAContext _context = new db_MinligareevMAContext()) { try { var GameArea = _context.Game_Area.Where(ga => ga.ID_Game_Area == ID_Game_Area).FirstOrDefault(); GameArea.ID_Game = ID_Game; GameArea.ID_Area = ID_Area; GameArea.Area_Game_Cost = Area_Game_Cost; _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } } }
public void AddGame_Area(int ID_Game, int ID_Area, int Area_Game_Cost) { var _context = new db_MinligareevMAContext(); Game_Area GameArea = new Game_Area(); GameArea.ID_Game = ID_Game; GameArea.ID_Area = ID_Area; GameArea.Area_Game_Cost = Area_Game_Cost; try { _context.Game_Area.Add(GameArea); _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } }
public void UpdateDeveloper(int ID_Developer, string Developer_Name, string Official_Site, bool Indie) { using (db_MinligareevMAContext _context = new db_MinligareevMAContext()) { try { var developer = _context.Developers.Where(d => d.ID_Developer == ID_Developer).FirstOrDefault(); developer.Developer_Name = Developer_Name; developer.Official_Site = Official_Site; developer.Indie = Indie; _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } } }
public void AddDeveloper(string Developer_Name, string Official_Site, bool Indie) { var _context = new db_MinligareevMAContext(); Developers developer = new Developers(); developer.Developer_Name = Developer_Name; developer.Official_Site = Official_Site; developer.Indie = Indie; try { _context.Developers.Add(developer); _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } }
public void UpdateUser(int ID_User, string First_Name, string Second_Name, string Login, string Password, bool Administrator) { using (db_MinligareevMAContext _context = new db_MinligareevMAContext()) { try { var user = _context.UsersBD.Where(u => u.ID_User == ID_User).FirstOrDefault(); user.First_Name = First_Name; user.Second_Name = Second_Name; user.Login = Login; user.Password = Password; user.Administrator = Administrator; _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } } }
public void AddUser(string First_Name, string Second_Name, string Login, string Password, bool Administrator) { var _context = new db_MinligareevMAContext(); UsersBD user = new UsersBD(); user.First_Name = First_Name; user.Second_Name = Second_Name; user.Login = Login; user.Password = Password; user.Administrator = Administrator; try { _context.UsersBD.Add(user); _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } }
public void AddGame(int ID_Developer, int ID_Publisher, string Game_Name, int Year_of_Publication, int Brutal_Rating, string Official_Site, bool Cyber_Discipline, bool Network_Mode) { var _context = new db_MinligareevMAContext(); Games game = new Games(); game.ID_Developer = ID_Developer; game.ID_Publisher = ID_Publisher; game.Game_Name = Game_Name; game.Year_of_Publication = Year_of_Publication; game.Brutal_Rating = Brutal_Rating; game.Official_Site = Official_Site; game.Cyber_Discipline = Cyber_Discipline; game.Network_Mode = Network_Mode; try { _context.Games.Add(game); _context.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Warning"); Logging(ex.Message, ex.StackTrace); } }