DataBaseConfiguration.xaml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <wpf:ThemableWindow x:Class="PRSDesktop.DataBaseConfiguration"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:system="clr-namespace:System;assembly=System.Runtime"
  7. xmlns:classes="clr-namespace:Comal.Classes;assembly=PRSClasses"
  8. xmlns:wpf="clr-namespace:InABox.Wpf;assembly=InABox.Wpf"
  9. xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
  10. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  11. mc:Ignorable="d"
  12. Title="System Configuration"
  13. Width="750"
  14. Margin="5"
  15. SizeToContent="Height"
  16. WindowStartupLocation="CenterScreen"
  17. >
  18. <Window.Resources>
  19. <!--<Style TargetType="{x:Type ListBoxItem}">
  20. <Style.Triggers>
  21. <Trigger Property="IsFocused" Value="True">
  22. <Setter Property="Background" Value="LightGreen" />
  23. </Trigger>
  24. <Trigger Property="IsSelected" Value="True">
  25. <Setter Property="Background" Value="LightGreen" />
  26. </Trigger>
  27. <Trigger Property="IsFocused" Value="False">
  28. <Setter Property="Background" Value="Transparent" />
  29. </Trigger>
  30. </Style.Triggers>
  31. </Style>-->
  32. </Window.Resources>
  33. <Grid Margin="5">
  34. <Grid.ColumnDefinitions>
  35. <ColumnDefinition Width="100" />
  36. <ColumnDefinition Width="*" />
  37. </Grid.ColumnDefinitions>
  38. <Grid.RowDefinitions>
  39. <RowDefinition Height="Auto" />
  40. <RowDefinition Height="*" />
  41. <RowDefinition Height="Auto" />
  42. <RowDefinition Height="Auto" />
  43. </Grid.RowDefinitions>
  44. <Border Grid.Row="0" Grid.Column="0" BorderBrush="Gray" BorderThickness="0.75" Background="WhiteSmoke"
  45. CornerRadius="5,5,0,0">
  46. <Label Content="Profiles" HorizontalContentAlignment="Center" FontWeight="Bold" />
  47. </Border>
  48. <ListBox
  49. Grid.Column="0"
  50. Grid.Row="1"
  51. x:Name="Profiles"
  52. BorderThickness="0.75,0.75,0.75,0.75"
  53. BorderBrush="Gray"
  54. HorizontalContentAlignment="Stretch"
  55. Background="White"
  56. SelectionChanged="Profiles_SelectionChanged"
  57. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  58. <ListBox.ItemTemplate>
  59. <DataTemplate>
  60. <Border BorderBrush="Gray" BorderThickness="0.75" Background="WhiteSmoke" CornerRadius="5"
  61. Margin="-2,1,-2,1" Padding="5" Height="50">
  62. <TextBlock Text="{Binding}" TextAlignment="Center" TextWrapping="Wrap"
  63. VerticalAlignment="Center" />
  64. </Border>
  65. </DataTemplate>
  66. </ListBox.ItemTemplate>
  67. </ListBox>
  68. <Border Grid.Row="2" Grid.Column="0" Background="WhiteSmoke" Height="28" BorderBrush="Gray"
  69. BorderThickness="0.75,0,0.75,0.75" CornerRadius="0,0,5,5" Padding="2">
  70. <DockPanel>
  71. <Border x:Name="AddProfile" DockPanel.Dock="Left" Width="26" BorderThickness="0"
  72. MouseUp="AddProfile_MouseUp" />
  73. <Border x:Name="DeleteProfile" DockPanel.Dock="Right" Width="26" BorderThickness="0"
  74. MouseUp="DeleteProfile_MouseUp" />
  75. <Label DockPanel.Dock="Left" />
  76. </DockPanel>
  77. </Border>
  78. <Grid Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Margin="5,0,0,0">
  79. <Grid.RowDefinitions>
  80. <RowDefinition Height="Auto" />
  81. <RowDefinition Height="Auto" />
  82. <RowDefinition Height="Auto" />
  83. <RowDefinition Height="Auto" />
  84. <RowDefinition Height="Auto" />
  85. <RowDefinition Height="Auto" />
  86. <RowDefinition Height="Auto" />
  87. <RowDefinition Height="*" />
  88. <RowDefinition Height="Auto" />
  89. </Grid.RowDefinitions>
  90. <Grid.ColumnDefinitions>
  91. <ColumnDefinition Width="35*" />
  92. <ColumnDefinition Width="Auto" />
  93. <ColumnDefinition Width="Auto" />
  94. </Grid.ColumnDefinitions>
  95. <Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray" BorderThickness="0.75"
  96. Background="WhiteSmoke" CornerRadius="5,5,0,0">
  97. <Label Content="General" Padding="10,5,5,5" VerticalContentAlignment="Center"
  98. HorizontalContentAlignment="Left" FontWeight="Bold" />
  99. </Border>
  100. <Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray"
  101. BorderThickness="0.75,0,0.75,0.75" Background="WhiteSmoke" CornerRadius="0,0,5,5" Padding="5">
  102. <DockPanel Margin="5,5,5,0">
  103. <Button x:Name="CreateLink" DockPanel.Dock="Right" Content="Create Link" Padding="10,0"
  104. Click="CreateLink_Click" Margin="5,0,0,0" />
  105. <CheckBox x:Name="IsActive" DockPanel.Dock="Right" Content="Active?" VerticalAlignment="Center"
  106. Margin="5,0,5,0" Checked="IsActive_Checked" Unchecked="IsActive_Checked" />
  107. <Label DockPanel.Dock="Left" Content="Name" VerticalContentAlignment="Center" Width="50" />
  108. <TextBox x:Name="ProfileName" DockPanel.Dock="Left" VerticalContentAlignment="Center"
  109. Background="LightYellow" Margin="5,0,5,0" TextChanged="ProfileName_TextChanged" />
  110. </DockPanel>
  111. </Border>
  112. <Border Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray" BorderThickness="0.75"
  113. Background="WhiteSmoke" CornerRadius="5,5,0,0" Margin="0,5,0,0">
  114. <Label Content="Database Settings" Padding="10,5,5,5" VerticalContentAlignment="Center"
  115. HorizontalContentAlignment="Left" FontWeight="Bold" />
  116. </Border>
  117. <Border Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray"
  118. BorderThickness="0.75,0,0.75,0.75" Background="WhiteSmoke" CornerRadius="0,0,5,5" Padding="5">
  119. <Grid>
  120. <Grid.RowDefinitions>
  121. <RowDefinition Height="Auto" x:Name="StandaloneHeader" />
  122. <RowDefinition Height="Auto" x:Name="StandalonePath" />
  123. <RowDefinition Height="Auto" x:Name="NetworkHeader" />
  124. <RowDefinition Height="Auto"/>
  125. <RowDefinition Height="Auto" x:Name="LocalHeader"/>
  126. <RowDefinition Height="Auto" x:Name="LocalSelectionRow"/>
  127. </Grid.RowDefinitions>
  128. <Grid.ColumnDefinitions>
  129. <ColumnDefinition Width="Auto" />
  130. <ColumnDefinition Width="*" />
  131. </Grid.ColumnDefinitions>
  132. <RadioButton x:Name="StandaloneOption" Grid.Row="0" Grid.Column="0"
  133. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  134. Checked="Option_Checked" />
  135. <DockPanel Grid.Row="0" Grid.Column="1" Margin="5">
  136. <Label DockPanel.Dock="Left" Content="Standalone" VerticalContentAlignment="Center"
  137. PreviewMouseDown="StandaloneLabel_Click" />
  138. </DockPanel>
  139. <Grid Grid.Row="1" Grid.Column="1" Margin="5,0,5,5">
  140. <Grid.RowDefinitions>
  141. <RowDefinition Height="Auto"/>
  142. <RowDefinition Height="Auto"/>
  143. </Grid.RowDefinitions>
  144. <Grid.ColumnDefinitions>
  145. <ColumnDefinition Width="Auto"/>
  146. <ColumnDefinition Width="*"/>
  147. </Grid.ColumnDefinitions>
  148. <Label Grid.Row="0" Grid.Column="0" Content="Database Location" VerticalContentAlignment="Center" />
  149. <DockPanel Grid.Row="0" Grid.Column="1">
  150. <Button x:Name="DBButton" DockPanel.Dock="Right" Content=".." Width="25" Click="DBButton_Click"
  151. Margin="5,0,0,0"/>
  152. <!-- <ComboBox x:Name="DbProvider" DockPanel.Dock="Right" Visibility="Collapsed" Width="70" -->
  153. <!-- VerticalContentAlignment="Center" SelectedIndex="0" Margin="5,0,0,0" -->
  154. <!-- SelectionChanged="DbProvider_SelectionChanged" IsEnabled="False"> -->
  155. <!-- ~1~<ListBoxItem Content="LiteDb"/>@1@ -->
  156. <!-- ~1~<ListBoxItem Content="MongoDb"/>@1@ -->
  157. <!-- <ListBoxItem Content="SQLite" /> -->
  158. <!-- </ComboBox> -->
  159. <TextBox x:Name="DBLocation" DockPanel.Dock="Left" VerticalContentAlignment="Center"
  160. Background="LightYellow" Margin="5,0,0,0" />
  161. </DockPanel>
  162. <Label x:Name="ColorScheme_Label" Grid.Row="1" Grid.Column="0" Content="Color Scheme" VerticalContentAlignment="Center" />
  163. <DockPanel Grid.Row="1" Grid.Column="1" Margin="0,5,0,0">
  164. <Button x:Name="SplashView" DockPanel.Dock="Right" Content=".." Width="25"
  165. Click="SplashView_Click" Margin="5,0,0,0" />
  166. <Button x:Name="SplashSelect" DockPanel.Dock="Right" Content="Select" Width="100"
  167. Click="SplashSelect_Click" Margin="5,0,0,0" />
  168. <Label DockPanel.Dock="Right" Content="Logo" VerticalContentAlignment="Center" Margin="5,0,0,0" />
  169. <xctk:ColorPicker x:Name="ColorScheme" DockPanel.Dock="Left" Margin="5,0,0,0"
  170. Background="LightYellow"
  171. SelectedColorChanged="ColorScheme_OnSelectedColorChanged" />
  172. </DockPanel>
  173. </Grid>
  174. <RadioButton x:Name="NetworkOption" Grid.Row="2" Grid.Column="0"
  175. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  176. Checked="Option_Checked" />
  177. <DockPanel Grid.Row="2" Grid.Column="1" Margin="5,0,5,0">
  178. <Label DockPanel.Dock="Left" Content="Networked" VerticalContentAlignment="Center"
  179. PreviewMouseDown="NetworkLabel_Click" />
  180. </DockPanel>
  181. <DockPanel Grid.Row="3" Grid.Column="1" Margin="5" x:Name="NetworkPath" KeyboardNavigation.TabNavigation="Local">
  182. <Label DockPanel.Dock="Left" VerticalContentAlignment="Center" Content="Server URL" />
  183. <ComboBox x:Name="Protocol" DockPanel.Dock="Right" Visibility="Collapsed" SelectedIndex="0"
  184. Width="100" IsEnabled="False" VerticalContentAlignment="Center"
  185. TabIndex="0"
  186. SelectionChanged="Protocol_SelectionChanged">
  187. <ComboBoxItem Content="Rest" />
  188. <ComboBoxItem Content="Rpc" />
  189. </ComboBox>
  190. <Label DockPanel.Dock="Right" Content="Protocol" VerticalContentAlignment="Center"
  191. Visibility="Collapsed" />
  192. <TextBox x:Name="ServerPort" DockPanel.Dock="Right" Width="50"
  193. VerticalContentAlignment="Center" Background="LightYellow"
  194. TextChanged="ServerPort_TextChanged" TextAlignment="Center"
  195. TabIndex="2"/>
  196. <Label DockPanel.Dock="Right" VerticalContentAlignment="Center" Content="Port" />
  197. <TextBox x:Name="ServerURL" DockPanel.Dock="Left" VerticalContentAlignment="Center"
  198. Background="LightYellow" Margin="5,0,0,0" TextChanged="ServerURL_TextChanged"
  199. TabIndex="1"/>
  200. </DockPanel>
  201. <RadioButton x:Name="LocalOption" Grid.Row="4" Grid.Column="0"
  202. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  203. Checked="Option_Checked" />
  204. <DockPanel Grid.Row="4" Grid.Column="1" Margin="5">
  205. <Label DockPanel.Dock="Left" Content="Local" VerticalContentAlignment="Center"
  206. PreviewMouseDown="LocalLabel_Click"/>
  207. </DockPanel>
  208. <DockPanel Grid.Row="5" Grid.Column="1" Margin="5,0,5,5" x:Name="LocalPath">
  209. <Label DockPanel.Dock="Left" VerticalContentAlignment="Center" Content="Server Name"/>
  210. <ComboBox x:Name="LocalServerName" DockPanel.Dock="Right"
  211. VerticalContentAlignment="Center"
  212. SelectionChanged="LocalServerName_SelectionChanged"/>
  213. </DockPanel>
  214. </Grid>
  215. </Border>
  216. <Border Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray" BorderThickness="0.75"
  217. Background="WhiteSmoke" CornerRadius="5,10,0,0" Margin="0,5,0,0">
  218. <Label Content="User Settings" Padding="5" VerticalContentAlignment="Center"
  219. HorizontalContentAlignment="Left" FontWeight="Bold" />
  220. </Border>
  221. <Border Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray"
  222. BorderThickness="0.75,0,0.75,0.75" Background="WhiteSmoke" CornerRadius="0,0,5,5" Padding="5">
  223. <DockPanel Margin="5" KeyboardNavigation.TabNavigation="Local">
  224. <Label Content="Login Type" DockPanel.Dock="Left" VerticalContentAlignment="Center" />
  225. <ComboBox x:Name="LoginType" DockPanel.Dock="Left" VerticalContentAlignment="Center" Width="100"
  226. Margin="5,0,0,0" SelectionChanged="LoginType_SelectionChanged"
  227. TabIndex="0">
  228. <ComboBoxItem Content="Network ID" />
  229. <ComboBoxItem Content="PIN Number" />
  230. <ComboBoxItem Content="User ID" />
  231. </ComboBox>
  232. <Label DockPanel.Dock="Left" Margin="5,0,0,0" Content="User ID" />
  233. <CheckBox x:Name="AutoLogin" DockPanel.Dock="Right" Margin="5,0,0,0" Content="Auto"
  234. VerticalContentAlignment="Center" Checked="AutoLogin_Checked"
  235. Unchecked="AutoLogin_Checked"
  236. TabIndex="3"/>
  237. <PasswordBox x:Name="Password" DockPanel.Dock="Right" Margin="5,0,0,0" Width="80"
  238. Background="LightYellow" VerticalContentAlignment="Center" KeyUp="Password_KeyUp"
  239. TabIndex="2"/>
  240. <Label DockPanel.Dock="Right" Content="Password" VerticalContentAlignment="Center" Margin="5,0,0,0" />
  241. <TextBox x:Name="UserID" DockPanel.Dock="Left" Margin="5,0,0,0" Background="LightYellow"
  242. VerticalContentAlignment="Center" TextChanged="UserID_TextChanged"
  243. TabIndex="1"/>
  244. </DockPanel>
  245. </Border>
  246. <Border Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray" BorderThickness="0.75"
  247. Background="WhiteSmoke" CornerRadius="5,10,0,0" Margin="0,5,0,0">
  248. <Label Content="External File Locations" Padding="5" VerticalContentAlignment="Center"
  249. HorizontalContentAlignment="Left" FontWeight="Bold" />
  250. </Border>
  251. <Border Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="3" BorderBrush="Gray"
  252. BorderThickness="0.75,0,0.75,0.75" Background="WhiteSmoke" CornerRadius="0,0,5,5" Padding="5">
  253. <Grid Margin="5">
  254. <Grid.RowDefinitions>
  255. <!--<RowDefinition Height="Auto"/>
  256. <RowDefinition Height="10"/>-->
  257. <RowDefinition Height="Auto" />
  258. <RowDefinition Height="10" />
  259. <RowDefinition Height="Auto" />
  260. <RowDefinition Height="10" x:Name="JobPrefixHeader" />
  261. <RowDefinition Height="Auto" x:Name="JobPrefixContent" />
  262. <RowDefinition Height="10" x:Name="POPrefixHeader" />
  263. <RowDefinition Height="Auto" x:Name="POPrefixContent" />
  264. </Grid.RowDefinitions>
  265. <Grid.ColumnDefinitions>
  266. <ColumnDefinition Width="Auto" />
  267. <ColumnDefinition Width="*" />
  268. <ColumnDefinition Width="Auto" />
  269. </Grid.ColumnDefinitions>
  270. <!--<Label Content="Auto Update" Grid.Row="0" Grid.Column="0" VerticalContentAlignment="Center"/>
  271. <DockPanel Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" >
  272. <ComboBox x:Name="UpdateType" DockPanel.Dock="Left" VerticalContentAlignment="Center" Width="50" Margin="5,0,0,0" SelectionChanged="UpdateType_SelectionChanged" >
  273. <ComboBoxItem Content="Url"/>
  274. <ComboBoxItem Content="File"/>
  275. </ComboBox>
  276. <ComboBox x:Name="UpdateAdmin" DockPanel.Dock="Right" VerticalContentAlignment="Center" Width="70" Margin="5,0,0,0" SelectionChanged="UpdateAdmin_SelectionChanged" ToolTip="Installer Security Privileges" >
  277. <ComboBoxItem Content="Admin"/>
  278. <ComboBoxItem Content="Normal"/>
  279. </ComboBox>
  280. <ComboBox x:Name="UpdateChannel" DockPanel.Dock="Right" VerticalContentAlignment="Center" Width="90" Margin="5,0,0,0" SelectionChanged="UpdateChannel_SelectionChanged" ToolTip="Select Update Cycle" >
  281. <ComboBoxItem Content="Stable"/>
  282. <ComboBoxItem Content="Pre Release"/>
  283. </ComboBox>
  284. <Button x:Name="UpdateButton" DockPanel.Dock="Right" Content=".." Width="25" Click="UpdateButton_Click" Margin="5,0,0,0"/>
  285. <TextBox x:Name="UpdateLocation" DockPanel.Dock="Left" Margin="5,0,0,0" Background="LightYellow" VerticalContentAlignment="Center" TextChanged="UpdateLocation_TextChanged" />
  286. </DockPanel>-->
  287. <Label Content="Technical Library" Grid.Row="0" Grid.Column="0" VerticalContentAlignment="Center" />
  288. <TextBox x:Name="LibraryLocation" Grid.Row="0" Grid.Column="1" VerticalContentAlignment="Center"
  289. Margin="5,0,0,0" Background="LightYellow" TextChanged="LibraryLocation_TextChanged" />
  290. <Button x:Name="LibraryButton" Grid.Row="0" Grid.Column="2" Content=".." Width="25"
  291. Click="LibraryButton_Click" Margin="5,0,0,0" />
  292. <Label Content="Google API Key" Grid.Row="2" Grid.Column="0" VerticalContentAlignment="Center" />
  293. <TextBox x:Name="GoogleAPIKey" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
  294. VerticalContentAlignment="Center" Margin="5,0,0,0" Background="LightYellow"
  295. TextChanged="GoogleAPIKey_TextChanged" />
  296. <Label Content="Job Prefix" Grid.Row="4" Grid.Column="0" VerticalContentAlignment="Center" />
  297. <TextBox x:Name="JobPrefix" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2"
  298. HorizontalAlignment="Left" Width="150" VerticalContentAlignment="Center" Margin="5,0,0,0"
  299. Background="LightYellow" TextChanged="JobPrefix_TextChanged" CharacterCasing="Upper" />
  300. <Label Content="P/O Prefix" Grid.Row="6" Grid.Column="0" VerticalContentAlignment="Center" />
  301. <TextBox x:Name="PurchaseorderPrefix" Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2"
  302. HorizontalAlignment="Left" Width="150" VerticalContentAlignment="Center" Margin="5,0,0,0"
  303. Background="LightYellow" TextChanged="PurchaseOrderPrefix_TextChanged"
  304. CharacterCasing="Upper" />
  305. </Grid>
  306. </Border>
  307. </Grid>
  308. <DockPanel Grid.Row="3" Grid.ColumnSpan="2">
  309. <Button x:Name="Help" DockPanel.Dock="Left" Content="" Width="35" Height="35"
  310. Padding="5" Click="ShowHelp_OnClick" Margin="0,5,0,0" />
  311. <Button x:Name="AutoDiscover" DockPanel.Dock="Left" Content="Discover" Width="60" Height="35"
  312. Padding="5" Click="AutoDiscover_Click" Margin="5,5,0,0" />
  313. <Button x:Name="AutoUpdate" DockPanel.Dock="Left" Width="35" Height="35" Click="AutoUpdate_Click"
  314. Margin="5,5,0,0" ToolTip="Auto Update Settings" />
  315. <Button x:Name="ExportSettings" DockPanel.Dock="Left" Width="35" Height="35" Padding="5"
  316. Click="Export_Click" Margin="5,5,0,0" ToolTip="Export Settings to File" />
  317. <Button x:Name="ImportSettings" DockPanel.Dock="Left" Width="35" Height="35" Padding="5"
  318. Click="Import_Click" Margin="5,5,0,0" ToolTip="Load Settings from File" />
  319. <Button x:Name="CancelButton" DockPanel.Dock="Right" Content="Cancel" Height="35" Width="80"
  320. Click="CancelButton_Click" Margin="5,5,0,0" />
  321. <Button x:Name="OKButton" DockPanel.Dock="Right" Content="OK" Height="35" Width="80" Click="OKButton_Click"
  322. Margin="5,5,0,0" />
  323. <Label DockPanel.Dock="Left" />
  324. </DockPanel>
  325. </Grid>
  326. </wpf:ThemableWindow>