EditTitle.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:
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 EditTitle : PortalPage
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- {
- // 验证是否具有管理员权限
- if (!this.UserValidator.ValidateAdministrator())
- {
- this.NotifyMessage(LackOfAuth);
- }
- // 设置COMPANY名称
- this.lblCompany.Text = OThinker.H3.Server.Engine.Organization.Company.Name;
- // 获得公司的所有职务
- OThinker.Organization.Title[] titles = OThinker.H3.Server.Engine.Organization.GetCompanyTitles();
- if (titles != null && titles.Length != 0)
- {
- foreach (OThinker.Organization.Title title in titles)
- {
- this.lstTitle.Items.Add(new ListItem(title.Name, title.TitleID));
- }
- }
- }
- }
- protected void lnkAdd_Click(object sender, EventArgs e)
- {
- OThinker.Organization.Title title = new OThinker.Organization.Title(OThinker.H3.Server.Engine.Organization.Company.UnitID, this.txtTitleName.Text);
- string titleId = OThinker.H3.Server.Engine.Organization.AddTitle(title);
- if (titleId == OThinker.Organization.Title.NullTitleID)
- {
- this.NotifyMessage("添加职务失败");
- }
- else
- {
- this.NotifyMessage("添加职务成功");
- }
- }
- protected void lnkModify_Click(object sender, EventArgs e)
- {
- if (this.lstTitle.SelectedValue == null || this.lstTitle.SelectedValue == "")
- {
- this.NotifyMessage("没有选择的职务");
- }
- else if (this.txtTitleName.Text == null || this.txtTitleName.Text == "")
- {
- this.NotifyMessage("不能修改,没有设置新的职务名称");
- }
- else
- {
- OThinker.Organization.Title title = OThinker.H3.Server.Engine.Organization.GetTitle(this.lstTitle.SelectedValue);
- title.Name = this.txtTitleName.Text;
- this.NotifyResult(OThinker.H3.Server.Engine.Organization.UpdateTitle(title));
- }
- }
- protected void lnkDel_Click(object sender, EventArgs e)
- {
- if (this.lstTitle.SelectedValue == null || this.lstTitle.SelectedValue == "")
- {
- this.NotifyMessage("没有选择的职务");
- }
- else
- {
- OThinker.H3.Server.Engine.Organization.RemoveTitle(this.UserValidator.UserID, this.lstTitle.SelectedValue);
- this.NotifyMessage("删除成功");
- }
- }
- }
- }