Пример #1
0
        public IList<Core.Business.SubsidyRecordForEmployee> GetAllSubsidyRecordForEmployee()
        {
            IList<Core.Business.SubsidyRecordForEmployee> subsidyRecordForEmployeelist = new List<Core.Business.SubsidyRecordForEmployee>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllSubsidyRecordForEmployee);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.SubsidyRecordForEmployee subsidyRecordForEmployee = new Core.Business.SubsidyRecordForEmployee();

                    if (!reader.IsDBNull(0)) subsidyRecordForEmployee.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) subsidyRecordForEmployee.CheckState = reader.GetByte(1);
                    if (!reader.IsDBNull(2)) subsidyRecordForEmployee.SubsidyID = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) subsidyRecordForEmployee.Date = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) subsidyRecordForEmployee.Amount = reader.GetDecimal(4);
                    if (!reader.IsDBNull(5)) subsidyRecordForEmployee.Receiver = reader.GetString(5);
                    if (!reader.IsDBNull(6)) subsidyRecordForEmployee.AcidLevel = reader.GetString(6);
                    if (!reader.IsDBNull(7)) subsidyRecordForEmployee.Description = reader.GetString(7);

                    subsidyRecordForEmployee.MarkOld();
                    subsidyRecordForEmployeelist.Add(subsidyRecordForEmployee);
                }
                reader.Close();
            }
            return subsidyRecordForEmployeelist;
        }
Пример #2
0
        public Core.Business.SubsidyRecordForEmployee Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectSubsidyRecordForEmployee);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.SubsidyRecordForEmployee subsidyRecordForEmployee = new Core.Business.SubsidyRecordForEmployee();

                if (!reader.IsDBNull(0)) subsidyRecordForEmployee.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) subsidyRecordForEmployee.CheckState = reader.GetByte(1);
                if (!reader.IsDBNull(2)) subsidyRecordForEmployee.SubsidyID = reader.GetInt32(2);
                if (!reader.IsDBNull(3)) subsidyRecordForEmployee.Date = reader.GetDateTime(3);
                if (!reader.IsDBNull(4)) subsidyRecordForEmployee.Amount = reader.GetDecimal(4);
                if (!reader.IsDBNull(5)) subsidyRecordForEmployee.Receiver = reader.GetString(5);
                if (!reader.IsDBNull(6)) subsidyRecordForEmployee.AcidLevel = reader.GetString(6);
                if (!reader.IsDBNull(7)) subsidyRecordForEmployee.Description = reader.GetString(7);
                reader.Close();
                return subsidyRecordForEmployee;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Пример #3
0
        public IList<SubsidyRecordForEmployee> SelectByTypeandEmployeeCode(int typeId, string employeeCode)
        {
            IList<Core.Business.SubsidyRecordForEmployee> subsidyRecordForEmployeelist = new List<Core.Business.SubsidyRecordForEmployee>();
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Receiver", SqlDbType.NVarChar, employeeCode);
            sql.AddParameter("@SubsidyID", SqlDbType.Int, typeId);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectByTypeandCode);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.SubsidyRecordForEmployee subsidyRecordForEmployee = new Core.Business.SubsidyRecordForEmployee();

                    if (!reader.IsDBNull(0)) subsidyRecordForEmployee.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) subsidyRecordForEmployee.CheckState = reader.GetByte(1);
                    if (!reader.IsDBNull(2)) subsidyRecordForEmployee.SubsidyID = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) subsidyRecordForEmployee.Date = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) subsidyRecordForEmployee.Amount = reader.GetDecimal(4);
                    if (!reader.IsDBNull(5)) subsidyRecordForEmployee.Receiver = reader.GetString(5);
                    if (!reader.IsDBNull(6)) subsidyRecordForEmployee.AcidLevel = reader.GetString(6);
                    if (!reader.IsDBNull(7)) subsidyRecordForEmployee.Description = reader.GetString(7);

                    subsidyRecordForEmployee.MarkOld();
                    subsidyRecordForEmployeelist.Add(subsidyRecordForEmployee);
                }
                reader.Close();
            }
            return subsidyRecordForEmployeelist;
        }