private void btThem_CN_Click(object sender, EventArgs e)
        {
            if (txtHo.Text == "" || txtTen.Text == "" || cbGioitinh.Text == "" || dtNgaysinh.Value == null || txtNoisinh.Text == "" || txtCmnd.Text == "" || txtDantoc.Text == "" || txttongiao.Text == "" || txtQuequan.Text == "" || txtSonha.Text == "" || txtNoiOHien.Text == "" || txtSDTN.Text == "" || txtSDT.Text == "" || txtEmail.Text == "" || cbhonnhan.Text == "" || dtNgay.Value == null || txtNoilamviec.Text == "" || txtTrinhdoVH.Text == "" || txtMaCN_CC.Text == "" || txtMahesoluong.Text == "" || txtPhuCap.Text == "" || txtTKnganhang.Text == "" || txtNoicap.Text == "" || dtNgaycap.Value == null || picCongnhan.ImageLocation == "" || txtQuoctich.Text == "" || txtMaBHXH.Text == "" || txtMaBHYT.Text == "")
            {
                MessageBox.Show("Không có dữ liệu để thêm", "Thông báo");
                return;
            }
            CongNhan cn = new CongNhan(txtMaCN_CN.Text, txtHo.Text, txtTen.Text, cbGioitinh.Text, dtNgaysinh.Value, txtNoisinh.Text, txtCmnd.Text, txtDantoc.Text, txttongiao.Text, txtQuequan.Text, txtSonha.Text, txtNoiOHien.Text, txtSDTN.Text, txtSDT.Text, txtEmail.Text, cbhonnhan.Text, dtNgay.Value, txtNoilamviec.Text, txtTrinhdoVH.Text, txtMaCN_CC.Text, txtMahesoluong.Text, txtPhuCap.Text, txtTKnganhang.Text, txtNoicap.Text, dtNgaycap.Value, picCongnhan.ImageLocation, "1", txtQuoctich.Text, txtMaBHXH.Text, txtMaBHYT.Text);

            try
            {
                cnb.AddCongNhan(cn);
            }
            catch (Exception p)
            {
                MessageBox.Show(p.ToString());
            }
        }
Example #2
0
        private void btThem_CN_Click(object sender, EventArgs e)
        {
            if (txtHoCN.Text == "" || txtTenCN.Text == "" || cbGioitinh.Text == "" || dtNgaysinh.Value == null || txtNoisinh.Text == "" || txtCMND.Text == "" || txtDantoc.Text == "" || txttongiao.Text == "" || txtQuequan.Text == "" || txtSonha.Text == "" || txtNoiOHien.Text == "" || txtSDTN.Text == "" || txtSDT.Text == "" || txtEmail.Text == "" || cbTTHonnhan.Text == "" || dtNgaycap.Value == null || txtNoiLV.Text == "" || txtTrinhdoVH.Text == "" || txtMaCN.Text == "" || txtMahesoluong.Text == "" || txtPhuCap.Text == "" || txtTKNganhang.Text == "" || txtNoicap.Text == "" || dtNgaycap.Value == null || picCN.ImageLocation == "" || txtQuoctich.Text == "" || txtBHXH.Text == "" || txtBHYT.Text == "")
            {
                MessageBox.Show("Lỗi!! Vui lòng nhập thông tin");
                return;
            }
            CongNhan    cn  = new CongNhan(txtMaCN.Text, txtHoCN.Text, txtTenCN.Text, cbGioitinh.Text, dtNgaysinh.Value, txtNoisinh.Text, txtCMND.Text, txtDantoc.Text, txttongiao.Text, txtQuequan.Text, txtSonha.Text, txtNoiOHien.Text, txtSDTN.Text, txtSDT.Text, txtEmail.Text, cbTTHonnhan.Text, dtNgaytuyendung.Value, txtNoiLV.Text, txtTrinhdoVH.Text, cbChucvu.Text, txtMahesoluong.Text, txtPhuCap.Text, txtTKNganhang.Text, txtNoicap.Text, dtNgaycap.Value, picCN.ImageLocation, "1", txtQuoctich.Text, txtBHXH.Text, txtBHYT.Text);
            CongnhanBUS cnb = new CongnhanBUS();

            try
            {
                cnb.AddCongNhan(cn);
            }
            catch (Exception p)
            {
                MessageBox.Show(p.ToString());
            }
        }