Example #1
0
 public static HR_JobLocation GetHR_JobLocationByJobLocationID(int JobLocationID)
 {
     HR_JobLocation hR_JobLocation = new HR_JobLocation();
     SqlHR_JobLocationProvider sqlHR_JobLocationProvider = new SqlHR_JobLocationProvider();
     hR_JobLocation = sqlHR_JobLocationProvider.GetHR_JobLocationByJobLocationID(JobLocationID);
     return hR_JobLocation;
 }
Example #2
0
 public static bool UpdateHR_JobLocation(HR_JobLocation hR_JobLocation)
 {
     SqlHR_JobLocationProvider sqlHR_JobLocationProvider = new SqlHR_JobLocationProvider();
     return sqlHR_JobLocationProvider.UpdateHR_JobLocation(hR_JobLocation);
 }
Example #3
0
 public static int InsertHR_JobLocation(HR_JobLocation hR_JobLocation)
 {
     SqlHR_JobLocationProvider sqlHR_JobLocationProvider = new SqlHR_JobLocationProvider();
     return sqlHR_JobLocationProvider.InsertHR_JobLocation(hR_JobLocation);
 }
Example #4
0
    public bool UpdateHR_JobLocation(HR_JobLocation hR_JobLocation)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateHR_JobLocation", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@JobLocationID", SqlDbType.Int).Value = hR_JobLocation.JobLocationID;
            cmd.Parameters.Add("@JobLocationName", SqlDbType.NVarChar).Value = hR_JobLocation.JobLocationName;
            cmd.Parameters.Add("@JobLocationName", SqlDbType.NVarChar).Value = hR_JobLocation.JobLocationName;
            cmd.Parameters.Add("@JobLocationName", SqlDbType.NVarChar).Value = hR_JobLocation.JobLocationName;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_JobLocation.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_JobLocation.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Example #5
0
    public int InsertHR_JobLocation(HR_JobLocation hR_JobLocation)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertHR_JobLocation", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@JobLocationID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@JobLocationName", SqlDbType.NVarChar).Value = hR_JobLocation.JobLocationName;
            cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = hR_JobLocation.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = hR_JobLocation.AddedDate;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_JobLocation.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_JobLocation.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@JobLocationID"].Value;
        }
    }
Example #6
0
    public HR_JobLocation GetHR_JobLocationFromReader(IDataReader reader)
    {
        try
        {
            HR_JobLocation hR_JobLocation = new HR_JobLocation
                (

                     DataAccessObject.IsNULL<int>(reader["JobLocationID"]),
                     DataAccessObject.IsNULL<string>(reader["JobLocationName"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["ModifiedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["ModifiedDate"])
                );
             return hR_JobLocation;
        }
        catch(Exception ex)
        {
            return null;
        }
    }