Left.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:5k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using com.etong.user;
  12. using com.etong.Inform;
  13. using com.etong.BusinessRule.Zwf;
  14. using com.etong.DAL.FC;
  15. public partial class Left : System.Web.UI.Page
  16. {
  17.     protected int orgid()
  18.     {
  19.         EtongZwf etongzwf = new EtongZwf();
  20.         CheckUserInfo cuinfo = (CheckUserInfo)Session["checkuserinfo"];
  21.         int orgid = etongzwf.GetOrgID(cuinfo.UserID);
  22.         return orgid;
  23.     }
  24.     protected void Page_Load(object sender, EventArgs e)
  25.     {
  26.         Notice notice = new Notice();
  27.         CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];
  28.         DataView myDataView = notice.NoticeSearch(checkuserinfo.UserID, DateTime.Now).DefaultView;
  29.         myDataView.Sort = "NoticeDate  DESC";//ASC
  30.         DataTable dt = myDataView.ToTable();
  31.         string mqtext = "  ";
  32.         foreach (DataRow dr in dt.Rows)
  33.         {
  34.             string CreateUserName = "";
  35.             if (Convert.ToInt32(dr["CreateUserID"]) == 0)
  36.             {
  37.                 CreateUserName = "系统管理员";
  38.             }
  39.             else
  40.                 CreateUserName = notice.GetEmpName(Convert.ToInt32(dr["CreateUserID"]));
  41.             mqtext = mqtext + "★  " + dr["NoticeTitle"] + "<br />" + dr["NoticeContent"] + "【" + CreateUserName + "】【" + DateTime.Parse(dr["NoticeDate"].ToString()).ToShortDateString().ToString() + "】" + "<br /><br />";
  42.         }
  43.         lb_mqtext.Text = mqtext;
  44.         if (!IsPostBack)
  45.         {
  46.             //EtongZwf etongzwf = new EtongZwf();
  47.             //string OrgcID = etongzwf.GetOrgcID(checkuserinfo.UserID);
  48.             ////组织机构类型(a、公司领导c、基层部门b、职能部门1、其它)
  49.             //if (OrgcID == "c")
  50.             //{
  51.             //    //没有待办工作流
  52.             //    WorkFlowWait.Visible = false;
  53.             //    ProjectSearch.Visible = false;
  54.             //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  top.mainFrame.location.href = 'Workflow/WorkFlowStart.aspx';</script>"); 
  55.             //}
  56.             //else if (OrgcID == "a" || OrgcID == "b")
  57.             //{
  58.             //    //没有启动工作流
  59.             //    WorkFlowStart.Visible = false;
  60.             //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  top.mainFrame.location.href = 'Workflow/WorkFlowWait.aspx';</script>");
  61.             //}
  62.             //else  //全有
  63.             //{
  64.             //       //admin或Admin的用户除外
  65.             //    if (checkuserinfo.UserAccount == "admin" || checkuserinfo.UserAccount == "Admin")
  66.             //    {
  67.             //        WorkFlowStart.Visible = false;
  68.             //        WorkFlowWait.Visible = false;
  69.             //        ProjectSearch.Visible = false;
  70.             //    }
  71.             //    else
  72.             //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  top.mainFrame.location.href = 'Workflow/WorkFlowWait.aspx';</script>"); 
  73.             //}
  74.             WorkFlowWait.Visible = false;
  75.             WorkFlowStart.Visible = false;
  76.             ProjectSearch.Visible = false;
  77.             CheStatusSearch.Visible = false;
  78.             StructureStatusSearch.Visible = false;
  79.             StatusSearch.Visible = false;
  80.             StatusSearchPrjAlert.Visible = false;
  81.             EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
  82.             EFlyPrj.EmpID = checkuserinfo.EmpID;
  83.             DataView dv = new DataView();
  84.             try
  85.             {
  86.                 dv = EFlyPrj.PrjGetPermission();
  87.             }
  88.             catch (Exception ex)
  89.             {
  90.                 return;
  91.             }
  92.              //admin或Admin的用户除外
  93.             if (checkuserinfo.UserAccount == "admin" || checkuserinfo.UserAccount == "Admin")
  94.             {
  95.                 return;
  96.             }
  97.             if (dv.Table == null) return;
  98.             for (int i = 0; i < dv.Table.Rows.Count; i++)
  99.             {
  100.                 if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 7) WorkFlowStart.Visible = true;
  101.                 if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 8) WorkFlowWait.Visible = true;
  102.                 if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 15) ProjectSearch.Visible = true;
  103.                 if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 18) CheStatusSearch.Visible = true;
  104.                 if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 19) StructureStatusSearch.Visible = true;
  105.                 if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 20) StatusSearch.Visible = true;
  106.             }
  107.         }
  108.     }
  109. }