Beispiel #1
0
 private void btLogin_Click(object sender, EventArgs e)
 {
     pnSelect.Location = new Point(-1, -1);
     pnSelect.Visible  = false;
     lbFormName.Text   = "Màn hình chính";
     pnRight.Controls.Clear();
     if (btLogin.ButtonText == "Đăng nhập")
     {
         LoginForm loginForm = new LoginForm();
         loginForm.ShowDialog();
         if (loginForm.close)
         {
             return;
         }
         if (nguoiDung == "AD")
         {
             adminControl      = new AdminControl(pnSelect, pnRight, lbFormName);
             adminControl.Dock = DockStyle.Top;
             this.pnFunction.Controls.Add(adminControl);
         }
         else if (nguoiDung == "QL")
         {
             managerCotrol      = new ManagerCotrol(pnSelect, pnRight, lbFormName);
             managerCotrol.Dock = DockStyle.Top;
             this.pnFunction.Controls.Add(managerCotrol);
         }
         else if (nguoiDung == "NV")
         {
             staffControl      = new StaffControl(pnSelect, pnRight, lbFormName);
             staffControl.Dock = DockStyle.Top;
             this.pnFunction.Controls.Add(staffControl);
         }
         else
         {
             return;
         }
         btLogin.ButtonText = "Đăng xuất";
     }
     else if (btLogin.ButtonText == "Đăng xuất")
     {
         btLogin.ButtonText = "Đăng nhập";
         if (nguoiDung == "AD")
         {
             this.pnFunction.Controls.Remove(adminControl);
         }
         else if (nguoiDung == "QL")
         {
             this.pnFunction.Controls.Remove(managerCotrol);
         }
         else if (nguoiDung == "NV")
         {
             this.pnFunction.Controls.Remove(staffControl);
         }
     }
 }
Beispiel #2
0
        public staff()
        {
            InitializeComponent();

            //this enables the tables to be shown when the control reloads
            StaffControl bo = new StaffControl();
            DataTable    dt = new DataTable();

            dt = bo.getTable();
            datagridview.ItemsSource = dt.DefaultView;
        }
Beispiel #3
0
        public void Execute(object parameter)
        {
            try {
                staff        staff = new staff();
                StaffControl bo    = new StaffControl();
                DataTable    dt    = new DataTable();
                dt = bo.getTable();
                staff.datagridview.ItemsSource = dt.DefaultView;

                MessageBox.Show("Staff members successfully updated");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Something went wrong");
            }
        }
 public StaffBookTimeEditViewModel()
 {
     try
     {
         Salons = new SalonControl().GetAllSalonInfos();
         if (Salons.Count > 0)
         {
             Salon      = Salons[0];
             StaffInfos = new StaffControl().GetStaffInfosBySalon(Salon.Code);
             if (StaffInfos.Count > 0)
             {
                 StaffInfo = StaffInfos[0];
                 BookTimes = new StaffBookTimeControl().GetBookTimesByStaff(StaffInfo.Code);
             }
         }
     }
     catch (Exception ex)
     {
         AppLog.Error(typeof(StaffServiceTimeEditViewModel), ex.ToString());
     }
 }
 public void LoadData(SalonModel salon)
 {
     try
     {
         if (salon != null)
         {
             StaffInfos = new StaffControl().GetStaffInfosBySalon(salon.Code);
             if (StaffInfos.Count > 0)
             {
                 StaffInfo = StaffInfos[0];
             }
         }
         else
         {
             StaffInfos.Clear();
         }
     }
     catch (Exception ex)
     {
         AppLog.Error(typeof(StaffOrderEditViewModel), ex.ToString());
     }
 }
Beispiel #6
0
        //private void Add_Click(object sender, RoutedEventArgs e)
        //{
        //    StaffControl bo = new StaffControl();
        //    DataTable dt = new DataTable();
        //    dt = bo.getTable();
        //    datagridview.ItemsSource = dt.DefaultView;

        //}

        private void datagridview_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            StaffControl fetch = new StaffControl();

            fetch.getTable();
        }