Example #1
0
 public static HR_CalenderHolidays GetHR_CalenderHolidaysByHolyDayID(int HolyDayID)
 {
     HR_CalenderHolidays hR_CalenderHolidays = new HR_CalenderHolidays();
     SqlHR_CalenderHolidaysProvider sqlHR_CalenderHolidaysProvider = new SqlHR_CalenderHolidaysProvider();
     hR_CalenderHolidays = sqlHR_CalenderHolidaysProvider.GetHR_CalenderHolidaysByHolyDayID(HolyDayID);
     return hR_CalenderHolidays;
 }
Example #2
0
 public static bool UpdateHR_CalenderHolidays(HR_CalenderHolidays hR_CalenderHolidays)
 {
     SqlHR_CalenderHolidaysProvider sqlHR_CalenderHolidaysProvider = new SqlHR_CalenderHolidaysProvider();
     return sqlHR_CalenderHolidaysProvider.UpdateHR_CalenderHolidays(hR_CalenderHolidays);
 }
Example #3
0
 public static int InsertHR_CalenderHolidays(HR_CalenderHolidays hR_CalenderHolidays)
 {
     SqlHR_CalenderHolidaysProvider sqlHR_CalenderHolidaysProvider = new SqlHR_CalenderHolidaysProvider();
     return sqlHR_CalenderHolidaysProvider.InsertHR_CalenderHolidays(hR_CalenderHolidays);
 }
Example #4
0
    public bool UpdateHR_CalenderHolidays(HR_CalenderHolidays hR_CalenderHolidays)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateHR_CalenderHolidays", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@HolyDayID", SqlDbType.Int).Value = hR_CalenderHolidays.HolyDayID;
            cmd.Parameters.Add("@HolyDayName", SqlDbType.NVarChar).Value = hR_CalenderHolidays.HolyDayName;
            cmd.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = hR_CalenderHolidays.StartDate;
            cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = hR_CalenderHolidays.EndDate;
            cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = hR_CalenderHolidays.EndDate;
            cmd.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = hR_CalenderHolidays.EndDate;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_CalenderHolidays.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_CalenderHolidays.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Example #5
0
    public HR_CalenderHolidays GetHR_CalenderHolidaysFromReader(IDataReader reader)
    {
        try
        {
            HR_CalenderHolidays hR_CalenderHolidays = new HR_CalenderHolidays
                (

                     DataAccessObject.IsNULL<int>(reader["HolyDayID"]),
                     DataAccessObject.IsNULL<string>(reader["HolyDayName"]),
                     DataAccessObject.IsNULL<DateTime>(reader["StartDate"]),
                     DataAccessObject.IsNULL<DateTime>(reader["EndDate"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["ModifiedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["ModifiedDate"])
                );
             return hR_CalenderHolidays;
        }
        catch(Exception ex)
        {
            return null;
        }
    }