public Hunt_RO(Hunt h, TrueScore t) { this.DataContext = Main.lang; InitializeComponent(); this.Top = Properties.Settings.Default.Hunt_ROWindowTop; this.Left = Properties.Settings.Default.Hunt_ROWindowLeft; lbl_map.Content = Map.GetNameFromID(h.mapId); cb_Animal.Content = Species.GetNameFromID(h.speciesID); cb_Sex.Content = Sex.GetNameFromID(h.sexID); txt_Weight.Text = h.weight.ToString(); cb_Fur.Content = Fur.GetNameFromID(h.furID); txt_Distance.Text = h.distance.ToString(); cb_Difficulty.Content = Difficulty.GetNameFromID(h.difficultyID); cb_TrophyKind.Content = TrophyKind.GetNameFromID(h.trophyKindID); cb_TrophyOrgan.Content = TrophyOrgane.GetNameFromID(h.trophyOrganeID); cb_Trophy.Content = Trophy.GetNameFromID(h.trophyID); txt_Score.Text = h.trophyScore.ToString(); txt_XP.Text = h.ep.ToString(); txt_Money.Text = h.money.ToString(); txt_SessionPt.Text = h.sessionPt.ToString(); txt_trueA.Text = t.trueA.ToString(); txt_trueB.Text = t.trueB.ToString(); txt_trueC.Text = t.trueC.ToString(); txt_trueD.Text = t.trueD.ToString(); txt_trueE.Text = t.trueE.ToString(); txt_trueF.Text = t.trueF.ToString(); txtBl_Note.Text = h.note; List <ControlHitList> list = h.GetControlHitList(); foreach (ControlHitList hC in list) { sp_Hits.Children.Add(hC); } }
private bool Save() { try { int trueScoreID = new TrueScore(double.Parse(txt_trueA.Text), double.Parse(txt_trueB.Text), double.Parse(txt_trueC.Text), double.Parse(txt_trueD.Text), double.Parse(txt_trueE.Text), double.Parse(txt_trueF.Text)).Insert(); ComboBoxItem cbIM = (ComboBoxItem)cb_map.SelectedItem; ComboBoxItem cbISp = (ComboBoxItem)cb_Animal.SelectedItem; ComboBoxItem cbIS = (ComboBoxItem)cb_Sex.SelectedItem; ComboBoxItem cbIF = (ComboBoxItem)cb_Fur.SelectedItem; ComboBoxItem cbIDif = (ComboBoxItem)cb_Difficulty.SelectedItem; ComboBoxItem cbITrK = (ComboBoxItem)cb_TrophyKind.SelectedItem; ComboBoxItem cbITrO = (ComboBoxItem)cb_TrophyOrgan.SelectedItem; ComboBoxItem cbITr = (ComboBoxItem)cb_Trophy.SelectedItem; int huntId = new Hunt(int.Parse(cbISp.Tag.ToString()), int.Parse(cbIS.Tag.ToString()), double.Parse(txt_Weight.Text), int.Parse(cbIF.Tag.ToString()), double.Parse(txt_Distance.Text), int.Parse(cbIDif.Tag.ToString()), int.Parse(cbITrK.Tag.ToString()), int.Parse(cbITrO.Tag.ToString()), int.Parse(cbITr.Tag.ToString()), double.Parse(txt_Score.Text), trueScoreID, int.Parse(txt_XP.Text), int.Parse(txt_Money.Text), int.Parse(txt_SessionPt.Text), txtBl_Note.Text, int.Parse(cbIM.Tag.ToString())).Insert(); if (sp_Hits.Children.Count < 1) { throw new Exception(); } foreach (ControlHitList h in sp_Hits.Children) { ComboBoxItem cbIW = (ComboBoxItem)h.cb_Weapon.SelectedItem; ComboBoxItem cbIA = (ComboBoxItem)h.cb_Ammo.SelectedItem; new Hit(huntId, int.Parse(h.txt_No.Text), int.Parse(cbIW.Tag.ToString()), int.Parse(cbIA.Tag.ToString()), double.Parse(h.txt_Distance.Text), double.Parse(h.txt_WeaponPt.Text), int.Parse(h.txt_Damage.Text)).Insert(); } Main.main.countHunts(); lastMapIndex = cb_map.SelectedIndex; return(true); } catch { String msg = Main.lang.warning_Save_Log; MessageBoxResult result = MessageBox.Show(msg, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); return(false); } }
public static void CreateSystemTables() { Ammunition.CreateTable(); Difficulty.CreateTable(); Fur.CreateTable(); Lang_String.CreateTable(); Sex.CreateTable(); Species.CreateTable(); Trophy.CreateTable(); TrophyKind.CreateTable(); TrophyOrgane.CreateTable(); TrueScore.CreateTable(); Weapon.CreateTable(); Map.CreateTable(); Loadout_Line.CreateTable(); theHunterLog.Database.ObjectClasses.Version.CreateTable(); }
public ControlHunt(Hunt h, TrueScore t) { hunt = h; trueScore = t; InitializeComponent(); lb_Date.Content = h.timestamp; lb_Map.Content = Map.GetNameFromID(h.mapId); lb_Species.Content = Species.GetNameFromID(h.speciesID); lb_trScore.Content = h.trophyScore; lb_trKind.Content = TrophyKind.GetNameFromID(h.trophyKindID); lb_trOrgane.Content = TrophyOrgane.GetNameFromID(h.trophyOrganeID); lb_trophy.Content = Trophy.GetNameFromID(h.trophyID); lb_ep.Content = h.ep; lb_money.Content = h.money; lb_trueA.Content = t.trueA; lb_trueB.Content = t.trueB; lb_trueC.Content = t.trueC; lb_trueD.Content = t.trueD; lb_trueE.Content = t.trueE; lb_trueF.Content = t.trueF; }