protected void btChangePass_Click(object sender, EventArgs e) { IMemberService memberService = new MemberService(); MemberBO member = memberService.GetMember(this.MemeberId); if (member == null) return; memberService.ChangePass(this.MemeberId, txtPassword.Text); }
protected void btDelete_Click(object sender, EventArgs e) { IMemberService memberService = new MemberService(); MemberBO member = memberService.GetMember(this.MemeberId); if (member == null) return; try { memberService.DeleteMember(member); Response.Redirect("Members.aspx"); } catch (Exception ex) { ProcessException(ex); } }
public MemberBO SaveInfo() { IMemberService memberService = new MemberService(); MemberBO member = memberService.GetMember(this.MemeberId); if (member != null) { member.UserName = txtUserName.Text; member.DepartmentId = int.Parse(ddlDepartment.SelectedValue); member.FullName = txtFullName.Text; member.Address = txtAdress.Text; member.Telephone = txtTelephone.Text; member.Email = txtEmail.Text; member.RoleTypeId = int.Parse(ddlRoleType.SelectedValue); member.LastEditedOn = DateTime.Now; memberService.UpdateMember(member); } else { member = new MemberBO() { UserName = txtUserName.Text, Password = txtPassword.Text, FullName = txtFullName.Text, Address = txtAdress.Text, Telephone = txtTelephone.Text, Email = txtEmail.Text, RoleTypeId = int.Parse(ddlRoleType.SelectedValue), CreatedOn = DateTime.Now, DepartmentId = int.Parse(ddlDepartment.SelectedValue) }; MemberStatus status = MemberStatus.Success; member.UserId = memberService.InsertMember(member, out status); if (status != MemberStatus.Success) { throw new InthudoException(string.Format("Không thể tạo user: {0}",status.ToString())); } } return member; }
private bool ValidateUser(string userName, string pass) { IMemberService memeberService = new MemberService(); return memeberService.ValidateUser(userName, pass); }
private void BindData() { IMemberService memberService = new MemberService(); MemberBO member = memberService.GetMember(this.MemeberId); if (member != null) { if (this.LoggedInMember.RoleName.ToLower() == Constant.USER_ROLE_NAME.ToLower()) { if (this.LoggedInUserId != this.MemeberId) { Response.Redirect("Login.aspx"); } } txtUserName.Text = member.UserName; ddlDepartment.SelectedValue = member.DepartmentId.ToString(); txtFullName.Text = member.FullName; txtAdress.Text = member.Address; txtTelephone.Text = member.Telephone; txtEmail.Text = member.Email; lbUserId.Text = member.UserId.ToString(); ddlRoleType.SelectedValue = member.RoleTypeId.ToString(); } else { pnlUserId.Visible = false; btChangePass.Visible = false; ctrlOrganizationSelect.Visible = false; } }