沈阳建筑大学毕业设计(论文)
adoWrap.AddParameter( \, OleDbType.Date, strStartTime ); adoWrap.AddParameter( \, OleDbType.Date, strEndTime ); } else {
strCmd += \;
adoWrap.AddParameter( \, OleDbType.Date, DateTime.Today.AddDays( -1 ) );
adoWrap.AddParameter( \, OleDbType.Date, DateTime.Today ); }
bool bRet = adoWrap.Excute( CommandType.Text, strCmd, dsItems, \, ref nRowCt );
if ( bRet ) {
return dsItems; } }
catch ( Exception ex ) {
string strError = ex.ToString( ); return null; }
finally {
adoWrap.Close( ); }
return null;
}
private void ExportExcelFile( ) {
string strStartTime = Request.QueryString[ \ ].ToString( ).Trim( ) + \0:00:00\; string strEndTime = Request.QueryString[ \ ].ToString( ).Trim( ) + \; StateUtility state = new StateUtility( );
//获取数据库表数据,存入DATESET
DataSet dsGSM = GetGSMExcel( strStartTime, strEndTime );
CreateExcel excel = new CreateExcel( );
string fileName = Server.MapPath( @\ );
沈阳建筑大学毕业设计(论文)
string filePath = Server.MapPath( @\ );
string exportFileName = excel.GetExportFileName( fileName, filePath, \, dsGSM );
GC.Collect( );
//this.linkDownload.HRef = filePath + exportFileName;
this.linkDownload.HRef = \ + exportFileName; this.linkDownload.InnerText = \点击下载 \ + exportFileName; linkBtn.Visible = false; }
protected void LinkButton1_Click( object sender, EventArgs e ) {
ExportExcelFile( ); } }
沈阳建筑大学毕业设计(论文)
附录二 权限管理部分代码
using System;
using System.Data;
using System.Data.OleDb; using System.Configuration; using System.Web;
using System.Web.Security; using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Threading;
///
/// AuthMagSvr 的摘要说明 ///
public class AuthMagSvr {
#region 页面构造函数 public AuthMagSvr( ) {
strConn = WebConfigMag.GetAppSettingValue( \ ); adoWrap = new CADOWrap( 'S', strConn ); }
#endregion
#region 页面对象及属性定义 private CADOWrap adoWrap; private string strConn = \; #endregion
#region 角色管理
#region 得到所有的角色管理的角色信息
public DataSet GetAllRoleInfo( ) {
adoWrap = new CADOWrap( 'S', strConn ); DataSet dsItems = new DataSet( ); try {
if ( adoWrap != null ) {
沈阳建筑大学毕业设计(论文)
adoWrap.Open( ); } else
return null; int nRowCt = 0;
string strCmd = \角色表 \;
bool bRet = adoWrap.Excute( CommandType.Text, strCmd, dsItems, \角色表\, ref nRowCt );
if ( bRet )
return dsItems; } catch {
return null; }
finally {
adoWrap.Close( ); }
return null; }
#endregion
#region 根据ID得到一条角色管理的角色基本信息 public DataSet GetRoleInfo( string strID ) {
adoWrap = new CADOWrap( 'S', strConn ); DataSet dsItems = new DataSet( ); try {
if ( adoWrap != null ) {
adoWrap.Open( ); } else
return null; int nRowCt = 0;
string strCmd = \角色表 WHERE ID=? \; adoWrap.RefreshParameter( );
adoWrap.AddParameter( \, OleDbType.VarChar, strID );
bool bRet = adoWrap.Excute( CommandType.Text, strCmd, dsItems, \角色表\, ref
沈阳建筑大学毕业设计(论文)
nRowCt );
if ( bRet )
return dsItems; } catch {
return null; }
finally {
adoWrap.Close( ); }
return null; }
#endregion
#region 根据ID删除一条用户管理的用户基本信息
public bool DelRoleInfo( string strID ) {
try {
if ( adoWrap != null ) {
adoWrap.Open( ); } else
return false;
int nRowCt = 0; string strCmd = \;
DataSet ds = new DataSet( );
//bool bRet=adoWrap.BeginTrans();
strCmd = \角色表 WHERE ID=? \; adoWrap.RefreshParameter( );
adoWrap.AddParameter( \, OleDbType.VarWChar, strID ); nRowCt = 0;
bool bRet = adoWrap.Excute( CommandType.Text, strCmd, ref nRowCt );
if ( !bRet )