Example #1
0
        public R_FILE GetFileByName(string Name, string UseType, OleExec DB)
        {
            string  strSql = $@"select r.id, r.name,r.filename,r.md5,r.usetype,r.valid,r.state,r.edit_time,r.edit_emp,blob_file from r_file r where r.name='{Name}' and r.usetype ='{UseType}' and r.valid = 1";
            DataSet ret    = DB.RunSelect(strSql);

            Row_R_FILE r = (Row_R_FILE)this.NewRow();

            if (ret.Tables[0].Rows.Count > 0)
            {
                r.loadData(ret.Tables[0].Rows[0]);
            }

            //if (r.NAME != null)
            //{
            //    strSql = $@"select ID , clob_file , blob_file from r_file r where r.name='{Name}' and r.usetype ='{UseType}' and r.valid = 1";
            //    //System.Data.OleDb.OleDbParameter para = new System.Data.OleDb.OleDbParameter(":FILE", "");
            //    //para.Direction = ParameterDirection.Output;
            //    //para.Size = 999999999;
            //    ////para.DbType = DbType.Object;
            //    //DB.ExecSqlNoReturn(strSql, new System.Data.OleDb.OleDbParameter[] { para });
            //    System.Data.OleDb.OleDbDataReader reader = DB.RunDataReader(strSql);
            //    if (reader.Read())
            //    {
            //        System.IO.TextReader TR = reader.GetTextReader(1);
            //        r.CLOB_FILE = TR.ReadToEnd();

            //    }
            //    reader.Close();
            //}
            return(r.GetDataObject());
        }
Example #2
0
        public R_FILE GetFileByFileName(string fileName, string UseType, OleExec DB)
        {
            string  strSql = $@"select r.id, r.name,r.filename,r.md5,r.usetype,r.valid,r.state,r.edit_time,r.edit_emp,blob_file from r_file r where r.filename='{fileName}' and r.usetype ='{UseType}' and r.valid = 1";
            DataSet ret    = DB.RunSelect(strSql);

            Row_R_FILE r = (Row_R_FILE)this.NewRow();

            if (ret.Tables[0].Rows.Count > 0)
            {
                r.loadData(ret.Tables[0].Rows[0]);
            }
            return(r.GetDataObject());
        }
Example #3
0
        public List <R_FILE> GetFileList(string UseType, OleExec DB)
        {
            List <R_FILE> ret    = new List <R_FILE>();
            string        strSql = $@"select r.id, r.name,r.filename,r.md5,r.usetype,r.valid,r.state,r.edit_time,r.edit_emp from r_file r where r.usetype ='{UseType}' and r.valid = 1";
            DataSet       res    = DB.RunSelect(strSql);

            for (int i = 0; i < res.Tables[0].Rows.Count; i++)
            {
                Row_R_FILE RRF = (Row_R_FILE)NewRow();
                RRF.loadData(res.Tables[0].Rows[i]);
                ret.Add(RRF.GetDataObject());
            }
            return(ret);
        }