public void GetData() { string _userid = Parameters["puserid"]; SysUserBiz biz = new SysUserBiz(); SysUser item = new SysUser(); item = biz.Select(_userid); Response.Write(item.ToJson()); }
public void DeleteUser() { string _idstr = Parameters["pparm"]; SysUserBiz biz = new SysUserBiz(); ErrorEntity ErrInfo = new ErrorEntity(); biz.Delete(_idstr, out ErrInfo); Response.Write(ErrInfo.ToJson()); }
public void GetGridData() { string _searchcontent = ""; string _sortname = ""; string _sortdirection = ""; string _pagenumber = ""; string _pagesize = ""; _searchcontent = Parameters["psearchcontent"]; _sortname = Parameters["psortname"]; if (!string.IsNullOrEmpty(_sortname)) { sSortName = _sortname; } _sortdirection = Parameters["psortdirection"]; if (!string.IsNullOrEmpty(_sortdirection)) { sSortDirection = _sortdirection; } _pagenumber = Parameters["ppagenumber"]; if (!string.IsNullOrEmpty(_pagenumber)) { sPageIndex = Convert.ToInt32(_pagenumber); } _pagesize = Parameters["ppagesize"]; if (!string.IsNullOrEmpty(_pagesize)) { sPageSize = Convert.ToInt32(_pagesize); } List<SysUser> lists = new List<SysUser>(); SysUserBiz biz = new SysUserBiz(); string _searchtext = _searchcontent; string wheresql = "1=1"; if (string.IsNullOrEmpty(_searchtext)) { wheresql = "(FUserId <> 1)"; } else { wheresql = "(FUserId <> 1) and ((FUserName like '%" + _searchtext + "%') or (FUserDesc like '%" + _searchtext + "%'))"; } Int32 totalcount = 0; lists = biz.Select(wheresql, _sortname, _sortdirection, sPageIndex, sPageSize, out totalcount); string datasource = Utils.GetRepeaterDatasource(lists, sPageIndex, sPageSize, totalcount); Response.Write(datasource); }
public void SavePsw() { string _orgpsw = Parameters["orgpsw"]; string _newpsw = Parameters["newpsw"]; string _confirmpsw = Parameters["confirmpsw"]; SysUserBiz biz = new SysUserBiz(); ErrorEntity ErrInfo = new ErrorEntity(); SysUser useritem = new SysUser(); useritem = GetUserInfo(); if (_newpsw.Length < 6) { ErrInfo = new ErrorEntity(RespCode.SysUser0010); } else { int result = biz.UserChangePsw(useritem.FUserId, _orgpsw, _newpsw, _confirmpsw, out ErrInfo); } Response.Write(ErrInfo.ToJson()); }
protected void loginbtn_Click(object sender, EventArgs e) { string username = txtUserName.Text; string psw = txtUserPsw.Text; ErrorEntity ErrInfo = new ErrorEntity(); SysUserBiz userbiz = new SysUserBiz(); SysUser useritem = new SysUser(); useritem = userbiz.UserLogin(username, psw, "PMMG", out ErrInfo); if (ErrInfo.ErrorCode == RespCode.Success) { SetUserInfo(useritem); Response.Redirect("~/partymember/default.aspx"); } else { Server_Alert(ErrInfo.ErrorMessage); return; } }
public void StopUser() { string _idstr = Parameters["pparm"]; SysUserBiz biz = new SysUserBiz(); ErrorEntity ErrInfo = new ErrorEntity(); biz.UpdateUserStatus(_idstr, "0", out ErrInfo); Response.Write(ErrInfo.ToJson()); }
public void SaveUser() { string _userid = Parameters["puserid"]; string _username = Parameters["pusername"]; string _userdesc = Parameters["puserdesc"]; string _email = Parameters["pemail"]; string _mobile = Parameters["pmobile"]; string _tel = Parameters["ptel"]; SysUser item = new SysUser(); item.FUserId = Convert.ToInt64(_userid); item.FUserName = _username; item.FUserDesc = _userdesc; item.FContactTel = _tel; item.FContactMobile = _mobile; item.FEmail = _email; ErrorEntity ErrInfo = new ErrorEntity(); SysUserBiz biz = new SysUserBiz(); if (item.FUserId == 0) { Int64 iuserid = biz.Insert(item, out ErrInfo); //设置口令 SysUserCodeBiz codebiz = new SysUserCodeBiz(); NameValueCollection pa = new NameValueCollection(); pa.Add("FUserId", iuserid.ToString()); pa.Add("FUserCode", "3FA0346AF9BE74CBD887D24E1C03057B"); pa.Add("FCodeStatus", "1"); codebiz.Insert(pa, out ErrInfo); } else { biz.Update(item, out ErrInfo); } Response.Write(ErrInfo.ToJson()); }