EditUserTitle.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Collections;
- using System.Configuration;
- using System.Data;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- namespace OThinker.H3.Portal
- {
- public partial class EditUserTitle : PortalPage
- {
- private string UserID
- {
- get
- {
- return this.Request[Param_UserID];
- }
- }
- private string ParentID
- {
- get
- {
- return this.Request[Param_Parent];
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- {
- // 验证是否具有管理员权限
- if (!this.UserValidator.ValidateAdministrator())
- {
- this.NotifyMessage(LackOfAuth);
- }
- OThinker.Organization.Title[] titles = OThinker.H3.Server.Engine.Organization.GetCompanyTitles();
- System.Collections.Generic.List<string> nameList = new System.Collections.Generic.List<string>();
- System.Collections.Generic.List<string> idList = new System.Collections.Generic.List<string>();
- if (titles != null)
- {
- foreach (OThinker.Organization.Title title in titles)
- {
- idList.Add(title.TitleID);
- nameList.Add(title.Name);
- }
- }
- this.TitleSelector.OptionNames = nameList.ToArray();
- this.TitleSelector.OptionValues = idList.ToArray();
- OThinker.Organization.User user = (OThinker.Organization.User)OThinker.H3.Server.Engine.Organization.GetUnit(this.UserID);
- string[] userTitles = user.GetTitles(this.ParentID);
- this.TitleSelector.SelectedItems = userTitles;
- }
- }
- protected void btnSubmit_Click(object sender, EventArgs e)
- {
- string[] titles = this.TitleSelector.SelectedItems;
- OThinker.Organization.User user = (OThinker.Organization.User)OThinker.H3.Server.Engine.Organization.GetUnit(this.UserID);
- user.SetTitles(this.ParentID, titles);
- OThinker.Organization.HandleResult result = OThinker.H3.Server.Engine.Organization.UpdateUnit(this.UserValidator.UserID, user);
- if (result == OThinker.Organization.HandleResult.SUCCESS)
- {
- this.Response.Write("<script>window.close(false);</script>");
- }
- else
- {
- this.NotifyResult(result);
- }
- }
- }
- }