Guest User

Untitled

a guest
Jul 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. public partial class Customer
  2. {
  3. public Customer()
  4. {
  5. this.Consignee = new HashSet<Consignee>();
  6. }
  7.  
  8. public int idCustomer { get; set; }
  9. public string nameCustomer { get; set; }
  10.  
  11. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
  12. public virtual ICollection<Consignee> Consignee { get; set; }
  13. }
  14.  
  15. public partial class Consignee
  16. {
  17. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
  18. public Consignee()
  19. {
  20. this.Servers = new HashSet<Servers>();
  21. this.Systems = new HashSet<Systems>();
  22. }
  23.  
  24. public int idConsignee { get; set; }
  25. public int idCustomerConsignee { get; set; }
  26. public string nameConsignee { get; set; }
  27.  
  28. public virtual Customer Customer { get; set; }
  29. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
  30. public virtual ICollection<Servers> Servers { get; set; }
  31. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
  32. public virtual ICollection<Systems> Systems { get; set; }
  33. }
  34.  
  35. public partial class Servers
  36. {
  37. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
  38. public Servers()
  39. {
  40. this.Licence = new HashSet<Licence>();
  41. }
  42.  
  43. public string idUidServer { get; set; }
  44. public string ipServer { get; set; }
  45. public Nullable<int> idConsigneeServer { get; set; }
  46.  
  47. public virtual Consignee Consignee { get; set; }
  48. }
  49.  
  50. <TreeView x:Name="tvForLic">
  51. <TreeView.ItemTemplate>
  52. <HierarchicalDataTemplate ItemsSource="{Binding Path = Consignee}" >
  53. <TextBlock Text="{Binding Path= nameCustomer}" />
  54. <HierarchicalDataTemplate.ItemTemplate>
  55. <DataTemplate>
  56. <TextBlock Text="{Binding Path= nameConsignee}" />
  57. </DataTemplate>
  58. </HierarchicalDataTemplate.ItemTemplate>
  59. </HierarchicalDataTemplate>
  60. </TreeView.ItemTemplate>
  61. </TreeView>
  62.  
  63. <TreeView x:Name="tvForSystem" ItemsSource="{Binding Consignee}">
  64. <TreeView.Resources>
  65. <HierarchicalDataTemplate DataType="{x:Type local:Systems}" ItemsSource="{Binding Consignee}">
  66. <StackPanel Orientation="Horizontal">
  67. <CheckBox Margin="2" />
  68. <TextBlock Text="{Binding nameSystem}" />
  69. </StackPanel>
  70. </HierarchicalDataTemplate>
  71. <HierarchicalDataTemplate DataType="{x:Type local:Customer}" ItemsSource="{Binding Consignee}">
  72. <StackPanel Orientation="Horizontal">
  73. <CheckBox Margin="2" />
  74. <TextBlock Text="{Binding nameCustomer}" />
  75. </StackPanel>
  76. </HierarchicalDataTemplate>
  77. </TreeView.Resources>
  78. </TreeView>
  79.  
  80. xmlns:local="clr-namespace:LicenseManager"
  81.  
  82. <TreeView x:Name="tvForSystem" ItemsSource="{Binding Consignee}">
  83. <TreeView.Resources>
  84. <HierarchicalDataTemplate DataType="{x:Type local:Customer}" ItemsSource="{Binding Consignee}" >
  85. <StackPanel Orientation="Horizontal">
  86. <TextBlock Text="{Binding nameCustomer}" />
  87. </StackPanel>
  88. </HierarchicalDataTemplate>
  89. <HierarchicalDataTemplate DataType="{x:Type local:Consignee}" ItemsSource="{Binding Consignee}">
  90. <StackPanel Orientation="Horizontal">
  91. <TextBlock Text="{Binding nameConsignee}" />
  92. </StackPanel>
  93. </HierarchicalDataTemplate>
  94. <DataTemplate DataType="{x:Type local:Systems}">
  95. <StackPanel Orientation="Horizontal">
  96. <TextBlock Text="{Binding nameConsignee}" />
  97. </StackPanel>
  98. </DataTemplate>
  99. </TreeView.Resources>
Add Comment
Please, Sign In to add comment