Title: Data Base Operations                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
using System;
using System.Data;
using System.Data.SqlClient;
namespace EmployeeAffair
{
    public class DBOperations
    {
        private SqlConnection SQLConnection;
        public DBOperations(SqlConnection pSQlConnection)
        {
            this.SQLConnection = pSQlConnection;
        }
        public DBOperations(SqlConnection pSQLConnection, ref SqlTransaction pSQLTransaction)
        {
            this.SQLConnection = pSQLConnection;
            pSQLTransaction = this.SQLConnection.BeginTransaction();
        }
        public void sp_Attendences_AddEdit(Guid fld_AttendenceID, string fld_AttendDate, string fld_AttendTime, int fld_LatePeriod, Guid fld_EmployeeID, Guid fld_YearID)
        {
            try
            {
                string SQL = "sp_Attendences_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_AttendenceID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_AttendenceID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_AttendDate", SqlDbType.NVarChar);
                pr.Value = fld_AttendDate;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_AttendTime", SqlDbType.NVarChar);
                pr.Value = fld_AttendTime;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_LatePeriod", SqlDbType.Int);
                pr.Value = fld_LatePeriod;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_Attendences_Delete(Guid fld_AttendenceID)
        {
            try
            {
                string SQL = "sp_Attendences_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_AttendenceID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_AttendenceID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_Attendences_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_Attendences_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Attendences_GetByEmployeeIDAndYearID(Guid fld_EmployeeID, Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Attendences_GetByEmployeeIDAndYearID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Attendences_GetByEmployeeIDForAllYears(Guid fld_EmployeeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Attendences_GetByEmployeeIDForAllYears";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Attendences_GetByRecordBetweenTwoDates(Guid fld_EmployeeID, Guid fld_YearID, string fld_StartDate, string fld_EndDate)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Attendences_GetByRecordBetweenTwoDates";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_StartDate", SqlDbType.NVarChar);
                pr.Value = fld_StartDate;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EndDate", SqlDbType.NVarChar);
                pr.Value = fld_EndDate;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Attendences_GetEmpAttendByDate(Guid fld_EmployeeID, string fld_Date)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Attendences_GetEmpAttendByDate";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Date", SqlDbType.NVarChar);
                pr.Value = fld_Date;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Attendences_GetInfo(Guid fld_AttendenceID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Attendences_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_AttendenceID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_AttendenceID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_basicData_AddEdit(string fld_InstituteName, string fld_ManagerName, string fld_SubManagerName, string fld_Address, string fld_PhoneNo)
        {
            try
            {
                string SQL = "sp_basicData_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_InstituteName", SqlDbType.NVarChar);
                pr.Value = fld_InstituteName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_ManagerName", SqlDbType.NVarChar);
                pr.Value = fld_ManagerName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_SubManagerName", SqlDbType.NVarChar);
                pr.Value = fld_SubManagerName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Address", SqlDbType.NVarChar);
                pr.Value = fld_Address;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_PhoneNo", SqlDbType.NVarChar);
                pr.Value = fld_PhoneNo;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_basicData_GetRecord()
        {
            DataSet result;
            try
            {
                string SQL = "sp_basicData_GetRecord";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_EmployeeHolidays_AddEdit(Guid fld_EmpHolidaysID, Guid fld_HolidayTypeID, Guid fld_YearID, Guid fld_EmployeeID, string fld_StartDate, string fld_EndDate, int fld_HolidayPeriod, string fld_Note, byte[] fld_HolidayOtherFields, byte[] fld_OtherFields)
        {
            try
            {
                string SQL = "sp_EmployeeHolidays_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmpHolidaysID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmpHolidaysID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_HolidayTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayTypeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_StartDate", SqlDbType.NVarChar);
                pr.Value = fld_StartDate;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EndDate", SqlDbType.NVarChar);
                pr.Value = fld_EndDate;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_HolidayPeriod", SqlDbType.Int);
                pr.Value = fld_HolidayPeriod;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Note", SqlDbType.NText);
                pr.Value = fld_Note;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_HolidayOtherFields", SqlDbType.Image);
                pr.Value = fld_HolidayOtherFields;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_OtherFields", SqlDbType.Image);
                pr.Value = fld_OtherFields;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_EmployeeHolidays_Delete(Guid fld_EmpHolidaysID)
        {
            try
            {
                string SQL = "sp_EmployeeHolidays_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmpHolidaysID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmpHolidaysID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_EmployeeHolidays_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_EmployeeHolidays_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_EmployeeHolidays_GetByDateAndEmpAndYear(Guid fld_YearID, Guid fld_EmployeeID, string fld_Date)
        {
            DataSet result;
            try
            {
                string SQL = "sp_EmployeeHolidays_GetByDateAndEmpAndYear";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Date", SqlDbType.NVarChar);
                pr.Value = fld_Date;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_EmployeeHolidays_GetByEmpAndYear(Guid fld_EmployeeID, Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_EmployeeHolidays_GetByEmpAndYear";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_EmployeeHolidays_GetByYearID(Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_EmployeeHolidays_GetByYearID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_EmployeeHolidays_GetHolidayTypeID(Guid fld_HolidayTypeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_EmployeeHolidays_GetHolidayTypeID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_HolidayTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayTypeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_EmployeeHolidays_GetInfo(Guid fld_EmpHolidaysID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_EmployeeHolidays_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmpHolidaysID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmpHolidaysID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_Employees_AddEdit(Guid fld_EmployeeID, string fld_EmployeeName, string fld_SigelMadani, string fld_PcNo, Guid fld_EmployeeStatus, string fld_JobNo, Guid fld_JobTypeID, Guid fld_JobNameID, string fld_LevelNameKey, string fld_LevelNameValue, string fld_JoinedDate, string fld_Start3Years)
        {
            try
            {
                string SQL = "sp_Employees_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EmployeeName", SqlDbType.NVarChar);
                pr.Value = fld_EmployeeName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_SigelMadani", SqlDbType.NVarChar);
                pr.Value = fld_SigelMadani;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_PcNo", SqlDbType.NVarChar);
                pr.Value = fld_PcNo;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EmployeeStatus", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeStatus;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JobNo", SqlDbType.NVarChar);
                pr.Value = fld_JobNo;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JobNameID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobNameID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_LevelNameKey", SqlDbType.NVarChar);
                pr.Value = fld_LevelNameKey;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_LevelNameValue", SqlDbType.NVarChar);
                pr.Value = fld_LevelNameValue;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JoinedDate", SqlDbType.NVarChar);
                pr.Value = fld_JoinedDate;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Start3Years", SqlDbType.NVarChar);
                pr.Value = fld_Start3Years;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_Employees_Delete(Guid fld_EmployeeID)
        {
            try
            {
                string SQL = "sp_Employees_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_Employees_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_Employees_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Employees_GetByJobNameID(Guid fld_JobNameID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Employees_GetByJobNameID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobNameID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobNameID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Employees_GetByJobStatusID(Guid fld_JobStatusID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Employees_GetByJobStatusID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobStatusID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobStatusID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Employees_GetByJobTypeID(Guid fld_JobTypeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Employees_GetByJobTypeID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Employees_GetIDAndName()
        {
            DataSet result;
            try
            {
                string SQL = "sp_Employees_GetIDAndName";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Employees_GetInfo(Guid fld_EmployeeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Employees_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_Holidays_AddEdit(Guid fld_HolidayID, Guid fld_YearID, string fld_HolidayName, string fld_HolidayStart, string fld_HolidayEnd)
        {
            try
            {
                string SQL = "sp_Holidays_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_HolidayID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_HolidayName", SqlDbType.NVarChar);
                pr.Value = fld_HolidayName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_HolidayStart", SqlDbType.NVarChar);
                pr.Value = fld_HolidayStart;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_HolidayEnd", SqlDbType.NVarChar);
                pr.Value = fld_HolidayEnd;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_Holidays_Delete(Guid fld_HolidayID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Holidays_Delete";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_HolidayID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Holidays_GetAll(Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Holidays_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Holidays_GetInfo(Guid fld_HolidayID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Holidays_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_HolidayID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_HolidayTypes_AddEdit(Guid fld_HolidayTypeID, string fld_HolidayTypeName, byte[] fld_OtherFields, string fld_Note, bool fld_IsValidHoliday)
        {
            try
            {
                string SQL = "sp_HolidayTypes_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_HolidayTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayTypeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_HolidayTypeName", SqlDbType.NVarChar);
                pr.Value = fld_HolidayTypeName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_OtherFields", SqlDbType.Image);
                pr.Value = fld_OtherFields;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Note", SqlDbType.NText);
                pr.Value = fld_Note;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_IsValidHoliday", SqlDbType.Bit);
                pr.Value = fld_IsValidHoliday;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_HolidayTypes_Delete(Guid fld_HolidayTypeID)
        {
            try
            {
                string SQL = "sp_HolidayTypes_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_HolidayTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayTypeID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_HolidayTypes_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_HolidayTypes_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_HolidayTypes_GetInfo(Guid fld_HolidayTypeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_HolidayTypes_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_HolidayTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_HolidayTypeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_HolidayTypes_GetNameAndID()
        {
            DataSet result;
            try
            {
                string SQL = "sp_HolidayTypes_GetNameAndID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_JobNames_AddEdit(Guid fld_JobNameID, Guid fld_JobTypeID, string fld_JobName, string fld_Note)
        {
            try
            {
                string SQL = "sp_JobNames_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobNameID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobNameID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JobName", SqlDbType.NVarChar);
                pr.Value = fld_JobName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Note", SqlDbType.NText);
                pr.Value = fld_Note;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_JobNames_Delete(Guid fld_JobNameID)
        {
            try
            {
                string SQL = "sp_JobNames_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobNameID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobNameID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_JobNames_GetByJobTypeID(Guid fld_JobTypeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_JobNames_GetByJobTypeID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_JobNames_GetByTypeID(Guid fld_JobTypeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_JobNames_GetByTypeID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_JobNames_GetInfo(Guid fld_JobNameID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_JobNames_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobNameID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobNameID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_JobStatuses_AddEdit(Guid fld_JobStatusID, string fld_JobStatusName, string fld_Note)
        {
            try
            {
                string SQL = "sp_JobStatuses_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobStatusID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobStatusID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JobStatusName", SqlDbType.NVarChar);
                pr.Value = fld_JobStatusName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Note", SqlDbType.NText);
                pr.Value = fld_Note;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_JobStatuses_Delete(Guid fld_JobStatusID)
        {
            try
            {
                string SQL = "sp_JobStatuses_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobStatusID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobStatusID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_JobStatuses_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_JobStatuses_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_JobStatuses_GetInfo(Guid fld_JobStatusID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_JobStatuses_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobStatusID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobStatusID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_JobTypes_AddEdit(Guid fld_JobTypeID, string fld_JobTypeName, string fld_Note)
        {
            try
            {
                string SQL = "sp_JobTypes_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_JobTypeName", SqlDbType.NVarChar);
                pr.Value = fld_JobTypeName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Note", SqlDbType.NText);
                pr.Value = fld_Note;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_JobTypes_Delete(Guid fld_JobTypeID)
        {
            try
            {
                string SQL = "sp_JobTypes_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_JobTypes_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_JobTypes_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_JobTypes_GetInfo(Guid fld_JobTypeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_JobTypes_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_JobTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_JobTypeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_MonthsCalendar_AddEdit(int fld_Year, int fld_Month, int fld_Day, DateTime fld_GregDate, Guid fld_YearID)
        {
            try
            {
                string SQL = "sp_MonthsCalendar_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_Year", SqlDbType.Int);
                pr.Value = fld_Year;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Month", SqlDbType.Int);
                pr.Value = fld_Month;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Day", SqlDbType.Int);
                pr.Value = fld_Day;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_GregDate", SqlDbType.DateTime);
                pr.Value = fld_GregDate;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_MonthsCalendar_Compare(string fld_StartDate, string fld_EndDate)
        {
            DataSet result;
            try
            {
                string SQL = "sp_MonthsCalendar_Compare";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_StartDate", SqlDbType.NVarChar);
                pr.Value = fld_StartDate;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EndDate", SqlDbType.NVarChar);
                pr.Value = fld_EndDate;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_MonthsCalendar_GetInfo(int fld_Year, int fld_Month)
        {
            DataSet result;
            try
            {
                string SQL = "sp_MonthsCalendar_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_Year", SqlDbType.Int);
                pr.Value = fld_Year;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Month", SqlDbType.Int);
                pr.Value = fld_Month;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_MonthsCalendar_GetMonthsByYearDateAndYearID(int fld_Year, Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_MonthsCalendar_GetMonthsByYearDateAndYearID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_Year", SqlDbType.Int);
                pr.Value = fld_Year;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Users_AddUpdate(Guid fld_UserID, string fld_Username, string fld_Password, string fld_FullName)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Users_AddUpdate";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_UserID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_UserID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Username", SqlDbType.NVarChar);
                pr.Value = fld_Username;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Password", SqlDbType.NVarChar);
                pr.Value = fld_Password;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_FullName", SqlDbType.NVarChar);
                pr.Value = fld_FullName;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_Users_Delete(Guid fld_UserID)
        {
            try
            {
                string SQL = "sp_Users_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_UserID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_UserID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_Users_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_Users_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Users_GetInfo(Guid fld_UserID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Users_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_UserID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_UserID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Users_VerifyUser(string fld_Username, string fld_Password)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Users_VerifyUser";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_Username", SqlDbType.NVarChar);
                pr.Value = fld_Username;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Password", SqlDbType.NVarChar);
                pr.Value = fld_Password;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_WorkPermissions_AddEdit(Guid fld_WorkPermissionID, Guid fld_YearID, Guid fld_EmployeeID, string fld_PermitDate, string fld_PermitTime, int fld_PermitPeriod, Guid fld_PermissionTypeID, string fld_Note)
        {
            try
            {
                string SQL = "sp_WorkPermissions_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_WorkPermissionID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_WorkPermissionID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_PermitDate", SqlDbType.NVarChar);
                pr.Value = fld_PermitDate;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_PermitTime", SqlDbType.NVarChar);
                pr.Value = fld_PermitTime;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_PermitPeriod", SqlDbType.Int);
                pr.Value = fld_PermitPeriod;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_PermissionTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_PermissionTypeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Note", SqlDbType.NText);
                pr.Value = fld_Note;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_WorkPermissions_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkPermissions_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_WorkPermissions_GetByEmployeeIDAndYearID(Guid fld_YearID, Guid fld_EmployeeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkPermissions_GetByEmployeeIDAndYearID";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_EmployeeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_EmployeeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_WorkPermissions_GetInfo(Guid fld_WorkPermissionID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkPermissions_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_WorkPermissionID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_WorkPermissionID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_WorkPermissionTypes_AddEdit(Guid fld_WPermissionTypeID, string fld_WPermissionTypeName, string fld_Note)
        {
            try
            {
                string SQL = "sp_WorkPermissionTypes_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_WPermissionTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_WPermissionTypeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_WPermissionTypeName", SqlDbType.NVarChar);
                pr.Value = fld_WPermissionTypeName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_Note", SqlDbType.NText);
                pr.Value = fld_Note;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public void sp_WorkPermissionTypes_Delete(Guid fld_WPermissionTypeID)
        {
            try
            {
                string SQL = "sp_WorkPermissionTypes_Delete";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_WPermissionTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_WPermissionTypeID;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_WorkPermissionTypes_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkPermissionTypes_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_WorkPermissionTypes_GetInfo(Guid fld_WPermissionTypeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkPermissionTypes_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_WPermissionTypeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_WPermissionTypeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_WorkTimes_AddEdit(Guid fld_WorkTimeID, Guid fld_YearID, string fld_WorkPeriodName, string fld_FStartWorkTime, string fld_FEndWorkTime, string fld_FStartDate, string fld_FEndDate)
        {
            try
            {
                string SQL = "sp_WorkTimes_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_WorkTimeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_WorkTimeID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_WorkPeriodName", SqlDbType.NVarChar);
                pr.Value = fld_WorkPeriodName;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_FStartWorkTime", SqlDbType.NVarChar);
                pr.Value = fld_FStartWorkTime;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_FEndWorkTime", SqlDbType.NVarChar);
                pr.Value = fld_FEndWorkTime;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_FStartDate", SqlDbType.NVarChar);
                pr.Value = fld_FStartDate;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_FEndDate", SqlDbType.NVarChar);
                pr.Value = fld_FEndDate;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_WorkTimes_GetAll(Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkTimes_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_WorkTimes_GetInfo(Guid fld_WorkTimeID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkTimes_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_WorkTimeID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_WorkTimeID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_WorkTimes_GetTimeByDate(string fld_Date, Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_WorkTimes_GetTimeByDate";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_Date", SqlDbType.NVarChar);
                pr.Value = fld_Date;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public void sp_Years_AddEdit(Guid fld_YearID, string fld_FirstTermStart, string fld_FirstTermEnd, string fld_SecondTermStart, string fld_SecondTermEnd, string fld_MoneyYearStart, string fld_MoneyYearEnd, bool fld_IsCurrentYear)
        {
            try
            {
                string SQL = "sp_Years_AddEdit";
                SqlCommand SQLCommand = new SqlCommand(SQL, this.SQLConnection);
                SQLCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_FirstTermStart", SqlDbType.NVarChar);
                pr.Value = fld_FirstTermStart;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_FirstTermEnd", SqlDbType.NVarChar);
                pr.Value = fld_FirstTermEnd;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_SecondTermStart", SqlDbType.NVarChar);
                pr.Value = fld_SecondTermStart;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_SecondTermEnd", SqlDbType.NVarChar);
                pr.Value = fld_SecondTermEnd;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_MoneyYearStart", SqlDbType.NVarChar);
                pr.Value = fld_MoneyYearStart;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_MoneyYearEnd", SqlDbType.NVarChar);
                pr.Value = fld_MoneyYearEnd;
                SQLCommand.Parameters.Add(pr);
                pr = new SqlParameter("@fld_IsCurrentYear", SqlDbType.Bit);
                pr.Value = fld_IsCurrentYear;
                SQLCommand.Parameters.Add(pr);
                SQLCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public DataSet sp_Years_Delete(Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Years_Delete";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Years_GetAll()
        {
            DataSet result;
            try
            {
                string SQL = "sp_Years_GetAll";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Years_GetCurrentYear()
        {
            DataSet result;
            try
            {
                string SQL = "sp_Years_GetCurrentYear";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Years_GetInfo(Guid fld_YearID)
        {
            DataSet result;
            try
            {
                string SQL = "sp_Years_GetInfo";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter pr = new SqlParameter("@fld_YearID", SqlDbType.UniqueIdentifier);
                pr.Value = fld_YearID;
                SQLDataAdapter.SelectCommand.Parameters.Add(pr);
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
        public DataSet sp_Years_GetStartEndYears()
        {
            DataSet result;
            try
            {
                string SQL = "sp_Years_GetStartEndYears";
                SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(SQL, this.SQLConnection);
                SQLDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                DataSet dataSet = new DataSet();
                SQLDataAdapter.Fill(dataSet);
                result = dataSet;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return result;
        }
    }
}