Example #1
0
        private void Manager_Load(object sender, EventArgs e)
        {
            WorkShift ws = new WorkShift();

            ws.UpdateWorkShift();
            this.ReloadData();
        }
        private void RemoveSchedule_btn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            WorkShift s = new WorkShift();

            s.DeleteData();
            s.InsertShift();
            GridControl_DisplayShift.DataSource = s.ShowShift();
        }
 private void Schedule_Load(object sender, EventArgs e)
 {
     // TODO: This line of code loads data into the 'hotel_ManagementDataSet11.Schedule' table. You can move, or remove it, as needed.
     //this.scheduleTableAdapter.Fill(this.hotel_ManagementDataSet11.Schedule);
     this.ShiftWork();
     WorkShift s = new WorkShift();
     //this.GetNumber();
 }
        public void GetNumber()
        {
            EmployeeHotel user    = new EmployeeHotel();
            WorkShift     w       = new WorkShift();
            double        manager = Convert.ToDouble(user.GetNumberOfManager());

            Getnum.Text = "Manager: " + manager.ToString();
        }
Example #5
0
 public void RoleLogin()
 {
     try
     {
         if (Radio_Customer.Checked == true)
         {
             this.LoginWithCustomer();
         }
         else
         {
             string        role = "";
             EmployeeHotel user = new EmployeeHotel();
             user.ID       = Convert.ToInt32(Username_tb.Text);
             user.Password = Password_tb.Text;
             Database   data    = new Database();
             SqlCommand command = new SqlCommand("SELECT Id, password, fname, lname, CMND, bdate, address, phone, email, " +
                                                 "salary, role, daywork, work, picture, gender, shift FROM Employee WHERE Id = @id AND password = @pass", data.GetConnection);
             command.Parameters.Add("@id", SqlDbType.Int).Value        = Username_tb.Text;
             command.Parameters.Add("@pass", SqlDbType.NVarChar).Value = Password_tb.Text;
             data.OpenConnection();
             DataTable table = user.GetUsers(command);
             if (table.Rows.Count > 0)
             {
                 SqlDataAdapter SDA = new SqlDataAdapter();
                 SDA.SelectCommand = command;
                 DataSet set = new DataSet();
                 SDA.Fill(set, "Employee");
                 data.CloseConnection();
                 role = table.Rows[0]["role"].ToString().Trim();
                 int          UserId  = Convert.ToInt32(table.Rows[0]["id"].ToString());
                 byte[]       pic     = (byte[])table.Rows[0]["picture"];
                 MemoryStream picture = new MemoryStream(pic);
                 GetID(UserId);
                 WorkShift w = new WorkShift();
                 if (user.GetLogin() && role == "Manager" && Manager_rbt.Checked == true)
                 {
                     Menu manager = new Menu();
                     manager.Label_ShowId.Text = UserId.ToString();
                     manager.Label_wcome.Text  = "Wellcome back " + table.Rows[0]["fname"].ToString().Trim();
                     manager.PictureUser.Image = Image.FromStream(picture);
                     //w.InsertId(Convert.ToInt32(UserId));
                     manager.ShowDialog();
                 }
                 else if (user.GetLogin() && role == "Receptionist" && Receptionist_rbt.Checked == true)
                 {
                 }
                 else if (user.GetLogin() && role == "Janitor" && Janitor_rbt.Checked == true)
                 {
                 }
                 else
                 {
                     XtraMessageBox.Show("Invalid Username of wrong Password, Try again or Create new account", "Login", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
             }
         }
     }
     catch
     {
         XtraMessageBox.Show("Invalid Username of wrong Password, Try again or Create new account", "Login", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
        private void Setshift_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            WorkShift w = new WorkShift();

            GridControl_DisplayShift.DataSource = w.ShowReloadShift();
        }
        public void ShiftWork()
        {
            WorkShift w = new WorkShift();

            GridControl_DisplayShift.DataSource = w.ShowShift();
        }