public static CatDetails[] FetchCatNames() { DataTable catgDt = new DataTable(); budhashop.CLASS.CallCache callCache = new budhashop.CLASS.CallCache(); DataSet allDataDS = callCache.getCache(); catgDt = allDataDS.Tables[3]; List <CatDetails> details = new List <CatDetails>(); foreach (DataRow dtrow in catgDt.Rows) { CatDetails user = new CatDetails(); user.CatId = dtrow["CategoryId"].ToString(); user.CatName = dtrow["CategoryName"].ToString(); details.Add(user); } return(details.ToArray()); }
private void ShowCat_Click(object sender, RoutedEventArgs e) { if (catsList.SelectedItem != null) { string name = catsList.SelectedItem.ToString(); CatParameters selectedCat = _catsList.Find(selCat => selCat.catName == name); var newWPF = new CatDetails(selectedCat); newWPF.CatDetail(); newWPF.Show(); } else { MessageBox.Show("Choose a cat!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); } }
public static CatDetails[] FetchCatNames() { DataTable catgDt = new DataTable(); budhashop.CLASS.CallCache callCache = new budhashop.CLASS.CallCache(); DataSet allDataDS = callCache.getCache(); catgDt = allDataDS.Tables[3]; List<CatDetails> details = new List<CatDetails>(); foreach (DataRow dtrow in catgDt.Rows) { CatDetails user = new CatDetails(); user.CatId = dtrow["CategoryId"].ToString(); user.CatName = dtrow["CategoryName"].ToString(); details.Add(user); } return details.ToArray(); }