- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- 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 com.etong.user;
- using com.etong.Inform;
- using com.etong.BusinessRule.Zwf;
- using com.etong.DAL.FC;
- public partial class Left : System.Web.UI.Page
- {
- protected int orgid()
- {
- EtongZwf etongzwf = new EtongZwf();
- CheckUserInfo cuinfo = (CheckUserInfo)Session["checkuserinfo"];
- int orgid = etongzwf.GetOrgID(cuinfo.UserID);
- return orgid;
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- Notice notice = new Notice();
- CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];
- DataView myDataView = notice.NoticeSearch(checkuserinfo.UserID, DateTime.Now).DefaultView;
- myDataView.Sort = "NoticeDate DESC";//ASC
- DataTable dt = myDataView.ToTable();
- string mqtext = " ";
- foreach (DataRow dr in dt.Rows)
- {
- string CreateUserName = "";
- if (Convert.ToInt32(dr["CreateUserID"]) == 0)
- {
- CreateUserName = "系统管理员";
- }
- else
- CreateUserName = notice.GetEmpName(Convert.ToInt32(dr["CreateUserID"]));
- mqtext = mqtext + "★ " + dr["NoticeTitle"] + "<br />" + dr["NoticeContent"] + "【" + CreateUserName + "】【" + DateTime.Parse(dr["NoticeDate"].ToString()).ToShortDateString().ToString() + "】" + "<br /><br />";
- }
- lb_mqtext.Text = mqtext;
- if (!IsPostBack)
- {
- //EtongZwf etongzwf = new EtongZwf();
- //string OrgcID = etongzwf.GetOrgcID(checkuserinfo.UserID);
- ////组织机构类型(a、公司领导c、基层部门b、职能部门1、其它)
- //if (OrgcID == "c")
- //{
- // //没有待办工作流
- // WorkFlowWait.Visible = false;
- // ProjectSearch.Visible = false;
- // ClientScript.RegisterStartupScript(this.GetType(), "", "<script> top.mainFrame.location.href = 'Workflow/WorkFlowStart.aspx';</script>");
- //}
- //else if (OrgcID == "a" || OrgcID == "b")
- //{
- // //没有启动工作流
- // WorkFlowStart.Visible = false;
- // ClientScript.RegisterStartupScript(this.GetType(), "", "<script> top.mainFrame.location.href = 'Workflow/WorkFlowWait.aspx';</script>");
- //}
- //else //全有
- //{
- // //admin或Admin的用户除外
- // if (checkuserinfo.UserAccount == "admin" || checkuserinfo.UserAccount == "Admin")
- // {
- // WorkFlowStart.Visible = false;
- // WorkFlowWait.Visible = false;
- // ProjectSearch.Visible = false;
- // }
- // else
- // ClientScript.RegisterStartupScript(this.GetType(), "", "<script> top.mainFrame.location.href = 'Workflow/WorkFlowWait.aspx';</script>");
- //}
- WorkFlowWait.Visible = false;
- WorkFlowStart.Visible = false;
- ProjectSearch.Visible = false;
- CheStatusSearch.Visible = false;
- StructureStatusSearch.Visible = false;
- StatusSearch.Visible = false;
- StatusSearchPrjAlert.Visible = false;
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- EFlyPrj.EmpID = checkuserinfo.EmpID;
- DataView dv = new DataView();
- try
- {
- dv = EFlyPrj.PrjGetPermission();
- }
- catch (Exception ex)
- {
- return;
- }
- //admin或Admin的用户除外
- if (checkuserinfo.UserAccount == "admin" || checkuserinfo.UserAccount == "Admin")
- {
- return;
- }
- if (dv.Table == null) return;
- for (int i = 0; i < dv.Table.Rows.Count; i++)
- {
- if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 7) WorkFlowStart.Visible = true;
- if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 8) WorkFlowWait.Visible = true;
- if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 15) ProjectSearch.Visible = true;
- if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 18) CheStatusSearch.Visible = true;
- if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 19) StructureStatusSearch.Visible = true;
- if (Convert.ToInt32(dv.Table.Rows[i]["PermID"]) == 20) StatusSearch.Visible = true;
- }
- }
- }
- }