/// <summary> /// 添加普通员工 /// </summary> private void AddUser() { UserInfoBean uib = new UserInfoBean(); //实体Bean UserInfoBLL uBll = new UserInfoBLL(); //逻辑层 //得到表单提交的值 uib.LoginName = Request.Form["LoginName"]; uib.LoginPass = Request.Form["LoginPass"]; uib.UserName = Request.Form["UserName"]; uib.Remark = Request.Form["remark"]; string json; if (uBll.CheckUserId(uib.LoginName)) { json = @"{success: true,result:false}"; //已经被注册 } else { //如果success为true,则表示服务器端处理成功 if (uBll.AddUser(uib)) { json = @"{success: true,result:true}"; } else { json = @"{success: false}"; } } Response.Write(json); }
/// <summary> /// 检查登录名是否重复 /// </summary> private void CheckUserId() { string json; string UserId = Request["name"]; //得到登陆Id UserInfoBLL uiBll = new UserInfoBLL(); if (uiBll.CheckUserId(UserId)) { json = @"{success: true}";//已经注册 } else { json = @"{success: false}";//可以注册 } Response.Write(json); }