?? fileatt.cs
字號(hào):
using System;
using System.Data ;
using DocAdmin.DAL ;
namespace DocAdmin.BLL
{
/// <summary>
/// FileAtt 的摘要說(shuō)明。
/// </summary>
public class FileAtt
{
public FileAtt()
{
//
// TODO: 在此處添加構(gòu)造函數(shù)邏輯
//
}
private int _attFileID ;
private int _fileID ;
private string _attName ;
private int _attSize ;
private string _attType ;
private string _attPath ;
private DateTime _crdt ;
private byte[] _content ;
private string _fileType ;
#region 公共屬性
public int AttFileID
{
get{ return _attFileID ;}
set{ _attFileID = value ;}
}
public int FileID
{
get{ return _fileID ;}
set{ _fileID = value ;}
}
public string AttName
{
get{ return _attName ;}
set{ _attName = value ;}
}
public int AttSize
{
get{ return _attSize ;}
set{ _attSize = value ;}
}
public string AttType
{
get{ return _attType ;}
set{ _attType = value ;}
}
public string AttPath
{
get{ return _attPath ;}
set{ _attPath = value ;}
}
public DateTime CRDT
{
get{ return _crdt ;}
set{ _crdt = value ;}
}
public byte[] Content
{
get{ return _content ;}
set{ _content = value ;}
}
public string FileType
{
get{ return _fileType ;}
set{ _fileType = value ;}
}
#endregion
#region 公共方法
public static string Download(int fileID)
{
//存儲(chǔ)過(guò)程名
string spName = "Doc_FileAtt_Download" ;
//存儲(chǔ)過(guò)程參數(shù)
object[] para = new object[] {fileID} ;
//調(diào)用數(shù)據(jù)訪問(wèn)方法執(zhí)行存儲(chǔ)過(guò)程
return DataAccess.ExecuteScalar(spName,para).ToString() ;
}
public static int DeleteFileAtt(int fileAttID)
{
int ret = -1 ;
//存儲(chǔ)過(guò)程名
string spName = "Doc_FileAtt_Delete" ;
//存儲(chǔ)過(guò)程參數(shù)
object[] para = new object[] {fileAttID} ;
//調(diào)用數(shù)據(jù)訪問(wèn)方法執(zhí)行存儲(chǔ)過(guò)程
ret = DataAccess.ExecuteNonQuery(spName,false,para) ;
return ret ;
}
public int AddFileAtt()
{
int ret = -1 ;
//存儲(chǔ)過(guò)程名
string spName = "Doc_FileAtt_Add" ;
//存儲(chǔ)過(guò)程參數(shù)
object[] para = new object[] {"",_fileID,_attName,_attSize,_attType,_attPath,_content,_fileType} ;
//調(diào)用數(shù)據(jù)訪問(wèn)方法執(zhí)行存儲(chǔ)過(guò)程
ret = DataAccess.ExecuteNonQuery(spName,true,para) ;
return ret ;
}
public static DataTable GetFileAttFromFileID(int fileID)
{
//存儲(chǔ)過(guò)程名
string spName = "Doc_FileAtt_GetFromFileID" ;
//存儲(chǔ)過(guò)程參數(shù)
object[] para = new object[] {fileID} ;
//調(diào)用數(shù)據(jù)訪問(wèn)方法執(zhí)行存儲(chǔ)過(guò)程
return DataAccess.ExecuteDataTable(spName,para) ;
}
#endregion
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -