コード例 #1
0
        private void frmChitietNhanvien_Load(object sender, EventArgs e)
        {
            DataTable dtx = B_NhanVien.GetAllNhanVien();

            dt = dtx;
            dgvNhanVien.DataSource = dtx;
            DataTable nhom = B_NhomHang.GetAllNhomHang();

            FillCbo(nhom, cbxNhom, "MaNhom", "TenNhom");
            DataTable ca = B_CaLam.GetAllCaLam();

            FillCbo(ca, cbxCa, "MaCa", "TenCa");
            DataTable cv = B_CongViec.GetAllCV();

            FillCbo(cv, cbxCV, "MaCV", "TenCV");
        }
コード例 #2
0
 

 private void btnXoa_Click(object sender, EventArgs e) 

 {
     
            if (checkDuplicate() == 2)
     {
         
            {
             
 MessageBox.Show("Không Có Ca Làm Đó Để Xóa", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 txtMaCa.Text = ""; 
                return; 

         }
     }
     
 else
            {
         
                if (MessageBox.Show("Bạn Muốn Xóa Không ?", "Cảnh Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             
                {
                 
 B_CaLam.DeleteCaLam(txtMaCa.Text); 
 MessageBox.Show("Xóa Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 dgvCaLam.DataSource = B_CaLam.GetAllCaLam(); 
 dt = B_CaLam.GetAllCaLam(); 
                    clearTxt(); 

             }
         }
         

     } 

 }
コード例 #3
0
                                                            

 private void btnSua_Click(object sender, EventArgs e) 

                                                            {
                                                                
            if (checkDuplicate() == 2)
                                                                {
                                                                    
            {
                                                                        
 MessageBox.Show("Không Có Mã Ca Làm Đó Để Thay Đổi Liên Quan", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 txtMaCa.Text = ""; 
                return; 

                                                                    }
                                                                }
                                                                
 else
            {
                                                                    
 CaLamDTO ob = checkData(); 
                if (ob != null)

                                                                    {
                                                                        
                {
                                                                            
 B_CaLam.saveCaLam(ob, sys.UPDATE); 
 MessageBox.Show("Sửa Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 dt = B_CaLam.GetAllCaLam(); 
 dgvCaLam.DataSource = B_CaLam.GetAllCaLam(); 
                    clearTxt(); 

                                                                        }
                                                                    }
                                                                    

                                                                } 

                                                            }
コード例 #4
0
                                                            
 private void btnThem_Click(object sender, EventArgs e) 

                                                            {
                                                                
 CaLamDTO ob = checkData(); 
            if (ob != null)

                                                                {
                                                                    
            {
                                                                        
                if (checkDuplicate() == 1)
                                                                        {
                                                                            
                {
                                                                                
 MessageBox.Show("Mã Ca Làm Trùng", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 txtMaCa.Focus(); 
                    return; 

                                                                            }
                                                                        }
                                                                        
 else
                {
                                                                            
 B_CaLam.saveCaLam(ob, sys.INSERT); 
 MessageBox.Show("Thêm Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 dt = B_CaLam.GetAllCaLam(); 
 dgvCaLam.DataSource = dt; 
                    clearTxt(); 

                                                                        } 

                                                                    }
                                                                }
                                                                

                                                            }
コード例 #5
0
 

 private void frmChitietCalamviec_Load(object sender, EventArgs e) 

 {
     
 dt = B_CaLam.GetAllCaLam(); 
 dgvCaLam.DataSource = dt; 

 }