private void createQuestSet_Click(object sender, RoutedEventArgs e) { capital_city_research_quest q = WorldWorker.CreateNewResearchQuest(); _ResearchQuest.Add(q); questSet.Text = q.QuestSet.ToString(); _SelectedResearchData.QuestSet = q.QuestSet; }
private void researchQuestDelete_Click(object sender, RoutedEventArgs e) { capital_city_research_quest q = researchQuestList.SelectedItem as capital_city_research_quest; if (q == null) { return; } _ResearchQuest.Remove(q); }
private void researchQuestNew_Click(object sender, RoutedEventArgs e) { if (_SelectedResearchData == null) { return; } capital_city_research_quest q = WorldWorker.CreateNewResearchQuest(_SelectedResearchData.QuestSet); _ResearchQuest.Add(q); }
private void researchQuestList_SelectionChanged(object sender, SelectionChangedEventArgs e) { capital_city_research_quest q = researchQuestList.SelectedItem as capital_city_research_quest; if (q == null) { return; } researchQuestGrid.DataContext = q; }
public static capital_city_research_quest CreateNewResearchQuest() { int id = (from d in DB.LEGACY.capital_city_research_quest select d.QuestSet).Max() + 1; capital_city_research_quest q = new capital_city_research_quest(); q.QuestSet = id; q.ID = 0; q.Quest = 0; // no db saving. return q; }
public static capital_city_research_quest CreateNewResearchQuest(int set) { int id = (from d in DB.LEGACY.capital_city_research_quest where d.QuestSet == set select d.ID).SingleOrDefault() + 1; capital_city_research_quest q = new capital_city_research_quest(); q.ID = id; q.Quest = 0; q.QuestSet = set; DB.LEGACY.capital_city_research_quest.Add(q); DB.LSave(); return q; }