/// <summary> /// 获取单个服务器变量 /// </summary> /// <param name="Vname"></param> /// <returns></returns> private string GetConditionSql_GetSysVariable(string name) { string returnstr = ""; WX.WXUser cu = WX.Public.CurUser; //WX.Flow.Model.Process.MODEL pmodel = WX.Flow.Model.Process.GetModel("select top 1 * from TE_VarDefine where Title='" + Vname + "'"); //string name = ""; //if (pmodel != null && pmodel.Name.value != null) //{ // name = pmodel.Name.value.ToString(); //} switch (name) { case "PRCS_Z_UserName": cu.LoadUserModel(false); returnstr = cu.UserModel.RealName.value.ToString(); break; case "PRCS_Z_UserDuty": cu.LoadDutyUser(); returnstr = cu.DutyUser.Name.value.ToString(); break; case "PRCS_Z_UserDept": cu.LoadEmployeeUser(); cu.LoadMyDepartment(); returnstr = cu.MyDepartMent.Name.ToString(); break; case "PRCS_Z_UserSupDept": cu.LoadEmployeeUser(); cu.LoadMyDepartment(); WX.Model.Department.MODEL dept2 = WX.Model.Department.GetCache(cu.MyDepartMent.ParentID.ToInt32()); //WX.Model.Department.GetModel("select * from TE_Departments where ID=" + cu.MyDepartMent.ParentID.ToString()); returnstr = dept2.Name.value.ToString(); break; case "PRCS_ID": returnstr = Convert.ToInt32(HttpContext.Current.Request.QueryString["Step_Id"]).ToString(); break; case "Datetime_Now": returnstr = DateTime.Now.ToString("yyyy-MM-dd"); break; default: break; } return(returnstr); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (WX.Main.CurUser.IsEmployeeUser) { this.spanEmployee.Visible = true; //Load UserName this.lblUserName.InnerText = WX.Authentication.GetUserName(); //Load Msg this.LoadPrivateMsg(true); //Load Private State WX.WXUser user = WX.Main.CurUser; WX.Model.Employee.MODEL employee = WX.Model.Employee.GetModelToID(user.UserID); user.LoadUserModel(true); if (employee.IDCard.ToString() == "" || employee.Email.ToString() == "") { Response.Redirect("Private/Priv_EditUser.aspx"); } user.LoadMyDepartment(true); user.LoadDutyDetailUser(true); user.LoadDutyUser(true); user.LoadMyGrade(false); //判断防止第一次进入错误 int grade = 0; if (user.MyGrade != null) { grade = user.DutyDetailUser.GradeID.ToInt32(); //grade = user.MyGrade.Sort.ToInt32(); } grade = user.UserModel.Grade.ToInt32(); string deptName = null; if (user.MyDepartMent != null) { deptName = user.MyDepartMent.Name.ToString(); } string dutyName = null; if (user.DutyUser != null) { dutyName = user.DutyUser.Name.ToString(); } this.lblPrivateState.Text = String.Format("{0},{1},{2}" , deptName, dutyName, WX.Model.Grade.GetModel(grade).Name.ToString() + "(" + grade + ")"); } else { this.lblUserName.InnerText = WX.Authentication.GetUserName(); this.spanEmployee.Visible = false; } } }
private void LoadDuty() { WX.WXUser user = WX.Main.CurUser; user.LoadUserModel(false); user.LoadMyDepartment(true); user.LoadDutyDetailUser(true); user.LoadDutyUser(true); user.LoadMyGrade(true); int grade = 0; if (user.MyGrade != null) { grade = user.DutyDetailUser.GradeID.ToInt32(); //grade = user.MyGrade.Sort.ToInt32(); } this.lblDutyState.Text = String.Format("等级:{2}级<br />职务:{1}<br />部门:{0}<br /><span><a>[查看][日志]</a></span>" , user.MyDepartMent.Name, user.DutyUser.Name, grade); }