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

.net编程

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Data.SqlClient;
  4. using System.Configuration;
  5. using System.Text;
  6. using System.Collections;
  7. using System.Web;
  8. using System.Web.Security;
  9. using System.Web.UI;
  10. using System.Web.UI.WebControls;
  11. using System.Web.UI.WebControls.WebParts;
  12. using System.Web.UI.HtmlControls;
  13. using com.etong.BusinessRule.Zwf;
  14. using com.etong.Utility;
  15. using com.etong.DAL;
  16. using com.etong.Inform;
  17. using com.etong.DAL.FC;
  18. public partial class LeftMenu : System.Web.UI.Page
  19. {
  20.     RoleManage rm = new RoleManage();
  21.     protected int orgid()
  22.     {
  23.         EtongZwf etongzwf = new EtongZwf();
  24.           CheckUserInfo cuinfo = (CheckUserInfo)Session["checkuserinfo"];
  25.          int orgid= etongzwf.GetOrgID(cuinfo.UserID);
  26.          return orgid;
  27.     
  28.     }
  29.     protected void Page_Load(object sender, EventArgs e)
  30.     {
  31.         if (!IsPostBack)
  32.         {
  33.             CheckUserInfo cui = (CheckUserInfo)Session["checkuserinfo"];
  34.             if (!this.Page.IsPostBack)
  35.             {
  36.                  int pageid = Convert.ToInt32(Request.QueryString["id"].ToString().Trim());
  37.                  if (pageid != 2)
  38.                  {
  39.                      this.DL_Detail.DataSource = rm.GetUserPerissionList(cui.UserID, cui.UserAccount, pageid);
  40.                      this.DL_Detail.DataBind();
  41.                  }
  42.                  else
  43.                  {
  44.                      if (cui.UserAccount == "admin" || cui.UserAccount == "Admin")
  45.                      {
  46.                          this.DL_Detail.DataSource = null;
  47.                          this.DL_Detail.DataBind();
  48.                      }
  49.                      else
  50.                      {
  51.                          EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
  52.                          EFlyPrj.DeptID = cui.OrgID;
  53.                          EFlyPrj.EmpID = cui.EmpID;
  54.                          try
  55.                          {
  56.                              
  57.                              this.DL_Detail.DataSource = EFlyPrj.PrjGetPermission();
  58.                              this.DL_Detail.DataBind();
  59.                          }
  60.                          catch (Exception ex)
  61.                          {
  62.                              this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "").Replace("n", "") + "');</script>");
  63.                          }
  64.                          //EtongZwf etongzwf = new EtongZwf();
  65.                          //this.DL_Detail.DataSource = etongzwf.GetWFPerissionList();
  66.                          //this.DL_Detail.DataBind();
  67.                      }
  68.                  }
  69.             }
  70.         }
  71.     }
  72.     //protected void DL_Detail_ItemDataBound(object sender, DataListItemEventArgs e)
  73.     //{
  74.     //    if ((e.Item.ItemType == ListItemType.Item) ||(e.Item.ItemType == ListItemType.AlternatingItem))   
  75.     //    {
  76.     //        if (!IsPostBack)
  77.     //        {  
  78.     //            string PermID = Convert.ToString(DataBinder.Eval(e.Item.DataItem, "PermID"));
  79.               
  80.     //            int pageid = Convert.ToInt32(Request.QueryString["id"].ToString().Trim());
  81.     //            try
  82.     //            {
  83.     //                if (pageid == 2)
  84.     //                {
  85.     //                    CheckUserInfo cuinfo = (CheckUserInfo)Session["checkuserinfo"];
  86.     //                    EtongZwf etongzwf = new EtongZwf();
  87.     //                    string OrgcID = etongzwf.GetOrgcID(cuinfo.UserID);
  88.     //                    //组织机构类型(a、公司领导c、基层部门b、职能部门1、其它)
  89.     //                    if (OrgcID == "c")  //注:此处不包括 "部门主管" 
  90.     //                    {
  91.     //                        if (PermID == "8") //待办工作流
  92.     //                        {
  93.     //                            e.Item.Controls.Clear();   //吐了好几次
  94.     //                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  top.mainFrame.location.href = 'Workflow/WorkFlowStart.aspx';</script>"); 
  95.     //                        }
  96.     //                    }
  97.     //                    else if (OrgcID == "a" || OrgcID == "b")
  98.     //                    {
  99.     //                        if (PermID == "7") //启动工作流
  100.     //                        {
  101.     //                            e.Item.Controls.Clear();
  102.     //                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  top.mainFrame.location.href = 'Workflow/WorkFlowWait.aspx';</script>"); 
  103.     //                        }
  104.     //                    }
  105.     //                }
  106.     //            }
  107.     //            catch
  108.     //            {
  109.     //                DL_Detail.Controls.Clear();
  110.     //            }
  111.     //        }
  112.     //    }
  113.     //}
  114. }