Пример #1
0
 private void LoadMaNV()
 {
     try
     {
         if (txtTenNV.Text != "")
         {
             try
             {
                 DataTable tblTenNV = Nhanvien_BUS.LoadTenNV();
                 int       j        = 0;
                 foreach (DataRow dr in tblTenNV.Rows)
                 {
                     if (txtTenNV.Text == dr["TENNV"].ToString())
                     {
                         txtMaNV.Text = dr["MANV"].ToString();
                         return;
                     }
                     else
                     {
                         j++;
                     }
                 }
             }
             catch (Exception ex)
             {
                 MessageBox.Show("Can not open connection ! ");
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Пример #2
0
 private void getDataNV(AutoCompleteStringCollection dataCollection)
 {
     try
     {
         DataTable tblTenNV = Nhanvien_BUS.LoadTenNV();
         int       i        = 0;
         foreach (DataRow dr in tblTenNV.Rows)
         {
             dataCollection.Add(dr["TENNV"].ToString());
             i++;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Can not open connection ! ");
     }
 }
Пример #3
0
        private string LoadMaNV()
        {
            DataTable tblTenNV = Nhanvien_BUS.LoadTenNV();
            int       j        = 0;

            foreach (DataRow dr in tblTenNV.Rows)
            {
                if (txtTenNV.Text == dr["TENNV"].ToString())
                {
                    return(dr["MANV"].ToString());
                }
                else
                {
                    j++;
                }
            }
            return("");
        }