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

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllStdClass);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.StdClass stdClass = new Core.Business.StdClass();

                    if (!reader.IsDBNull(0)) stdClass.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) stdClass.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) stdClass.ClassCode = reader.GetString(2);
                    if (!reader.IsDBNull(3)) stdClass.State = reader.GetBoolean(3);

                    stdClass.MarkOld();
                    stdClasslist.Add(stdClass);
                }
                reader.Close();
            }
            return stdClasslist;
        }
Пример #2
0
        public IList<CY.GFive.Core.Business.StdClass> GetListByQuery(string wherestr)
        {
            IList<Core.Business.StdClass> stdClasslist = new List<Core.Business.StdClass>();
            SqlServerUtility sql = new SqlServerUtility();
            StringBuilder sb = new StringBuilder();
            sb.Append(SqlGetAllStdClass);
            if (!string.IsNullOrEmpty(wherestr))
            {
                sb.Append(" where 1=1 and " + wherestr);
            }
            SqlDataReader reader = sql.ExecuteSqlReader(sb.ToString());

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.StdClass stdClass = new Core.Business.StdClass();

                    if (!reader.IsDBNull(0)) stdClass.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) stdClass.StdCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) stdClass.ClassCode = reader.GetString(2);
                    if (!reader.IsDBNull(3)) stdClass.State = reader.GetBoolean(3);

                    stdClass.MarkOld();
                    stdClasslist.Add(stdClass);
                }
                reader.Close();
            }
            return stdClasslist;
        }
Пример #3
0
        public Core.Business.StdClass GetStdClassByClassCodeAndStdCode(string classCode, string stdCode)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@ClassCode", SqlDbType.NVarChar, classCode);
            sql.AddParameter("@StdCode", SqlDbType.NVarChar, stdCode);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetStdClassByClassCodeAndStdCode);

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

                if (!reader.IsDBNull(0)) stdClass.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) stdClass.StdCode = reader.GetString(1);
                if (!reader.IsDBNull(2)) stdClass.ClassCode = reader.GetString(2);
                if (!reader.IsDBNull(3)) stdClass.State = reader.GetBoolean(3);

                reader.Close();

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

                return null;
            }
        }