//Updates the status of the employee public static bool UpdateStatus(int staffid, int changedby, int status) { using (Database.GetConnection()) { DatabaseDataSetTableAdapters.QueriesTableAdapter queriesTableAdapter = new DatabaseDataSetTableAdapters.QueriesTableAdapter(); if (queriesTableAdapter.UpdateEmployeeStatus(staffid, changedby, status) > 0) { return(true); } } return(false); }
public static bool InsertEmployee(Models.Staff staff, int changedBy) { using (Database.GetConnection()) { DatabaseDataSetTableAdapters.QueriesTableAdapter queriesTableAdapter = new DatabaseDataSetTableAdapters.QueriesTableAdapter(); if (queriesTableAdapter.insertEmployee(staff.LastName, staff.FirstName, staff.Nickname, staff.Username, staff.InOutStatusID, staff.TelephoneExtension, staff.FlagDeleted, staff.ManagerID, changedBy) > 0) { return(true); } } return(false); }
public static bool UpdateEmployeeDetails(Models.Staff staff) { using (Database.GetConnection()) { DatabaseDataSetTableAdapters.QueriesTableAdapter queriesTableAdapter = new DatabaseDataSetTableAdapters.QueriesTableAdapter(); if (queriesTableAdapter.UpdateEmployeeDetails(staff.StaffID, staff.LastName, staff.FirstName, staff.Nickname, staff.Username, staff.TelephoneExtension, staff.FlagDeleted) > 0) { return(true); } } return(false); }
public static bool DeleteEmployee(int StaffId) { using (Database.GetConnection()) { DatabaseDataSetTableAdapters.QueriesTableAdapter queriesTableAdapter = new DatabaseDataSetTableAdapters.QueriesTableAdapter(); if (queriesTableAdapter.DeleteEmployee(StaffId) > 0) { return(true); } } return(false); }
public static bool UpdateEmployeeDetails(int StaffID, string LastName, string FirstName, string Nickname, string username, string TelephoneExtension, bool FlagDeleted) { using (Database.GetConnection()) { DatabaseDataSetTableAdapters.QueriesTableAdapter queriesTableAdapter = new DatabaseDataSetTableAdapters.QueriesTableAdapter(); if (queriesTableAdapter.UpdateEmployeeDetails(StaffID, LastName, FirstName, Nickname, username, TelephoneExtension, FlagDeleted) > 0) { return(true); } } return(false); }