Exemplo n.º 1
0
 /// <summary>
 /// �����ļ�ID��ѯ�ļ���Ϣ
 /// </summary>
 /// <param name="File_ID"></param>
 /// <returns></returns>
 public CollegeFile QueryUploadFileByID(string File_ID)
 {
     ILog log = LogManager.GetLogger("GlobalExceptionLoger");
     try
     {
         SqlParameter[] para = new SqlParameter[1];
         para[0] = new SqlParameter("@file_id", File_ID);
         DataSet ds = new DataSet();
         int result = DataServ.GetAllData(ref ds, "PROC_COLLEGE_QRYUPLOADFILEBYID", ref para);
         if (result.Equals(1))
         {
             DataTable dt = ds.Tables[0];
             if (dt.Rows.Count > 0)
             {
                 CollegeFile cf = new CollegeFile();
                 cf.file_id = dt.Rows[0]["FILE_ID"].ToString();
                 cf.file_name = dt.Rows[0]["FILE_NAME"].ToString();
                 cf.file = dt.Rows[0]["FILE_INFO"] as byte[];
                 cf.file_type = dt.Rows[0]["FILE_FORMAT"].ToString();
                 return cf;
             }
             else
             {
                 return null;
             }
         }
         else
             return null;
     }
     catch (Exception e1)
     {
         log.Error("ִ�д洢����PROC_COLLEGE_QRYUPLOADFILEBYIDʱ�����" + e1.Message);
         return null;
     }
 }
Exemplo n.º 2
0
 public void GetFileInfo()
 {
     CollegeFile cf = new CollegeFile();
     if (fileId == null || "".Equals(fileId))
     {
         return;
     }
     cf = cf.QueryUploadFileByID(fileId);
     if (cf == null)
     {
         return;
     }
     fileName = cf.File_Name;
     fileAddress = cf.FileLink;
     FileAddressLabel.Title = fileName;
     FileAddressLabel.HRef = fileAddress;
 }