public Admin GetAdminByAccountPass(string name, string pass) { SecurityBSO securityBSO = new SecurityBSO(); pass = securityBSO.EncPwd(pass); AdminDAO adminDAO = new AdminDAO(); return(adminDAO.GetAdminByAccountPass(name, pass)); }
public bool CheckLoginAdmin(string name, string pass) { bool login = false; SecurityBSO securityBSO = new SecurityBSO(); pass = securityBSO.EncPwd(pass); AdminDAO adminDAO = new AdminDAO(); Admin _admin = adminDAO.GetAdminByAccountPass(name, pass); if (_admin != null) { login = true; } return(login); }
public bool CheckLoginMember(string name, string pass) { bool login = false; pass = new SecurityBSO().EncPwd(pass); DataTable dataTable = this.GetAllMember(); if (dataTable != null) { DataView dataView = new DataView(dataTable) { RowFilter = "UserName = '******' AND Password = '******' AND Actived = 'True'" }; if (dataView.Count > 0) { login = true; } } return login; }
public bool CheckLoginAdmin(string name, string pass) { bool login = false; //string pass1 = new SecurityBSO().DecPwd("YWRtaW5DaElwWWVV"); pass = new SecurityBSO().EncPwd(pass); DataTable dataTable = this.GetAllAdmin(); if (dataTable != null) { DataView dataView = new DataView(dataTable) { RowFilter = "Admin_Username = '******' AND Admin_Password = '******' AND Admin_Actived = 'True'" }; if (dataView.Count > 0) { login = true; } } return login; }
public bool CheckLoginMember(string name, string pass) { bool login = false; SecurityBSO securityBSO = new SecurityBSO(); pass = securityBSO.EncPwd(pass); DataTable dataTable = GetAllMember(); if (dataTable != null) { DataView dataView = new DataView(dataTable); dataView.RowFilter = "UserName = '******' AND Password = '******' AND Actived = 'True'"; if (dataView.Count > 0) { login = true; } } return(login); }
protected void btn_GetPass_Click(object sender, EventArgs e) { string email = txtEmail.Text.Trim(); AdminBSO adminBSO = new AdminBSO(); DataTable table = adminBSO.GetAllAdmin(); DataView dataView = new DataView(table); dataView.RowFilter = "Admin_Email = '" + email + "'"; if (dataView.Count > 0) { SecurityBSO securityBSO = new SecurityBSO(); DataTable dataTable = dataView.ToTable(); string oldpass = dataTable.Rows[0]["Admin_Password"].ToString(); string newpass = securityBSO.DecPwd(oldpass); ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); MailBSO mailBSO = new MailBSO(); mailBSO.EmailFrom = config.Email_from; string subject = "Web Support EVNIT - Phục hồi lại mật khẩu đăng nhập hệ thống"; string body = "Chào bạn : " + dataTable.Rows[0]["Admin_FullName"].ToString() + "<br>"; body += "Tài khoản Email đăng nhập của bạn : " + dataTable.Rows[0]["Admin_Email"].ToString() + "<br>"; body += "Mật khẩu đăng nhập hệ thống của bạn : " + newpass; if (mailBSO.SendMail(email, subject, body) == true) labMassege.Text = "Mật khẩu đăng nhập đã được gửi tới Email của bạn !"; else labMassege.Text = "Hệ thống không thể gửi Email"; } else { labMassege.Text = "Xin lỗi! Chúng tôi không tìm thấy tài khoản của bạn trong hệ thống."; } }
protected ETO.Admin ReceiveHtml() { SecurityBSO securityBSO = new SecurityBSO(); ETO.Admin admin = new ETO.Admin(); admin.AdminName = txtAdminUser.Text; admin.AdminEmail = txtAdminEmail.Text; admin.AdminLoginType = Convert.ToBoolean(hddAdminLoginType.Value); if (admin.AdminLoginType) { admin.AdminPass = securityBSO.EncPwd(News_Pass.Text.Trim()); } else { admin.AdminPass = ""; } admin.AdminPass = securityBSO.EncPwd(News_Pass.Text.Trim()); admin.RolesID = Convert.ToInt32(hddRoles_ID.Value); admin.AdminActive = Convert.ToBoolean(hddActied.Value); admin.AdminFullName = (txtFullName.Text != "") ? txtFullName.Text.Trim() : ""; admin.AdminCreated = Convert.ToDateTime(hdd_Created.Value); admin.AdminLog = Convert.ToDateTime(hdd_log.Value); admin.AdminPermission = (hddPermission.Value != "") ? hddPermission.Value : ""; admin.AdminAddress = hddAddress.Value; admin.AdminPhone = hddPhone.Value; admin.AdminNickYahoo = hddNickYahoo.Value; admin.AdminNickSkype = hddNickSkype.Value; admin.AdminAvatar = hddImageThumb.Value; admin.AdminSex = Convert.ToBoolean(hddSex.Value); admin.AdminBirth = Convert.ToDateTime(hddBirth.Value); return admin; }
public Member ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int icon_w = Convert.ToInt32(config.New_icon_w); int icon_h = Convert.ToInt32(config.New_icon_h); SecurityBSO securityBSO = new SecurityBSO(); Member member = new Member(); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Avatar/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(txtAvatar, path, icon_w, icon_h); member.MemberID = (hddMemberID.Value != "") ? Convert.ToInt32(hddMemberID.Value) : 0; member.UserName = (txtUserName.Text != "") ? txtUserName.Text.Trim() : hddUsername.Value; member.Email = (txtEmail.Text != "") ? txtEmail.Text.Trim() : ""; member.Password = (txtPassword.Text != "") ? securityBSO.EncPwd(txtPassword.Text.Trim()) : ""; member.FullName = (txtFullName.Text != "") ? txtFullName.Text.Trim() : ""; member.Address = (txtAddress.Text != "") ? txtAddress.Text.Trim() : ""; member.Phone = (txtPhone.Text != "") ? txtPhone.Text.Trim() : ""; member.NickYahoo = (txtNickYahoo.Text != "") ? txtNickYahoo.Text.Trim() : ""; member.NickSkype = (txtNickSkype.Text != "") ? txtNickSkype.Text.Trim() : ""; member.Avatar = (image_thumb != "") ? image_thumb : hddImageThumb.Value; member.Sex = Convert.ToBoolean(rdbSex.SelectedItem.Value); member.Birth = txtBirth.SelectedDate.Value; member.Actived = Convert.ToBoolean(rdbList.SelectedItem.Value); return member; }
public ETO.Admin ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); ETO.Config config = configBSO.GetAllConfig(Language.language); int icon_w = Convert.ToInt32(config.New_icon_w); int icon_h = Convert.ToInt32(config.New_icon_h); SecurityBSO securityBSO = new SecurityBSO(); ETO.Admin admin = new ETO.Admin(); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Avatar/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(txtAvatar, path, icon_w, icon_h); admin.AdminLoginType = Convert.ToBoolean(rdbLoginType.SelectedItem.Value); //if (rdbLoginType.SelectedItem.Value.Equals("True")) //{ admin.AdminPass = (txtAdminPass.Text != "") ? securityBSO.EncPwd(txtAdminPass.Text.Trim()) : hddPass.Value; admin.AdminName = (txtAdminName.Text != "") ? txtAdminName.Text.Trim() : hddAdmin_Username.Value; admin.AdminEmail = (txtAdminEmail.Text != "") ? txtAdminEmail.Text.Trim() : ""; //} // admin.RolesID = (ddlRoles.SelectedValue != "") ? Convert.ToInt32(ddlRoles.SelectedValue) : 0; admin.RolesID = 1; admin.AdminActive = Convert.ToBoolean(rdbList.SelectedItem.Value); admin.AdminFullName = (txtFullName.Text != "") ? txtFullName.Text.Trim() : ""; admin.AdminCreated = Convert.ToDateTime(hdd_Created.Value); admin.AdminLog = Convert.ToDateTime(hdd_log.Value); //admin.AdminPermission = ""; admin.AdminPermission = (CheckedList() != "") ? CheckedList() : ""; admin.AdminAddress = (txtAddress.Text != "") ? txtAddress.Text.Trim() : ""; admin.AdminPhone = (txtPhone.Text != "") ? txtPhone.Text.Trim() : ""; admin.AdminNickYahoo = (txtNickYahoo.Text != "") ? txtNickYahoo.Text.Trim() : ""; admin.AdminNickSkype = (txtNickSkype.Text != "") ? txtNickSkype.Text.Trim() : ""; admin.AdminAvatar = (image_thumb != "") ? image_thumb : hddImageThumb.Value; admin.AdminSex = Convert.ToBoolean(rdbSex.SelectedItem.Value); admin.AdminBirth = txtBirth.SelectedDate.Value; return admin; }