public string Update(string TenND, DateTime NgaySinh, bool GioiTinh, string DiaChi, string SDT, string TenDangNhap, string MatKhau, string ChucVu) { if (DateTime.Compare(NgaySinh, DateTime.Now) <= 0) { try { NguoiDung.CapNhatThongTin(PhanQuyenNguoiDung.TenDangNhap, TenND, NgaySinh, GioiTinh?1:0, DiaChi, SDT); if (NguoiDung.LayThongTin(TenDangNhap).TenND == TenND && NguoiDung.LayThongTin(TenDangNhap).NgaySinh == NgaySinh && NguoiDung.LayThongTin(TenDangNhap).GioiTinh == GioiTinh && NguoiDung.LayThongTin(TenDangNhap).DiaChi == DiaChi && NguoiDung.LayThongTin(TenDangNhap).SDT == SDT) { return("successed"); } else { return("failed"); } } catch { return("failed"); } } else { return("failed"); } }
private void frmCapNhatThongTinND_Load(object sender, EventArgs e) { ChiTietNguoiDung nd = NguoiDung.LayThongTin(PhanQuyenNguoiDung.TenDangNhap); txtDiaChi.Text = nd.DiaChi; //dtpNgaySinh.Text = nd.NgaySinh.Day =; dtpNgaySinh.Text = nd.NgaySinh.ToString(); txtSoDienThoai.Text = nd.SDT; txtTenNguoiDung.Text = nd.TenND; if (nd.GioiTinh == true) { rdoNam.Checked = true; } else { rdoNu.Checked = true; } lblThongBao.Text = ""; }