Desktop.cs
资源名称:OAJP.rar [点击查看]
上传用户:jdb8708888
上传日期:2013-05-29
资源大小:19971k
文件大小:3k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
C#
- using System;
- using System.Collections;
- using System.Data;
- using System.Data.SqlClient;
- namespace UDS.Components
- {
- /// <summary>
- /// Desktop 的摘要说明。
- /// </summary>
- ///
- public class Desktop
- {
- public Desktop()
- {
- //
- // TODO: 在此处添加构造函数逻辑
- //
- }
- /// <summary>
- /// 得到我的最新文档
- /// </summary>
- /// <param name="UserName">用户名</param>
- /// <param name="RightCode">查看文档的权限代号</param>
- /// <returns>返回dataReader</returns>
- public SqlDataReader GetMyDocument(string UserName,int RightCode)
- {
- Database data = new Database();
- SqlDataReader dataReader = null;
- // 执行存储过程,并返回SqlDataReader对象
- SqlParameter[] prams = {
- data.MakeInParam("@UserName" , SqlDbType.VarChar , 300, UserName),
- data.MakeInParam("@RightCode",SqlDbType.Int,4,RightCode)
- };
- try
- {
- data.RunProc("sp_GetMyNewDoc",prams,out dataReader);
- return dataReader;
- }
- catch(Exception ex)
- {
- Error.Log(ex.ToString());
- throw new Exception("读取我的文档出错!",ex);
- }
- finally
- {
- data = null;
- dataReader = null;
- }
- }
- /// <summary>
- /// 得到我的最新收件
- /// </summary>
- /// <param name="UserName">用户名</param>
- /// <param name="MailFolderType">收件夹代号</param>
- /// <returns>返回dataReader</returns>
- public SqlDataReader GetMyMail(string UserName,int MailFolderType)
- {
- Database data = new Database();
- SqlDataReader dataReader = null;
- // 执行存储过程,并返回SqlDataReader对象
- SqlParameter[] prams = {
- data.MakeInParam("@UserName" , SqlDbType.VarChar , 20, UserName),
- data.MakeInParam("@MailFolderType",SqlDbType.Int,4,MailFolderType)
- };
- try
- {
- data.RunProc("SP_MailGetBriefInfo",prams,out dataReader);
- return dataReader;
- }
- catch(Exception ex)
- {
- Error.Log(ex.ToString());
- throw new Exception("读取我的邮件出错!",ex);
- }
- finally
- {
- data = null;
- dataReader = null;
- }
- }
- /// <summary>
- /// 得到我的最新审批
- /// </summary>
- /// <param name="UserName">用户名</param>
- /// <param name="RightCode">审批权限代号</param>
- /// <returns>返回dataReader</returns>
- public SqlDataReader GetMyApprove(string UserName,int RightCode)
- {
- Database data = new Database();
- SqlDataReader dataReader = null;
- // 执行存储过程,并返回SqlDataReader对象
- SqlParameter[] prams = {
- data.MakeInParam("@UserName" , SqlDbType.VarChar , 300, UserName),
- data.MakeInParam("@RightCode",SqlDbType.Int,4,RightCode)
- };
- try
- {
- data.RunProc("sp_GetMyApproved",prams,out dataReader);
- return dataReader;
- }
- catch(Exception ex)
- {
- Error.Log(ex.ToString());
- throw new Exception("读取我的审批出错!",ex);
- }
- finally
- {
- data = null;
- dataReader = null;
- }
- }
- }
- }