EditCompany.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:4k
源码类别:
OA系统
开发平台:
C#
- 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;
- namespace OThinker.H3.Portal
- {
- public partial class EditCompany : PortalPage
- {
- private EditUserType _EditMode = EditUserType.Unspecified;
- /// <summary>
- /// 是否是自己修改自己信息的模式
- /// </summary>
- protected EditUserType EditMode
- {
- get
- {
- if (this._EditMode == EditUserType.Unspecified)
- {
- if (this.UserValidator.ValidateAdministrator())
- {
- this._EditMode = EditUserType.Admin;
- }
- else
- {
- this._EditMode = EditUserType.View;
- }
- }
- return this._EditMode;
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- {
- if (this.EditMode == EditUserType.Admin)
- {
- // 添加成员的面板
- string id = OThinker.H3.Server.Engine.Organization.Company.UnitID;
- string param = "?" + Param_Parent + "=" + id + "&" + Param_Q + "=" + HttpUtility.UrlEncode(this.Request.Url.AbsoluteUri) + "&" + Param_ExpandPath + "=" + this.Request.QueryString[Param_ExpandPath];
- this.lnkAddOrganizationUnit.NavigateUrl = PageName_EditOrganizationUnit + param;
- this.lnkAddGroup.NavigateUrl = PageName_EditGroup + param;
- this.lnkAddUser.NavigateUrl = PageName_EditUser + param;
- this.lnkSyncUser.NavigateUrl = PageName_SyncUser + param;
- this.lnkSyncAllUsers.NavigateUrl = PageName_SyncAllUsers + param;
- this.lnkManager.Visible = false;
- this.txtManager.LoadSelection(OThinker.H3.Server.Engine.Organization, OThinker.H3.Server.Engine.Organization.Company.ManagerID);
- }
- else
- {
- this.panelAdmin.Visible = false;
- this.txtName.Enabled = false;
- this.txtDescription.Enabled = false;
- this.txtManager.Editable = false;
- this.lnkManager.Visible = true;
- this.txtManager.Visible = false;
- string managerId = OThinker.H3.Server.Engine.Organization.Company.ManagerID;
- if (managerId == null)
- {
- this.lnkManager.Text = "未设置";
- }
- else
- {
- string managerName = OThinker.H3.Server.Engine.Organization.GetFullName(managerId);
- this.lnkManager.Text = managerName;
- this.lnkManager.NavigateUrl = PageName_EditUser + "?" + Param_ID + "=" + managerId;
- }
- }
- this.txtName.Text = OThinker.H3.Server.Engine.Organization.Company.Name;
- this.txtDescription.Text = OThinker.H3.Server.Engine.Organization.Company.Description;
- }
- }
- protected void lnkOk_Click(object sender, EventArgs e)
- {
- OThinker.Organization.Company company = OThinker.H3.Server.Engine.Organization.Company;
- company.Name = this.txtName.Text;
- company.Description = this.txtDescription.Text;
- company.ManagerID = this.txtManager.SelectedUser;
- OThinker.Organization.HandleResult result = OThinker.H3.Server.Engine.Organization.UpdateUnit(this.UserValidator.UserID, company);
- this.NotifyResult(
- result,
- result == OThinker.Organization.HandleResult.SUCCESS,
- this.Request.QueryString[Param_ExpandPath]);
- }
- }
- }