private void tileMetroPurchaseList_Click(object sender, EventArgs e)
 {
     try
     {
         PurchasingForm form = new PurchasingForm();
         form.Show();
         this.Dispose();
         this.Close();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            int id = int.Parse(staffIdTxt.Text);

            var search = (from x in db.Staff
                          where x.StaffId == id &&
                          x.StaffPassword.Equals(passTxt.Text)
                          select x.StaffPosition).FirstOrDefault();

            if (search != null)
            {
                if (search.Equals("Receptionist"))
                {
                    rForm = new ReceptionistForm();
                    rForm.Show();
                }
                else if (search.Equals("HouseKeeping"))
                {
                    hkForm = new HouseKeepingForm();
                    hkForm.Show();
                }
                else if (search.Equals("DiningRoom"))
                {
                    drForm = new DiningRoomForm();
                    drForm.Show();
                }
                else if (search.Equals("RoomService"))
                {
                    rsForm = new RoomServiceForm();
                    rsForm.Show();
                }
                else if (search.Equals("Kitchen"))
                {
                    kForm = new KitchenForm();
                    kForm.Show();
                }
                else if (search.Equals("Purchasing"))
                {
                    pForm = new PurchasingForm();
                    pForm.Show();
                }
                else if (search.Equals("AccountingAndFinance"))
                {
                    aafForm = new AccountingAndFinanceForm();
                    aafForm.Show();
                }
                else if (search.Equals("SalesAndMarketing"))
                {
                    samForm = new SalesAndMarketingForm();
                    samForm.Show();
                }
                else if (search.Equals("HumanCapital"))
                {
                    hcForm = new HumanCapitalForm();
                    hcForm.Show();
                }
                else if (search.Equals("HotelManager"))
                {
                    hmForm = new HotelManagerForm();
                    hmForm.Show();
                }
            }
            else
            {
                MessageBox.Show("Invalid Id or Password");
            }
        }