コード例 #1
0
 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);
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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;
        }
コード例 #4
0
ファイル: Login.ascx.cs プロジェクト: nguyentu1982/inthudo
 private bool ValidateUser(string userName, string pass)
 {
     IMemberService memeberService = new MemberService();
     return memeberService.ValidateUser(userName, pass);
 }
コード例 #5
0
 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;
     }
 }