internal static void Dell_Game(object SelectedItem) { if (MessageBox.Show("Удалить игру?", "Подтверждение", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) { return; } else { lock (typeof(View_Model_Game)) { using (Model_Game_Shop BDD = new Model_Game_Shop()) { if (BDD.Games.ToList().Exists(i => i.Game_Name == (SelectedItem as string))) { BDD.Games.Remove(BDD.Games.ToList().Find(i => i.Game_Name == (SelectedItem as string))); BDD.SaveChanges(); } else { MessageBox.Show("Что-то пошло нет так", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); } } } } }
internal static void In_Game_Edit_Game_Mod_id(Game curent_game, string Game_Mod) { lock (typeof(View_Model_Game)) { using (Model_Game_Shop BDD = new Model_Game_Shop()) { curent_game.Game_Mod_id = BD.Mod_Game.ToList().Find(i => i.Mod_Game_Name == Game_Mod).Id; BDD.SaveChanges(); } } }
internal static void In_Game_Edit_Game_Count_Sell(Game curent_game, string Game_Sells) { lock (typeof(View_Model_Game)) { using (Model_Game_Shop BDD = new Model_Game_Shop()) { curent_game.Game_Count_Sell = Convert.ToInt32(Game_Sells); BDD.SaveChanges(); } } }
internal static void In_Game_Edit_Name(Game curent_game, string text) { lock (typeof(View_Model_Game)) { using (Model_Game_Shop BDD = new Model_Game_Shop()) { curent_game.Game_Name = text; BDD.SaveChanges(); } } }
internal static void In_Game_Edit_Year_Releas(Game curent_game, Calendar calendar) { lock (typeof(View_Model_Game)) { using (Model_Game_Shop BDD = new Model_Game_Shop()) { curent_game.Game_Year_Releas = new DateTime(calendar.SelectedDate.Value.Year, calendar.SelectedDate.Value.Month, calendar.SelectedDate.Value.Day); BDD.SaveChanges(); } } }