예제 #1
0
        private static void ActionCreateAccount()
        {
            Console.WriteLine("Er zijn momenteel " + mgr.ReadAllAccounts().Count() + "in de databank");
            Console.Write("Account naam: ");
            string naam = Console.ReadLine();

            Console.Write("Aantal rp");
            int rp = Int32.Parse(Console.ReadLine());

            Console.Write("Aantal ip");
            int ip = Int32.Parse(Console.ReadLine());

            Console.Write("Huidige rang: ");
            string rang = Console.ReadLine();

            LoLAccount accountToAdd = new LoLAccount()
            {
                SummonerName = naam,
                AantalOfRp   = rp,
                AantalOfIp   = ip,
                HuidigeRang  = rang
            };

            mgr.AddLoLAccount(accountToAdd);
            Console.WriteLine("Er zijn momenteel " + mgr.ReadAllAccounts().Count() + "in de databank");
        }
예제 #2
0
        private static void ActionRemoveAccount()
        {
            Console.Write("Geef het id van het account dat je wil verwijderen: ");
            int input = Int32.Parse(Console.ReadLine());

            LoLAccount accountToDelete = mgr.ReadAccount(input);

            mgr.DeleteAccount(accountToDelete);
        }
예제 #3
0
 public void UpdateName(LoLAccount accountToUpdate)
 {
     using (ISession session = NHibernateHelper.OpenSession())
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Update(accountToUpdate);
             transaction.Commit();
         }
 }
예제 #4
0
 public void DeleteAccount(LoLAccount accountToRemove)
 {
     using (ISession session = NHibernateHelper.OpenSession())
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Delete(accountToRemove);
             transaction.Commit();
         }
 }
예제 #5
0
 public void AddLoLAccount(LoLAccount accountToAdd)
 {
     using (ISession session = NHibernateHelper.OpenSession())
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Save(accountToAdd);
             transaction.Commit();
         }
 }
예제 #6
0
        private static void ActionUpdateName()
        {
            Console.Write("Geef het id van het account dat je wil update: ");
            int input = Int32.Parse(Console.ReadLine());

            LoLAccount accountToUpdate = mgr.ReadAccount(input);

            Console.Write("Nieuwe naam:");
            string naam = Console.ReadLine();

            accountToUpdate.SummonerName = naam;
            mgr.ChangeName(accountToUpdate);
        }
예제 #7
0
        private static void ActionShowAccount()
        {
            Console.WriteLine("Account lijst: ");
            foreach (var acc in mgr.ReadAllAccounts())
            {
                Console.WriteLine(acc.Id + ") " + acc.SummonerName);
            }
            Console.WriteLine("Geeft het id in: ");
            int input = Int32.Parse(Console.ReadLine());

            LoLAccount account = mgr.ReadAccount(input);

            Console.WriteLine(account.Id + ": " + account.SummonerName + " - " + account.AantalOfIp + " - " + account.HuidigeRang);
        }
예제 #8
0
 public void DeleteAccount(LoLAccount AccountToDelete)
 {
     repo.DeleteAccount(AccountToDelete);
 }
예제 #9
0
 public void ChangeName(LoLAccount AccountToUpdate)
 {
     repo.UpdateName(AccountToUpdate);
 }
예제 #10
0
 public void AddLoLAccount(LoLAccount AccountToAdd)
 {
     repo.AddLoLAccount(AccountToAdd);
 }