예제 #1
0
        public void PassData(List <MaQuanLi> list)
        {
            //string setthuoctinh = @"";
            DBConnect cn = new DBConnect();

            cn.conn.Open();
            DataTable dt    = new DataTable();
            String    query = "select ID,MaNhanVien from NhanVien ";
            // String query1 = "select ID,Pass from NhanVien ";
            SqlCommand command = new SqlCommand(query, cn.conn);

            command.ExecuteNonQuery();
            SqlDataAdapter da = new SqlDataAdapter(command);

            da.Fill(dt);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                MaQuanLi a = new MaQuanLi(dt.Rows[i]["ID"].ToString(), Convert.ToInt32(dt.Rows[i]["MaNhanVien"].ToString()));
                list.Add(a);
            }


            cn.conn.Close();
        }
예제 #2
0
        public void PassData(List<MaQuanLi> list)
        {
            //string setthuoctinh = @"";
            DBConnect cn = new DBConnect();
            cn.conn.Open();
            DataTable dt = new DataTable();
            String query = "select ID,MaNhanVien from NhanVien ";
            // String query1 = "select ID,Pass from NhanVien ";
            SqlCommand command = new SqlCommand(query, cn.conn);
            command.ExecuteNonQuery();
            SqlDataAdapter da = new SqlDataAdapter(command);
            da.Fill(dt);
              for (int i = 0; i < dt.Rows.Count; i++)
             {
                 MaQuanLi a = new MaQuanLi(dt.Rows[i]["ID"].ToString(), Convert.ToInt32(dt.Rows[i]["MaNhanVien"].ToString()));
                 list.Add(a);
             }

            cn.conn.Close();
        }