Ejemplo n.º 1
0
        private void btn_luu_Click(object sender, EventArgs e)
        {
            if (!CheckBeforeSave())
            {
                return;
            }
            DTO_NhanVien nv = new DTO_NhanVien();

            nv.ma_nhan_vien  = txt_ma_nhan_vien.Text;
            nv.ten_nhan_vien = txt_ten_nhan_vien.Text;
            nv.ma_so_xe      = Convert.ToString(cbb_masoxe.SelectedValue);
            nv.cmnd          = txt_cmnd.Text;
            nv.dia_chi       = txt_dia_chi.Text;
            nv.dien_thoai    = txt_dien_thoai.Text;
            nv.chucvu        = Convert.ToString(cbb_chuc_vu.SelectedItem);
            nv.ngay_tao      = DateTime.Now;
            nv.nam_sinh      = dt_nam_sinh.Value;
            if (txt_ma_nhan_vien.Enabled)
            {
                dal.Create_nv(nv);
            }
            else
            {
                dal.Update_nv(nv);
            }
            BindDataGridView();
            ResetControl();


            btn_xoa.Enabled = false;
            btn_sua.Enabled = false;
        }
Ejemplo n.º 2
0
 //public List<DTO_NhanVien> GetAll_NV()
 //{
 //    return nv.GetAll_NV();
 //}
 public bool Create_nv(DTO_NhanVien nhanvien)
 {
     return(nv.Create_nv(nhanvien));
 }