Example #1
0
        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);
        }
Example #2
0
        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);
        }