private void btnThayDoiGiaDV_Click(object sender, EventArgs e) { float giamoi; float.TryParse(txbGiaMoi.Text, out giamoi); if (txbmk.Text == "") { MessageBox.Show("Lỗi", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (giamoi != 0) { if (XuLyDAL.ktKhopMK(this.Text, txbmk.Text)) { DichVuDAL.thayDoiGiaDV(giamoi); MessageBox.Show("Thay đổi giá dịch vụ thành công !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); txbGiaMoi.Text = ""; txbmk.Text = ""; } else { MessageBox.Show("Mật khẩu không đúng !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Lỗi", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static string doiMK(string tentk, string mkCu, string mkMoi, string mkNhapLai) { if (!XuLyDAL.ktKhopMK(tentk, mkCu)) { return("kkmk"); } else if (!XuLyDAL.ktMatKhauHopLe(mkMoi)) { return("mkKhongHopLe"); } else if (mkMoi != mkNhapLai) { return("KhacMKnhapLai"); } return("ok"); }