private void UserInfoBind() { string ID = Request.QueryString["ID"]; int i = 0; if (int.TryParse(ID, out i)) { txtID.Text = ID; T_WEBMANAGEEntity FM = new T_WEBMANAGEEntity(); FM.ID = i; FM.Retrieve(); if (FM.IsPersistent) { txtUserName.Text = FM.USERNAME; txtPassword.Attributes["value"] = FM.PASSWORD; txtVisPassword.Text = FM.PASSWORD; txtTrueName.Text = FM.TRUENAME; txtTelephone.Text = FM.TELEPHONE; txtDept.Text = FM.DEPT; } } else { Response.Redirect("../main.aspx"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (ishasuser()) { MessageBox("该用户名已经存在,请重新输入!"); return; } if (!StringOperate.IsCheckEngNumUnderLine(txtUserName.Text.Trim())) { MessageBox("用户名需由字母、数字或下划线组成,请重新输入!"); return; } T_WEBMANAGEEntity FM = new T_WEBMANAGEEntity(); FM.ID = Sequence.GetNextValue("SEQ_T_WEBMANAGE"); FM.USERNAME = txtUserName.Text.Trim(); FM.PASSWORD = Names.EncryptPassword(txtPassword.Text.Trim()); FM.TRUENAME = txtTrueName.Text.Trim(); FM.TELEPHONE = txtTelephone.Text.Trim(); FM.DEPT = txtDept.Text.Trim(); FM.CREATETIME = DateTime.Now; FM.STATUS = 0; FM.Save(); foreach (TreeNode n in trNode.Nodes) { if (n.Checked) { T_WEBMANAGEROLEEntity MT = new T_WEBMANAGEROLEEntity(); MT.ID = Sequence.GetNextValue("SEQ_T_WEBMANAGEROLE"); MT.USERNAME = FM.USERNAME; MT.NODEID = int.Parse(n.Value); MT.Save(); GetParentID(FM.USERNAME, MT.NODEID.ToString()); } DiGui(n, FM.USERNAME); } Response.Redirect("adminList.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { T_WEBMANAGEEntity FM = new T_WEBMANAGEEntity(); FM.ID = int.Parse(txtID.Text); FM.Retrieve(); if (FM.IsPersistent) { //FM.USERNAME = txtUserName.Text.Trim(); if (!txtVisPassword.Text.Trim().Equals(txtPassword.Text.Trim())) { FM.PASSWORD = Names.EncryptPassword(txtPassword.Text.Trim()); } FM.TRUENAME = txtTrueName.Text.Trim(); FM.TELEPHONE = txtTelephone.Text.Trim(); FM.DEPT = txtDept.Text.Trim(); FM.CREATETIME = DateTime.Now; FM.STATUS = 0; FM.Save(); string strSql = "DELETE FROM T_WEBMANAGEROLE WHERE USERNAME = '******'"; PersistenceLayer.Query.ProcessSqlNonQuery(strSql, Names.DBName); foreach (TreeNode n in trNode.Nodes) { if (n.Checked) { T_WEBMANAGEROLEEntity MT = new T_WEBMANAGEROLEEntity(); MT.ID = Sequence.GetNextValue("SEQ_T_WEBMANAGEROLE"); MT.USERNAME = FM.USERNAME; MT.NODEID = int.Parse(n.Value); MT.Save(); GetParentID(FM.USERNAME, MT.NODEID.ToString()); } DiGui(n, FM.USERNAME); } Response.Redirect("adminList.aspx"); } }