Exemple #1
0
        public void viewWorkedHoursSearch(ref DataGridView gv, string name)
        {
            DataFunctions dfun = new DataFunctions();

            MySqlDataAdapter selectEmployeesWorkedHours = new MySqlDataAdapter("SELECT Name, Hours From Employees Join WorkedHours on Employees.EmployeeID = WorkedHours.EmployeeID Where Name Like @name Order By Name", dbCon.Connection);

            selectEmployeesWorkedHours.SelectCommand.Parameters.AddWithValue("@name", "%" + name + "%");

            dfun.fillGridView(selectEmployeesWorkedHours, ref gv);
        }
        public void fillWorkedHoursGV(ref DataGridView gv, string year, object id)
        {
            DataFunctions dfun = new DataFunctions();

            //Name, Worked Hours
            MySqlDataAdapter selectEmployeesWorkedHours = new MySqlDataAdapter("Select Employees.Name, WorkedHours.Hours From WorkedHours " +
                                                                               "Join Employees On WorkedHours.EmployeeID = Employees.EmployeeID WHERE WorkedHours.EmployeeID=@id AND Year=@year", dbCon.Connection);

            selectEmployeesWorkedHours.SelectCommand.Parameters.AddWithValue("@id", id);
            selectEmployeesWorkedHours.SelectCommand.Parameters.AddWithValue("@year", year);

            dfun.fillGridView(selectEmployeesWorkedHours, ref gv);
        }
Exemple #3
0
        public void mainView(ref DataGridView gv, string name)
        {
            DataFunctions dfun = new DataFunctions();

            //Name, Total_Used_Hours, Sick_Hours_Left
            MySqlDataAdapter selectEmployeesWorkedHours = new MySqlDataAdapter("SELECT Name, Total_Used_Hours, Sick_Hours_Left+Hours As Sick_Hours_Left From Employees_Hours_Left_CurrentYear " +
                                                                               "Join AdditionalSickHours on Employees_Hours_Left_CurrentYear.EmployeeID = AdditionalSickHours.EmployeeID " +
                                                                               "WHERE Employees_Hours_Left_CurrentYear.Name LIKE @name AND AdditionalSickHours.Year = Year(CURRENT_TIMESTAMP()) Order By Name", dbCon.Connection);

            selectEmployeesWorkedHours.SelectCommand.Parameters.AddWithValue("@name", "%" + name + "%");

            dfun.fillGridView(selectEmployeesWorkedHours, ref gv);
        }
        public void fillSickHoursLeftGV(ref DataGridView gv, object id)
        {
            DataFunctions dfun = new DataFunctions();

            //Name, Total_Used_Hours, Sick_Hours_Left
            MySqlDataAdapter selectEmployeesWorkedHours = new MySqlDataAdapter("SELECT Name, Total_Used_Hours, Sick_Hours_Left+Hours As Sick_Hours_Left From Employees_Hours_Left_CurrentYear " +
                                                                               "Join AdditionalSickHours on Employees_Hours_Left_CurrentYear.EmployeeID = AdditionalSickHours.EmployeeID " +
                                                                               "WHERE Employees_Hours_Left_CurrentYear.EmployeeID = @id AND AdditionalSickHours.Year = Year(CURRENT_TIMESTAMP())", dbCon.Connection);

            selectEmployeesWorkedHours.SelectCommand.Parameters.AddWithValue("@id", id);

            dfun.fillGridView(selectEmployeesWorkedHours, ref gv);
        }