protected override ActionResult DoTask(string data) { string[] param = StringUtility.Split(data, "%27"); string usernum = Escape.JsUnEscape(param[0]); string username = Escape.JsUnEscape(param[1]); string password = EncryptMD5.MD5to16Code(Escape.JsUnEscape(param[2])); UserLevelType usertype = (UserLevelType)int.Parse(Escape.JsUnEscape(param[3])); UserEntity entity = new UserEntity(); if (usertype == UserLevelType.Student) { entity.FillIdentityStudentUserId(); } else { entity.UserNo = usernum; entity.FillByUserNo(); if (entity.EntityState == DataFrameworkLibrary.Core.EntityState.Inserted) throw new ActionParseException("系统中已存在相同编号的用户<br>请更换别的编号"); } entity.UserName = username; entity.Password = password; entity.UserLevel = usertype; entity.IsLogin = false; entity.DoTest = true; entity.Save(); UserCollection collection = new UserCollection(); collection.PageSize = 6; collection.AbsolutePage = 1; collection.IsReturnDataTable = true; collection.Fill(); ActionResult result = new ActionResult(); result.IsSuccess = true; StringBuilder response = new StringBuilder(); response.Append(ActionTaskUtility.ReturnClientDataArray(collection.GetFillDataTable())); response.Append(string.Format("TmpStr={0};", collection.PageCount)); result.ResponseData = response.ToString(); return result; }
protected void Page_Load(object sender, EventArgs e) { userCollection = new UserCollection(); userCollection.PageSize = 6; userCollection.AbsolutePage = 1; userCollection.Fill(); this.repUserList.DataSource = userCollection; this.repUserList.DataBind(); }