Ejemplo n.º 1
0
 public static HR_MaritualStatus GetHR_MaritualStatusByMaritualStatusID(int MaritualStatusID)
 {
     HR_MaritualStatus hR_MaritualStatus = new HR_MaritualStatus();
     SqlHR_MaritualStatusProvider sqlHR_MaritualStatusProvider = new SqlHR_MaritualStatusProvider();
     hR_MaritualStatus = sqlHR_MaritualStatusProvider.GetHR_MaritualStatusByMaritualStatusID(MaritualStatusID);
     return hR_MaritualStatus;
 }
Ejemplo n.º 2
0
 public static bool UpdateHR_MaritualStatus(HR_MaritualStatus hR_MaritualStatus)
 {
     SqlHR_MaritualStatusProvider sqlHR_MaritualStatusProvider = new SqlHR_MaritualStatusProvider();
     return sqlHR_MaritualStatusProvider.UpdateHR_MaritualStatus(hR_MaritualStatus);
 }
Ejemplo n.º 3
0
 public static int InsertHR_MaritualStatus(HR_MaritualStatus hR_MaritualStatus)
 {
     SqlHR_MaritualStatusProvider sqlHR_MaritualStatusProvider = new SqlHR_MaritualStatusProvider();
     return sqlHR_MaritualStatusProvider.InsertHR_MaritualStatus(hR_MaritualStatus);
 }
Ejemplo n.º 4
0
    public bool UpdateHR_MaritualStatus(HR_MaritualStatus hR_MaritualStatus)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateHR_MaritualStatus", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MaritualStatusID", SqlDbType.Int).Value = hR_MaritualStatus.MaritualStatusID;
            cmd.Parameters.Add("@MaritualStatusName", SqlDbType.NVarChar).Value = hR_MaritualStatus.MaritualStatusName;
            cmd.Parameters.Add("@MaritualStatusName", SqlDbType.NVarChar).Value = hR_MaritualStatus.MaritualStatusName;
            cmd.Parameters.Add("@MaritualStatusName", SqlDbType.NVarChar).Value = hR_MaritualStatus.MaritualStatusName;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_MaritualStatus.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_MaritualStatus.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Ejemplo n.º 5
0
    public int InsertHR_MaritualStatus(HR_MaritualStatus hR_MaritualStatus)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertHR_MaritualStatus", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MaritualStatusID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@MaritualStatusName", SqlDbType.NVarChar).Value = hR_MaritualStatus.MaritualStatusName;
            cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = hR_MaritualStatus.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = hR_MaritualStatus.AddedDate;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_MaritualStatus.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_MaritualStatus.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@MaritualStatusID"].Value;
        }
    }
Ejemplo n.º 6
0
    public HR_MaritualStatus GetHR_MaritualStatusFromReader(IDataReader reader)
    {
        try
        {
            HR_MaritualStatus hR_MaritualStatus = new HR_MaritualStatus
                (

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