Пример #1
0
    public bool UpdateHR_ProvidentfundAmount(HR_ProvidentfundAmount hR_ProvidentfundAmount)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateHR_ProvidentfundAmount", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@ProvidentfundAmountID", SqlDbType.Int).Value = hR_ProvidentfundAmount.ProvidentfundAmountID;
            cmd.Parameters.Add("@EmployeeID", SqlDbType.NVarChar).Value = hR_ProvidentfundAmount.EmployeeID;
            cmd.Parameters.Add("@EmployeeContributionAmount", SqlDbType.Decimal).Value = hR_ProvidentfundAmount.EmployeeContributionAmount;
            cmd.Parameters.Add("@CompanyContributionAmount", SqlDbType.Decimal).Value = hR_ProvidentfundAmount.CompanyContributionAmount;
            cmd.Parameters.Add("@PayrollDate", SqlDbType.DateTime).Value = hR_ProvidentfundAmount.PayrollDate;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_ProvidentfundAmount.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_ProvidentfundAmount.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Пример #2
0
    public HR_ProvidentfundAmount GetHR_ProvidentfundAmountFromReader(IDataReader reader)
    {
        try
        {
            HR_ProvidentfundAmount hR_ProvidentfundAmount = new HR_ProvidentfundAmount
                (

                     DataAccessObject.IsNULL<int>(reader["ProvidentfundAmountID"]),
                     DataAccessObject.IsNULL<string>(reader["EmployeeID"].ToString()),
                     DataAccessObject.IsNULL<decimal>(reader["EmployeeContributionAmount"]),
                     DataAccessObject.IsNULL<decimal>(reader["CompanyContributionAmount"]),
                     DataAccessObject.IsNULL<DateTime>(reader["PayrollDate"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["ModifiedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["ModifiedDate"])
                );
            return hR_ProvidentfundAmount;
        }
        catch (Exception ex)
        {
            return null;
        }
    }