Beispiel #1
0
 public WorkerLogedInViewModel(HotelUser worker, WorkerLogedInView workerLogedInViewOpen)
 {
     this.worker       = worker;
     workerLogedInView = workerLogedInViewOpen;
     HotelUser         = service.GetWorkerDetailsById(worker.HotelUserId);
     RequestList       = new ObservableCollection <vwRequest>(service.RequestListByWorker(worker.HotelUserId));
 }
 public void QuitExecute()
 {
     try
     {
         WorkerLogedInView ownerView = new WorkerLogedInView(worker);
         ownerView.Show();
         requestViewView.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #3
0
 public void QuitExecute()
 {
     try
     {
         WorkerLogedInView workerView = new WorkerLogedInView(worker);
         workerView.Show();
         salariInfoView.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #4
0
        private void LoginExecute(object parametar)
        {
            var passwordBox = parametar as PasswordBox;
            var password    = passwordBox.Password;

            try
            {
                if (OwnerLogIn.Login(username, password) == true)
                {
                    MessageBox.Show("Successful login");
                    OwnerView window = new OwnerView();
                    window.Show();
                    main.Close();
                }
                else if (OwnerLogIn.Login(username, password) == false)
                {
                    HotelUser user = service.LoginUser(username, password);
                    if (user != null)
                    {
                        if (user.RoleId == 1)
                        {
                            MessageBox.Show("Successful login");
                            WorkerLogedInView window = new WorkerLogedInView(user);
                            window.Show();
                            main.Close();
                        }
                        else if (user.RoleId == 2)
                        {
                            MessageBox.Show("Successful login");
                            ManagerLogedInView window = new ManagerLogedInView(user);
                            window.Show();
                            main.Close();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Wrong user or password credentials");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
 public void SaveExecute(object parametar)
 {
     Request.WorkerId  = hotelWorker.WorkerId;
     Request.ManagerId = hotelWorker.ManagerId;
     try
     {
         if (service.AddNewRequest(Request) != 0)
         {
             MessageBox.Show("You have successfully added new request");
             WorkerLogedInView ownerView = new WorkerLogedInView(worker);
             ownerView.Show();
             requestViewView.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }