UserAdd.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:2k
- using System;
- using System.Data;
- using System.Data.SqlClient;
- using System.Configuration;
- using System.Text;
- 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;
- using System.Net;
- using com.etong.BusinessRule.Zwf;
- public partial class SysManage_UserAdd : System.Web.UI.Page
- {
-
- protected void Page_Load(object sender, EventArgs e)
- {
- BT_Cancel.Attributes.Add("onclick", "javascript:if(confirm('确定要退出吗?')) {window.close();return;} else {return;}");
- }
- protected void BT_Confirm_Click(object sender, EventArgs e)
- {
- //string strHostIP = "";
- //IPHostEntry iphost = Dns.Resolve(Environment.MachineName);
- //if (iphost.AddressList.Length > 0)
- // strHostIP = iphost.AddressList[0].ToString();
-
- string account= this.TB_Account.Text;
- string decs = this.TB_Decs.Text;
- string strHostIP = this.TB_address.Text;
- HtmlInputHidden txt_employeid = ((HtmlInputHidden)this.FindControl("txt_employeid"));
-
- string employeid = txt_employeid.Value;
- int islock = 0;
- if (this.CB_isLock.Checked == true)
- islock = 1;
- int ipbound = 0;
- if (this.CB_isIPbound.Checked == true)
- ipbound = 1;
- EtongZwf etongzwf = new EtongZwf();
- DataView dvsearch=etongzwf.UserSearch(account, "1",false);
- if (dvsearch.Count > 0)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:此帐户已存在!');</script>");
- return;
- }
- bool returnvalue =false;
- returnvalue = etongzwf.UserAdd(Convert.ToInt16(employeid), account, account, decs, 2, "111111", islock, strHostIP, ipbound, DateTime.Now, DateTime.Now, DateTime.Now);
- if(returnvalue)
- Response.Write("<script>alert('系统提示:添加记录成功!');</script>");
- else
- Response.Write("<script>alert('系统提示:添加记录不成功!');window.close();</script>");
-
- this.TB_Account.Text="";
- this.TB_Decs.Text="";
- this.TB_address.Text = "";
- this.CB_isIPbound.Checked = false;
- this.CB_isLock.Checked = false;
- }
-
-
- }