Example #1
0
        /// <summary>
        /// 查询语句
        /// </summary>
        /// <param name="p_Sql"></param>
        /// <returns></returns>
        private DataTable PicFill(string p_Sql)
        {
            DataTable dt = new DataTable();

            switch (UCDBConnIndex)
            {
            case 1:
                dt = SysUtils.Fill(p_Sql);
                break;

            case 2:
                dt = SysUtilsSecond.Fill(p_Sql);
                break;

            case 3:
                dt = SysUtilsThird.Fill(p_Sql);
                break;

            case 4:
                dt = SysUtilsFourth.Fill(p_Sql);
                break;
            }

            return(dt);
        }
Example #2
0
        /// <summary>
        /// 读取文件名称
        /// </summary>
        /// <param name="p_FileID">文件ID</param>
        /// <param name="o_File">文件内容</param>
        public static string ReadFileExecTwo(int p_FileID)
        {
            string    FileExec = string.Empty;
            string    sql      = "SELECT FileExec FROM Pro_TecFile WHERE ID=" + SysString.ToDBString(p_FileID);
            DataTable dt       = SysUtilsSecond.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                FileExec = dt.Rows[0][0].ToString();
            }
            return(FileExec);
        }
Example #3
0
        /// <summary>
        /// 读取文件内容
        /// </summary>
        /// <param name="p_FileID">文件ID</param>
        /// <param name="o_File">文件内容</param>
        public static string ReadFileRemark(int p_FileID)
        {
            string    Remark = string.Empty;
            string    sql    = "SELECT Remark FROM Pro_TecFile WHERE ID=" + SysString.ToDBString(p_FileID);
            DataTable dt     = SysUtilsSecond.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                Remark = dt.Rows[0][0].ToString();
            }
            return(Remark);
        }
Example #4
0
        /// <summary>
        /// 读取文件内容
        /// </summary>
        /// <param name="p_FileID">文件ID</param>
        /// <param name="o_File">文件内容</param>
        public static byte[] ReadFileContext(int p_FileID)
        {
            byte[]    o_File = new byte[0];
            string    sql    = "SELECT Context FROM Pro_TecFile WHERE ID=" + SysString.ToDBString(p_FileID);
            DataTable dt     = SysUtilsSecond.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                o_File = (byte[])dt.Rows[0][0];
            }
            return(o_File);
        }
Example #5
0
        /// <summary>
        /// 读取文件
        /// </summary>
        /// <param name="p_TecID"></param>
        /// <param name="fileType"></param>
        /// <param name="o_FileID"></param>
        /// <param name="o_File"></param>
        public static int ReadFileID(int p_TecID, int fileType)
        {
            int       o_FileID = 0;
            string    sql      = "SELECT ID FROM Pro_TecFile WHERE TecID=" + SysString.ToDBString(p_TecID) + " AND FileType=" + fileType;
            DataTable dt       = SysUtilsSecond.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                o_FileID = SysConvert.ToInt32(dt.Rows[0][0]);
            }
            return(o_FileID);
        }
Example #6
0
        /// <summary>
        /// 读取文件扩展名
        /// </summary>
        /// <param name="p_FileID">文件Exec</param>
        public static string ReadFileExec(int p_FileID)
        {
            string    outstr = string.Empty;
            string    sql    = "SELECT FileExec FROM Pro_TecFile WHERE ID=" + SysString.ToDBString(p_FileID);
            DataTable dt     = SysUtilsSecond.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                outstr = dt.Rows[0][0].ToString();
                outstr = outstr.Replace(".", "");
            }
            return(outstr);
        }
Example #7
0
        /// <summary>
        /// 读取文件
        /// </summary>
        /// <param name="p_TecID"></param>
        /// <param name="fileType"></param>
        /// <param name="o_FileID"></param>
        /// <param name="o_File"></param>
        public static void ReadFile(string p_TecID, int fileType, out int o_FileID, out byte[] o_File, out string p_Remark)
        {
            o_FileID = 0;
            p_Remark = string.Empty;
            o_File   = new byte[0];
            string    sql = "SELECT ID,Context,Remark FROM Data_ItemPicture WHERE ItemCode=" + SysString.ToDBString(p_TecID) + " AND FileType=" + fileType;
            DataTable dt  = SysUtilsSecond.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                o_FileID = SysConvert.ToInt32(dt.Rows[0][0]);
                o_File   = (byte[])dt.Rows[0][1];
                p_Remark = dt.Rows[0][2].ToString();
            }
        }
Example #8
0
        /// <summary>
        /// 读取文件
        /// </summary>
        /// <param name="p_TecID"></param>
        /// <param name="fileType"></param>
        /// <param name="o_FileID"></param>
        /// <param name="o_File"></param>
        public static void ReadFile(int p_TecID, int fileType, out int o_FileID, out byte[] o_File, out string p_Remark, out string p_FileName, out string p_FileExec)
        {
            o_FileID   = 0;
            p_Remark   = string.Empty;
            o_File     = new byte[0];
            p_FileName = string.Empty;
            p_FileExec = string.Empty;
            string sql = "SELECT ID,Context,Remark,FileName,FileExec FROM Pro_TecFile WHERE TecID=" + SysString.ToDBString(p_TecID) + " AND FileType=" + fileType;
            //string sql = "SELECT ID,Context,Remark FROM Pro_TecFile WHERE  ID=" + SysString.ToDBString(o_FileID);
            DataTable dt = SysUtilsSecond.Fill(sql);

            if (dt.Rows.Count != 0)
            {
                o_FileID   = SysConvert.ToInt32(dt.Rows[0]["ID"]);
                o_File     = (byte[])dt.Rows[0]["Context"];
                p_Remark   = dt.Rows[0]["Remark"].ToString();
                p_FileName = dt.Rows[0]["FileName"].ToString();
                p_FileExec = dt.Rows[0]["FileExec"].ToString();
            }
        }