コード例 #1
0
ファイル: HR_JobLocationManager.cs プロジェクト: anam/mal
 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;
 }
コード例 #2
0
ファイル: HR_JobLocationManager.cs プロジェクト: anam/mal
 public static bool UpdateHR_JobLocation(HR_JobLocation hR_JobLocation)
 {
     SqlHR_JobLocationProvider sqlHR_JobLocationProvider = new SqlHR_JobLocationProvider();
     return sqlHR_JobLocationProvider.UpdateHR_JobLocation(hR_JobLocation);
 }
コード例 #3
0
ファイル: HR_JobLocationManager.cs プロジェクト: anam/mal
 public static int InsertHR_JobLocation(HR_JobLocation hR_JobLocation)
 {
     SqlHR_JobLocationProvider sqlHR_JobLocationProvider = new SqlHR_JobLocationProvider();
     return sqlHR_JobLocationProvider.InsertHR_JobLocation(hR_JobLocation);
 }
コード例 #4
0
ファイル: HR_JobLocationProvider.cs プロジェクト: anam/mal
    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;
        }
    }
コード例 #5
0
ファイル: HR_JobLocationProvider.cs プロジェクト: anam/mal
    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;
        }
    }
コード例 #6
0
ファイル: HR_JobLocationProvider.cs プロジェクト: anam/mal
    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;
        }
    }