Exemple #1
0
 public void toLogin(string message)
 {
     string[] words = message.Split(':');
     if (words[1] == "Guest")
     {
         CurrentProfile.Role     = Role.Guest;
         CurrentProfile.me       = new User(words[9], words[0], words[2], words[3], words[4], words[5], words[6], words[7], words[8]);
         CurrentProfile.numbers  = new List <Number>();
         CurrentProfile.snum     = 0;
         CurrentProfile.bookings = new List <Booking>();
         CurrentProfile.stype    = 0;
         CurrentProfile.types    = new List <Type>();
         GuestCommands.sendType(0);
         CurrentProfile.updBook = false;
         AllForms.profile.filling(CurrentProfile.me);
         if (CurrentProfile.me.name == "")
         {
             MessageBox.Show("Пожалуйста, заполните анкету");
             AllForms.anketa = new Anketa();
             AllForms.anketa.Show();
         }
         else
         {
             AllForms.menuGuest.Show();
         }
         textBox1.Text = "";
         textBox2.Text = "";
         this.Hide();
     }
     if (words[1] == "Reseptionist")
     {
         CurrentProfile.Role       = Role.Receptionis;
         CurrentProfile.me         = new User(words[9], words[0], words[2], words[3], words[4], words[5], words[6], words[7], words[8]);
         CurrentProfile.numbers    = new List <Number>();
         CurrentProfile.snum       = 0;
         CurrentProfile.bookings   = new List <Booking>();
         CurrentProfile.stype      = 0;
         CurrentProfile.updBook    = false;
         CurrentProfile.types      = new List <Type>();
         CurrentProfile.guests     = new List <User>();
         CurrentProfile.updgue     = false;
         CurrentProfile.sizegue    = 0;
         CurrentProfile.settles    = new List <Settling>();
         CurrentProfile.updSettle  = false;
         CurrentProfile.sizeSettle = 0;
         GuestCommands.sendType(0);
         AllForms.receptionistMenu.Show();
         textBox1.Text = "";
         textBox2.Text = "";
         this.Hide();
     }
     if (words[1] == "Cleaner")
     {
         CurrentProfile.Role    = Role.Cleaner;
         CurrentProfile.numbers = new List <Number>();
         CurrentProfile.stype   = 0;
         CurrentProfile.types   = new List <Type>();
         GuestCommands.sendType(0);
         AllForms.CleanerMenu.Show();
         textBox1.Text = "";
         textBox2.Text = "";
         this.Hide();
     }
 }
Exemple #2
0
 public static void addType(string message)
 {
     string[] words = message.Split(':');
     types.Add(new Type(words[0], Int32.Parse(words[1]), Int32.Parse(words[2]), words[3] == "True"));
     GuestCommands.sendType(++stype);
 }