Exemplo n.º 1
0
 /// <summary>
 /// Inicjalizuje listę z krasnoludami do zdegradowania
 /// </summary>
 /// <param name="newParent">Okno nadrzędne</param>
 public FormDowngrade(FormMainWindow newParent)
 {
     InitializeComponent();
     parent = newParent;
     if (parent != null)
     {
         dataGridViewUsers.DataSource = parent.Users.GetAll().Where(user => user.ClanName == parent.CurrentUser.ClanName && user.RankId < parent.CurrentUser.RankId && user.RankId > 2).Select(user => new { Name = user.Login, Rank = user.Rank.Name }).ToList();
     }
     else
     {
         MessageBox.Show("Wrong type of parent window!");
         Close();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Inicjalizuje listę klanów do wyboru
 /// </summary>
 /// <param name="newParent">Okno nadrzędne</param>
 public FormDeclareWar(FormMainWindow newParent)
 {
     InitializeComponent();
     parent = newParent;
     if (parent != null)
     {
         dataGridViewClans.DataSource = parent.Clans.GetAll().Where(clan => clan.Name != "No Clan" && clan.Name != parent.CurrentUser.ClanName && parent.Wars.GetAll().Where(war => war.Clan1Name == parent.CurrentUser.ClanName && war.Clan2Name == clan.Name).ToList().Count == 0 && parent.Wars.GetAll().Where(war => war.Clan2Name == parent.CurrentUser.ClanName && war.Clan1Name == clan.Name).ToList().Count == 0 && parent.Alliances.GetAll().Where(alliance => alliance.Clan1Name == parent.CurrentUser.ClanName && alliance.Clan2Name == clan.Name).ToList().Count == 0 && parent.Alliances.GetAll().Where(alliance => alliance.Clan2Name == parent.CurrentUser.ClanName && alliance.Clan1Name == clan.Name).ToList().Count == 0).Select(clan => new { clan.Name }).ToList();
     }
     else
     {
         MessageBox.Show("Wrong type of parent window!");
         Close();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Inicjalizuję listę niezrzeszonych użytkowników
 /// </summary>
 /// <param name="newParent">Okno nadrzędne</param>
 public FormAddMember(FormMainWindow newParent)
 {
     InitializeComponent();
     parent = newParent;
     if (parent != null)
     {
         dataGridViewUsers.DataSource = parent.Users.GetAll().Where(user => user.ClanName == "No Clan").Select(user => new { Name = user.Login }).ToList();
     }
     else
     {
         MessageBox.Show("Wrong type of parent window!");
         Close();
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Inicjalizuje listę klanów w wojnie z klanem użytkownika
 /// </summary>
 /// <param name="newParent">Okno nadrzędne</param>
 public FormMakePeace(FormMainWindow newParent)
 {
     InitializeComponent();
     parent = newParent;
     if (parent != null)
     {
         List <Tables.Clan> clansAtWar = parent.Wars.GetAll().Where(clan => clan.Clan1Name == parent.CurrentUser.ClanName).Select(clan => clan.Clan2).ToList();
         clansAtWar.AddRange(parent.Wars.GetAll().Where(clan => clan.Clan2Name == parent.CurrentUser.ClanName).Select(clan => clan.Clan1));
         dataGridViewClans.DataSource = clansAtWar.Select(clan => new { clan.Name }).ToList();
     }
     else
     {
         MessageBox.Show("Wrong type of parent window!");
         Close();
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="newParent">Okno nadrzędne</param>
 public FormCreateClan(FormMainWindow newParent)
 {
     InitializeComponent();
     parent = newParent;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="newParent">Okno nadrzędne</param>
 public FormRegister(FormMainWindow newParent)
 {
     InitializeComponent();
     parent = newParent;
 }