コード例 #1
0
        public IList<FileDown> Fill(string Code)
        {
            IList<Core.Business.FileDown> fileDownlist = new List<Core.Business.FileDown>();

            if (string.IsNullOrEmpty(Code))

                return fileDownlist;

            SqlServerUtility sql = new SqlServerUtility();

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

            SqlDataReader reader = sql.ExecuteSqlReader(SqlFillFileDownByItemCode);

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

                    if (!reader.IsDBNull(0)) fileDown.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) fileDown.DownLoader = reader.GetString(1);
                    if (!reader.IsDBNull(2)) fileDown.Date = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) fileDown.Des = reader.GetString(3);
                    if (!reader.IsDBNull(4)) fileDown.FileItemCode = reader.GetString(4);

                    fileDown.MarkOld();

                    fileDownlist.Add(fileDown);
                }

                reader.Close();
            }
            return fileDownlist;
        }
コード例 #2
0
        public IList<Core.Business.FileDown> GetAllFileDown()
        {
            IList<Core.Business.FileDown> fileDownlist = new List<Core.Business.FileDown>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllFileDown);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.FileDown fileDown = new Core.Business.FileDown();

                    if (!reader.IsDBNull(0)) fileDown.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) fileDown.DownLoader = reader.GetString(1);
                    if (!reader.IsDBNull(2)) fileDown.Date = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) fileDown.Des = reader.GetString(3);
                    if (!reader.IsDBNull(4)) fileDown.FileItemCode = reader.GetString(4);

                    fileDown.MarkOld();
                    fileDownlist.Add(fileDown);
                }
                reader.Close();
            }
            return fileDownlist;
        }