示例#1
0
        public IList<TRGoupArrange> Fill(string QuerayParam)
        {
            if (string.IsNullOrEmpty(QuerayParam))
                return this.GetAllTRGoupArrange();

            StringBuilder strBuilder = new StringBuilder();

            strBuilder.Append(SqlFillTRGoupArrange + QuerayParam);

            IList<Core.Business.TRGoupArrange> tRGoupArrangelist = new List<Core.Business.TRGoupArrange>();

            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(strBuilder.ToString());

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TRGoupArrange tRGoupArrange = new Core.Business.TRGoupArrange();

                    if (!reader.IsDBNull(0)) tRGoupArrange.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) tRGoupArrange.ArrangeCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) tRGoupArrange.Term = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) tRGoupArrange.YearNum = reader.GetString(3);
                    if (!reader.IsDBNull(4)) tRGoupArrange.MakeDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) tRGoupArrange.CheckerCode = reader.GetString(5);
                    if (!reader.IsDBNull(6)) tRGoupArrange.TRGroupCode = reader.GetString(6);
                    if (!reader.IsDBNull(7)) tRGoupArrange.ArrangeNames = reader.GetString(7);

                    tRGoupArrange.MarkOld();
                    tRGoupArrangelist.Add(tRGoupArrange);
                }
                reader.Close();
            }
            return tRGoupArrangelist;
        }
示例#2
0
        public IList<Core.Business.TRGoupArrange> GetAllTRGoupArrange()
        {
            IList<Core.Business.TRGoupArrange> tRGoupArrangelist = new List<Core.Business.TRGoupArrange>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllTRGoupArrange);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TRGoupArrange tRGoupArrange = new Core.Business.TRGoupArrange();

                    if (!reader.IsDBNull(0)) tRGoupArrange.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) tRGoupArrange.ArrangeCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) tRGoupArrange.Term = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) tRGoupArrange.YearNum = reader.GetString(3);
                    if (!reader.IsDBNull(4)) tRGoupArrange.MakeDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) tRGoupArrange.CheckerCode = reader.GetString(5);
                    if (!reader.IsDBNull(6)) tRGoupArrange.TRGroupCode = reader.GetString(6);
                    if (!reader.IsDBNull(7)) tRGoupArrange.ArrangeNames = reader.GetString(7);

                    tRGoupArrange.MarkOld();
                    tRGoupArrangelist.Add(tRGoupArrange);
                }
                reader.Close();
            }
            return tRGoupArrangelist;
        }
示例#3
0
        public TRGoupArrange Select(string code)
        {
            if (string.IsNullOrEmpty(code))
                return null;

            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Code", SqlDbType.NVarChar, code, 30);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectTRGoupArrangeByCode);

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

                if (!reader.IsDBNull(0)) tRGoupArrange.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) tRGoupArrange.ArrangeCode = reader.GetString(1);
                if (!reader.IsDBNull(2)) tRGoupArrange.Term = reader.GetInt32(2);
                if (!reader.IsDBNull(3)) tRGoupArrange.YearNum = reader.GetString(3);
                if (!reader.IsDBNull(4)) tRGoupArrange.MakeDate = reader.GetDateTime(4);
                if (!reader.IsDBNull(5)) tRGoupArrange.CheckerCode = reader.GetString(5);
                if (!reader.IsDBNull(6)) tRGoupArrange.TRGroupCode = reader.GetString(6);
                if (!reader.IsDBNull(7)) tRGoupArrange.ArrangeNames = reader.GetString(7);

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

                return null;
            }
        }