public static List <CBXModel> LayDanhSachTaiKhoan() { List <CBXModel> lst = new List <CBXModel>(); try { DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.ConnectionString(), CommandType.Text, "SELECT TaiKhoanID, TenDangNhap FROM TaiKhoan WHERE TinhTrang=1"); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { CBXModel CBX = new CBXModel(); CBX.Value = "txtNguoiThucHien"; CBX.ID = Int32.Parse(ds.Tables[0].Rows[i]["TaiKhoanID"].ToString()); CBX.Name = ds.Tables[0].Rows[i]["TenDangNhap"].ToString(); lst.Add(CBX); } } } catch (Exception ex) { } return(lst); }
public static List <CBXModel> LayDanhSachDuAn() { List <CBXModel> lst = new List <CBXModel>(); try { DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.ConnectionString(), CommandType.Text, "SELECT DuAnID, TenDuAn FROM DuAn"); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { CBXModel CBX = new CBXModel(); CBX.Value = "DuAnID"; CBX.ID = Int32.Parse(ds.Tables[0].Rows[i]["DuAnID"].ToString()); CBX.Name = ds.Tables[0].Rows[i]["TenDuAn"].ToString(); lst.Add(CBX); } } } catch (Exception ex) { } return(lst); }