示例#1
0
        private static SalaryConfig GetItemFromReader(IDataReader dataReader)
        {
            SalaryConfig objItem = new SalaryConfig();

            objItem.SalConfigId = SqlHelper.GetString(dataReader, "SalConfigId");

            objItem.MinSalAmount = SqlHelper.GetDecimal(dataReader, "MinSalAmount");

            objItem.BHXH = SqlHelper.GetDecimal(dataReader, "BHXH");

            objItem.BHYT = SqlHelper.GetDecimal(dataReader, "BHYT");

            objItem.BHTN = SqlHelper.GetDecimal(dataReader, "BHTN");

            objItem.PerTaxReduce = SqlHelper.GetDecimal(dataReader, "PerTaxReduce");

            objItem.RelationTaxReduce = SqlHelper.GetDecimal(dataReader, "RelationTaxReduce");

            objItem.DateApply = SqlHelper.GetDateTime(dataReader, "DateApply");

            objItem.CreatedDate = SqlHelper.GetDateTime(dataReader, "CreatedDate");

            objItem.CreatedUser = SqlHelper.GetString(dataReader, "CreatedUser");
            return(objItem);
        }
示例#2
0
        public static SalaryConfig UpdateItem(SalaryConfig model)
        {
            String result = String.Empty;

            using (var reader = SqlHelper.ExecuteReader(CommandType.StoredProcedure, "tblSalaryConfig_Update", CreateSqlParameter(model)))
            {
                while (reader.Read())
                {
                    result = (String)reader[0];
                }
            }
            return(GetItemByID(result));
        }
示例#3
0
        public static SalaryConfig GetItemByID(String salConfigId)
        {
            SalaryConfig item      = new SalaryConfig();
            var          sqlParams = new SqlParameter[1];

            sqlParams[0] = new SqlParameter("@SalConfigId", salConfigId);
            using (var reader = SqlHelper.ExecuteReader("tblSalaryConfig_GetByID", sqlParams))
            {
                while (reader.Read())
                {
                    item = GetItemFromReader(reader);
                }
            }
            return(item);
        }
示例#4
0
        public static SalaryConfigCollection GetAllItem()
        {
            SalaryConfigCollection collection = new SalaryConfigCollection();

            using (var reader = SqlHelper.ExecuteReader("tblSalaryConfig_GetAll", null))
            {
                while (reader.Read())
                {
                    SalaryConfig obj = new SalaryConfig();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
示例#5
0
 private static SqlParameter[] CreateSqlParameter(SalaryConfig model)
 {
     return(new SqlParameter[]
     {
         new SqlParameter("@SalConfigId", model.SalConfigId),
         new SqlParameter("@MinSalAmount", model.MinSalAmount),
         new SqlParameter("@BHXH", model.BHXH),
         new SqlParameter("@BHYT", model.BHYT),
         new SqlParameter("@BHTN", model.BHTN),
         new SqlParameter("@PerTaxReduce", model.PerTaxReduce),
         new SqlParameter("@RelationTaxReduce", model.RelationTaxReduce),
         new SqlParameter("@DateApply", model.DateApply),
         new SqlParameter("@CreatedDate", model.CreatedDate),
         new SqlParameter("@CreatedUser", model.CreatedUser),
     });
 }