private void GetKolAccounts() { try { using (var controller = new Controllers.KolController()) { var result = controller.GetKolAccounts(); dtGroupAccount.ItemsSource = result.Body; } } catch (Exception c) { MessageBox.Show(c.Message); } }
private void LoadInfo(string search = null) { try { switch (selectorType) { case Models.Common.SelectorType.GroupAccounts: using (var controller = new Controllers.GroupController()) { var result = controller.GetGroupAccounts(search: search); dtSource.ItemsSource = result.Body; } break; case Models.Common.SelectorType.KolAccounts: using (var controller = new Controllers.KolController()) { var result = controller.GetKolAccounts(search: search); dtSource.ItemsSource = result.Body; } break; case Models.Common.SelectorType.TafsiliGroup: using (var controller = new Controllers.TafsiliGroupController()) { var result = controller.GetTafsiliGroupAccounts(search: search); dtSource.ItemsSource = result.Body; } break; case Models.Common.SelectorType.PeopleGroup: using (var controller = new Controllers.PeopleGroupController()) { var result = controller.GetPeopleGroup(); dtSource.ItemsSource = result.Body; } break; } } catch (Exception c) { MessageBox.Show(c.Message); } }