Personal Information Management:
Requirements Description:
1. Add a personal information modification permission in the Permissions information table.
2. Add a piece of data to the Treemenu table as a "human information modification" menu.
3. When registering staff information, the Personnel Registration officer automatically adds a "Personal information modification permission" to the employee's permission list.
4. Individual login ERP system can automatically load the "Personal Information modification" menu, if there is no such menu, the administrator can assign this permission to employees themselves.
5. Employees can modify their own basic information.
Stored procedures:
---Employee information is added automatically add a permission value of 1 to the Employee Rights Information table--Permission value 1: Personal information Modify permissions declare @userid int SET @[email protected] @IDENTITY; INSERT Tbuserright (Userid,rightid) VALUES (@userid, 1)
Front:
<%@ page language= "C #" autoeventwireup= "true" codebehind= "WorkerInfoUpdate.aspx.cs" inherits= " BioErpWeb.HRSystem.WorkerInfoUpdate "%><%@ Register assembly=" AjaxControlToolkit "namespace=" AjaxControlToolkit "tagprefix=" CC1 "%><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> back end:
Public partial class WorkerInfoUpdate:System.Web.UI.Page {static Usermanager user=new Usermanager (); USERMANAGERBLL USERBLL; static bool Isadd = TRUE; protected void Page_Load (object sender, EventArgs e) {if (session["Userid"] = = null) { Server.Transfer ("~/web/userlogin.aspx"); } if (! IsPostBack) {pageinfobind (); }} private void Pageinfobind () {string userid = session["userid"]. ToString (); USERBLL = new USERMANAGERBLL (); user = Userbll.getuserbyid (userid); This.txtUserName.Text = user. UserName; This.txtLoginName.Text = user. LoginName; This.txtBirthday.Text = user. Birthday.tostring (); This.txtMobile.Text = user. Mobile; This.txtEmail.Text = user. Email; This.txtAddress.Text = user. Address; if (user. Sex = = true) {This.ddlSex.SelectedValue = "0"; }} protected void btnSubmit_Click (object sender, EventArgs e) {if (This.txtLoginName.Text.Trim () = = "" | | TxtLoginName.Text.Trim (). Length = = 0) {Scriptmanager.registerstartupscript (this, this. GetType (), "Test", "alert (' please fill in the login name ');", true); Return } if (This.txtRePwd.Text.Trim () = TxtPwd.Text.Trim ()) {Scriptmanager.register Startupscript (this, this.) GetType (), "Test", "alert (' Password and duplicate password must be consistent ');", true); Return } if (This.txtPwd.Text.Trim () = "" && this.txtRePwd.Text.Trim ()! = "") {Use R.password = COMM.MD5 (this.txtPwd.Text.TrIm ()); } user. LoginName = This.txtLoginName.Text; User. UserName = This.txtUserName.Text; User. Mobile = This.txtMobile.Text; User. Birthday = Convert.todatetime (This.txtBirthday.Text); User. Email = This.txtEmail.Text; User. Address = This.txtAddress.Text; 0: Male, 1, female user. Sex = This.ddlSex.SelectedValue = = "0"? True:false; User. Lastlogindate =convert.todatetime (DateTime.Now.ToString ("Yyyy-mm-dd")); USERBLL = new USERMANAGERBLL (); User. UserId = Int. Parse (session["Userid"). ToString ()); String columns= "Loginname= '" +user. Loginname+ "', password= '" + user. Password+ "', birthday= '" +user. Birthday+ "', mobile= '" +user. Mobile+ "', email= '" +user. Email+ "', sex= '" +user. Sex+ "', address= '" +user. Address+ "'"; if (! Sqlcomm.updatetablebycondition ("Usermanager", Columns, "userid=" + user.) Userid.tostring ())) {Scriptmanager.registerstartupscript (this, this.) GetType (), "Test", "alert (' Data submission failed ');", true); Return } } }
ERP Permissions settings (12)