protected void Button_login_Click(object sender, EventArgs e) { if (TextBox_code.Text.Equals(this.valCode)) { TextBox_code.Text = ""; AddLoadMessage("ÑéÖ¤Âë´íÎó"); return; } //TdCustomerResult tt = customerService.GetCustomerById(2); TdUserResult res = userService.GetUserByName(TextBox_name.Text.TrimEnd().ToLower()); if (!res.result) { AddLoadMessage(res.msg); return; } if (!res.user.password.Equals(StringUtil.MD5Hash(TextBox_password.Text))) { AddLoadMessage("ÃÜÂë´íÎó"); return; } CurrentUserId = res.user.id; //LoginSession.SetIsLogin(this, true); //LoginSession.SetCurrentUser(this, u); //DataTable dt_f = userService.getFrameByRole(u.RoleId); //if (null != dt_f) //{ // LoginSession.SetFrameRank(this, dt_f); //} Response.Redirect("home.aspx"); return; }
private void GetMe() { TdUserResult res = userService.GetUserById(CurrentUserId); if (!res.result) { throw new Exception(res.msg); } me = res.users[0]; }
protected void Grid_visitRecord_ItemDataBound(object sender, ComponentArt.Web.UI.GridItemDataBoundEventArgs e) { VisitRecord r = (VisitRecord)e.DataItem; TdUserResult res = userService.GetUserById(r.user_id); if (res.result) { e.Item.ToArray()[2] = res.user.real_name; } }
private void PopulateSubTree(User user, ComponentArt.Web.UI.TreeViewNode node) { ComponentArt.Web.UI.TreeViewNode childNode; TdUserResult res = userService.GetSoldiers(user.id); if (!res.result) { return; } foreach (User soldier in res.users) { childNode = CreateNode(soldier, true); node.Nodes.Add(childNode); this.PopulateSubTree(soldier, childNode); } }
protected void GetCurrentUser() { if (null != me) { return; } int userid = CurrentUserId; if (0 == userid) { return; } TdUserResult res = userService.GetUserById(userid); if (!res.result) { return; } me = res.user; }