Beispiel #1
0
        private void btnXacNhan_Click(object sender, EventArgs e)
        {
            string ten      = txtTenMoi.Text;
            string gioitinh = cbGioiTinhMoi.Text;
            string ngaysinh = dtpNgaySinhMoi.Text;
            string sdt      = txtSDTMoi.Text;
            double luong    = 0;

            if (txtLuongMoi.Text.Length != 0)
            {
                luong = double.Parse(txtLuongMoi.Text);
            }
            if (ckbNgaySinh.Checked == false)
            {
                ngaysinh = "";
            }
            else
            {
                ngaysinh = String.Format("{0:yyyy/MM/dd}", ngaysinh);
            }
            if (kiemTra(ten, gioitinh, ngaysinh, sdt, luong))
            {
                int ketQua = 0;
                ketQua = NhanVienControl.suaThongTin(id, ten, gioitinh, ngaysinh, sdt, luong);
                if (ketQua > 0)
                {
                    MessageBox.Show("thay đổi thành công");
                    this.Close();
                }
            }
        }