Example #1
0
        public IList<SkillStatistics> Fill(string QueryParam)
        {
            if (string.IsNullOrEmpty(QueryParam))
                return this.GetAllSkillStatistics();

            IList<Core.Business.SkillStatistics> skillStatisticslist = new List<Core.Business.SkillStatistics>();

            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlFillSkillStatistics + QueryParam);

            if (reader != null && !reader.IsClosed)
            {
                while (reader.Read())
                {
                    Core.Business.SkillStatistics skillStatistics = new Core.Business.SkillStatistics();

                    if (!reader.IsDBNull(0)) skillStatistics.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) skillStatistics.CheckedWeek = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) skillStatistics.LftCode = reader.GetString(2);
                    if (!reader.IsDBNull(3)) skillStatistics.RgtCode = reader.GetString(3);
                    if (!reader.IsDBNull(4)) skillStatistics.CheckedDepart = reader.GetString(4);
                    if (!reader.IsDBNull(5)) skillStatistics.CheckedYear = reader.GetString(5);
                    if (!reader.IsDBNull(6)) skillStatistics.Term = reader.GetString(6);
                    if (!reader.IsDBNull(7)) skillStatistics.CheckedSign = reader.GetString(7);
                    if (!reader.IsDBNull(8)) skillStatistics.Inputter = reader.GetString(8);
                    if (!reader.IsDBNull(9)) skillStatistics.InputDate = reader.GetString(9);

                    skillStatistics.MarkOld();

                    skillStatisticslist.Add(skillStatistics);
                }
                reader.Close();
            }
            return skillStatisticslist;
        }
Example #2
0
        public SkillStatistics Select(string code)
        {
            if (string.IsNullOrEmpty(code))
                return null;

            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Code", SqlDbType.NVarChar, code, 30);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectSkillStatisticsByCode);

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

                if (!reader.IsDBNull(0)) skillStatistics.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) skillStatistics.CheckedWeek = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) skillStatistics.LftCode = reader.GetString(2);
                if (!reader.IsDBNull(3)) skillStatistics.RgtCode = reader.GetString(3);
                if (!reader.IsDBNull(4)) skillStatistics.CheckedDepart = reader.GetString(4);
                if (!reader.IsDBNull(5)) skillStatistics.CheckedYear = reader.GetString(5);
                if (!reader.IsDBNull(6)) skillStatistics.Term = reader.GetString(6);
                if (!reader.IsDBNull(7)) skillStatistics.CheckedSign = reader.GetString(7);
                if (!reader.IsDBNull(8)) skillStatistics.Inputter = reader.GetString(8);
                if (!reader.IsDBNull(9)) skillStatistics.InputDate = reader.GetString(9);

                reader.Close();

                skillStatistics.MarkOld();

                return skillStatistics;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }