LogikalProjectImport.xaml.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Windows;
  4. using InABox.DynamicGrid;
  5. using InABox.Logikal;
  6. namespace PRSDesktop;
  7. public class LogikalProjectGrid : DynamicItemsListGrid<LogikalProject>
  8. {
  9. public LogikalProjectGrid()
  10. {
  11. }
  12. protected override void DoReconfigure(DynamicGridOptions options)
  13. {
  14. base.DoReconfigure(options);
  15. options.FilterRows = true;
  16. options.HideDatabaseFilters = true;
  17. }
  18. }
  19. public partial class LogikalProjectImport : Window
  20. {
  21. public LogikalProjectImport()
  22. {
  23. InitializeComponent();
  24. using (var client = new LogikalClient())
  25. {
  26. if (client.Connect() == LogikalStatus.Ok)
  27. {
  28. if (client.Login() == LogikalStatus.Ok)
  29. {
  30. Projects.Items =
  31. client.ProjectList()?.OfType<LogikalProject>().ToList()
  32. ?? new List<LogikalProject>();
  33. Projects.Refresh(true,true);
  34. }
  35. }
  36. }
  37. }
  38. private void OK_Click(object sender, RoutedEventArgs e)
  39. {
  40. DialogResult = true;
  41. }
  42. private void Cancel_Click(object sender, RoutedEventArgs e)
  43. {
  44. DialogResult = false;
  45. }
  46. }