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; }
public static bool UpdateHR_JobLocation(HR_JobLocation hR_JobLocation) { SqlHR_JobLocationProvider sqlHR_JobLocationProvider = new SqlHR_JobLocationProvider(); return sqlHR_JobLocationProvider.UpdateHR_JobLocation(hR_JobLocation); }
public static int InsertHR_JobLocation(HR_JobLocation hR_JobLocation) { SqlHR_JobLocationProvider sqlHR_JobLocationProvider = new SqlHR_JobLocationProvider(); return sqlHR_JobLocationProvider.InsertHR_JobLocation(hR_JobLocation); }
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; } }
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; } }
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; } }