개정판 fb80055c
컨트롤 추가
KCOM/Controls/FavoritePanel.xaml | ||
---|---|---|
1 |
<UserControl x:Class="KCOM.Controls.FavoritePanel" |
|
2 |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
4 |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
5 |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
6 |
xmlns:local="clr-namespace:KCOM.Controls" |
|
7 |
xmlns:converter="clr-namespace:KCOM.Common.Converter" |
|
8 |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
|
9 |
mc:Ignorable="d" Background="#f1f1f1" |
|
10 |
d:DesignHeight="900" d:DesignWidth="600"> |
|
11 |
<UserControl.Resources> |
|
12 |
<converter:enumStringConverter x:Key="enumStringConverter"/> |
|
13 |
<converter:EnumStringColorConverter x:Key="enumStringColorConverter"/> |
|
14 |
</UserControl.Resources> |
|
15 |
<Grid> |
|
16 |
<Grid.RowDefinitions> |
|
17 |
<RowDefinition Height="Auto"/> |
|
18 |
<RowDefinition Height="*"/> |
|
19 |
</Grid.RowDefinitions> |
|
20 |
<Border BorderThickness="0,0,0,1" BorderBrush="#e6e6e6" Background="#f5f5f5"> |
|
21 |
<Grid Margin="10"> |
|
22 |
<Grid.RowDefinitions> |
|
23 |
<RowDefinition Height="Auto"/> |
|
24 |
<RowDefinition Height="*"/> |
|
25 |
<RowDefinition Height="*"/> |
|
26 |
</Grid.RowDefinitions> |
|
27 |
<StackPanel Margin="1" Orientation="Horizontal"> |
|
28 |
<Image Width="18" Source="/KCOM;component/Resources/Images/MenuImage/tips.png" /> |
|
29 |
<TextBlock Margin="1" |
|
30 |
VerticalAlignment="Center" |
|
31 |
FontWeight="Bold" |
|
32 |
Foreground="#3d3d3d" |
|
33 |
Text="You can use a double click to go to the page!" /> |
|
34 |
<!--Text="Viewing : double Click !! All Markup Favorite items are Read-only" />--> |
|
35 |
|
|
36 |
</StackPanel> |
|
37 |
<Border Grid.Row="1" Margin="0,5" |
|
38 |
BorderBrush="#3d3d3d" |
|
39 |
BorderThickness="0,0,0,0"> |
|
40 |
<Grid> |
|
41 |
<Grid.ColumnDefinitions> |
|
42 |
<ColumnDefinition Width="5*"/> |
|
43 |
<ColumnDefinition Width="5*"/> |
|
44 |
</Grid.ColumnDefinitions> |
|
45 |
<TextBlock Margin="23,5,5,5" HorizontalAlignment="Right" |
|
46 |
VerticalAlignment="Center" |
|
47 |
Text="Select Type :" /> |
|
48 |
<telerik:RadComboBox x:Name="cbState" |
|
49 |
Grid.Column="1" |
|
50 |
HorizontalAlignment="Stretch" |
|
51 |
HorizontalContentAlignment="Center" |
|
52 |
Loaded="cbState_Loaded" |
|
53 |
SelectedIndex="0" |
|
54 |
SelectionChanged="cbState_SelectionChanged" |
|
55 |
telerik:StyleManager.Theme="Office2016" /> |
|
56 |
</Grid> |
|
57 |
</Border> |
|
58 |
<Border Grid.Row="2" Margin="0,5" |
|
59 |
BorderBrush="#3d3d3d" |
|
60 |
BorderThickness="0,0,0,0"> |
|
61 |
<Grid> |
|
62 |
<Grid.ColumnDefinitions> |
|
63 |
<ColumnDefinition Width="Auto"/> |
|
64 |
<ColumnDefinition Width="*"/> |
|
65 |
</Grid.ColumnDefinitions> |
|
66 |
|
|
67 |
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="1"> |
|
68 |
<telerik:RadButton Content="ADD" Padding="5" Background="#3d3d3d" Foreground="White" Margin="5,0" MinWidth="60" x:Name="btnFavoriteReg" Click="FavoriteInternel_Save"/> |
|
69 |
<telerik:RadButton Content="EDIT" Padding="5" Background="#3d3d3d" Foreground="White" Margin="5,0" MinWidth="60" x:Name="btnFavoriteEdit" Click="FavoriteInternel_Edit"/> |
|
70 |
<telerik:RadButton Content="DELETE" Padding="5" Background="#3d3d3d" Foreground="White" Margin="5,0,0,0" MinWidth="60" x:Name="btnFavoriteDel" Click="FavoriteInternel_Del"/> |
|
71 |
</StackPanel> |
|
72 |
</Grid> |
|
73 |
</Border> |
|
74 |
</Grid> |
|
75 |
</Border> |
|
76 |
<telerik:RadListBox x:Name="lstFavoriteInternal" BorderThickness="0" FontSize="10" ItemsSource="{Binding FavoriteSet}" Margin="0,0" Grid.Row="1" |
|
77 |
Background="#f1f1f1" ScrollViewer.VerticalScrollBarVisibility="Visible" VerticalContentAlignment="Stretch" VerticalAlignment="Stretch" |
|
78 |
ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectedIndex="1" telerik:StyleManager.Theme="Office2013"> |
|
79 |
<telerik:RadListBox.Resources> |
|
80 |
<Style TargetType="telerik:RadListBoxItem"> |
|
81 |
<Setter Property="Template"> |
|
82 |
<Setter.Value> |
|
83 |
<ControlTemplate TargetType="telerik:RadListBoxItem"> |
|
84 |
<Border Name="Border" Padding="2" SnapsToDevicePixels="True"> |
|
85 |
<ContentPresenter/> |
|
86 |
</Border> |
|
87 |
<ControlTemplate.Triggers> |
|
88 |
<Trigger Property="IsSelected" Value="true"> |
|
89 |
<!--<Setter TargetName="Border" Property="Background" |
|
90 |
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>--> |
|
91 |
<Setter TargetName="Border" Property="Background" |
|
92 |
Value="#FFFFFF"/> |
|
93 |
<Setter TargetName="Border" Property="BorderThickness" Value="1"/> |
|
94 |
<Setter TargetName="Border" Property="BorderBrush" Value="#3d3d3d"/> |
|
95 |
</Trigger> |
|
96 |
</ControlTemplate.Triggers> |
|
97 |
</ControlTemplate> |
|
98 |
</Setter.Value> |
|
99 |
</Setter> |
|
100 |
</Style> |
|
101 |
</telerik:RadListBox.Resources> |
|
102 |
<telerik:RadListBox.ItemTemplate> |
|
103 |
<DataTemplate> |
|
104 |
<Grid MouseLeftButtonDown="lstFavoriteInternal_ItemDoubleClickEvent" Margin="0,5" Background="White"> |
|
105 |
<Grid.RowDefinitions> |
|
106 |
<RowDefinition Height="30"/> |
|
107 |
<RowDefinition Height="Auto"/> |
|
108 |
</Grid.RowDefinitions> |
|
109 |
<Border Grid.Row="0" Background="{Binding FLAG, Converter={StaticResource enumStringColorConverter}}"> |
|
110 |
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> |
|
111 |
<TextBlock Text="{Binding FLAG, Converter={StaticResource enumStringConverter}}" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" |
|
112 |
FontSize="12"/> |
|
113 |
<!--<TextBlock Text=" / " Foreground="White" FontWeight="Bold" VerticalAlignment="Center" FontSize="12"/> |
|
114 |
<TextBlock Text="{Binding PAGE_NO, StringFormat={}{0} Page}" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" FontSize="12"/>--> |
|
115 |
</StackPanel> |
|
116 |
</Border> |
|
117 |
|
|
118 |
<Grid Grid.Row="1" Margin="5"> |
|
119 |
<Grid.RowDefinitions> |
|
120 |
<RowDefinition/> |
|
121 |
<RowDefinition/> |
|
122 |
<RowDefinition/> |
|
123 |
<RowDefinition/> |
|
124 |
</Grid.RowDefinitions> |
|
125 |
<StackPanel Orientation="Horizontal"> |
|
126 |
<!--<TextBlock Text="Doc No : " FontWeight="SemiBold" FontSize="12"/> |
|
127 |
<TextBlock Text="{Binding DOCUMENT_NO}" Margin="5,0" FontSize="12"/>--> |
|
128 |
</StackPanel> |
|
129 |
<Grid Grid.Row="1" Margin="2,5"> |
|
130 |
<Grid.ColumnDefinitions> |
|
131 |
<ColumnDefinition/> |
|
132 |
<ColumnDefinition/> |
|
133 |
<ColumnDefinition/> |
|
134 |
<ColumnDefinition/> |
|
135 |
</Grid.ColumnDefinitions> |
|
136 |
<TextBlock Text="Page No : " FontWeight="SemiBold" Grid.Column="0" FontSize="12"/> |
|
137 |
<TextBlock Text="{Binding PAGE_NO}" Margin="5,0" Grid.Column="1" FontSize="12" /> |
|
138 |
<TextBlock Text="Rev No : " FontWeight="SemiBold" Grid.Column="2" FontSize="12"/> |
|
139 |
<TextBlock Text="{Binding REVISION}" Margin="5,0" Grid.Column="3" FontSize="12"/> |
|
140 |
</Grid> |
|
141 |
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="2,5"> |
|
142 |
<TextBlock Text="Description : " FontWeight="SemiBold" FontSize="12"/> |
|
143 |
</StackPanel> |
|
144 |
<TextBox Text="{Binding DESCRIPTION}" Margin="2,5" FontSize="12" Grid.Row="3" ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
|
145 |
TextWrapping="WrapWithOverflow" BorderThickness="0" Background="Transparent" Foreground="Black" IsHitTestVisible="False"/> |
|
146 |
</Grid> |
|
147 |
</Grid> |
|
148 |
<!--<Grid MouseLeftButtonDown="lstFavoriteInternal_ItemDoubleClickEvent" Margin="0,5"> |
|
149 |
<Grid.RowDefinitions> |
|
150 |
<RowDefinition Height="5*"/> |
|
151 |
<RowDefinition Height="5*"/> |
|
152 |
</Grid.RowDefinitions> |
|
153 |
<Border Grid.Row="0" Margin="5" BorderBrush="#3d3d3d" BorderThickness="0.5"> |
|
154 |
<Grid> |
|
155 |
<Grid.ColumnDefinitions> |
|
156 |
<ColumnDefinition Width="5*"/> |
|
157 |
<ColumnDefinition Width="5*"/> |
|
158 |
</Grid.ColumnDefinitions> |
|
159 |
<Grid.RowDefinitions> |
|
160 |
<RowDefinition Height="*"/> |
|
161 |
</Grid.RowDefinitions> |
|
162 |
<Border> |
|
163 |
<Grid> |
|
164 |
<Grid.RowDefinitions> |
|
165 |
<RowDefinition /> |
|
166 |
<RowDefinition /> |
|
167 |
<RowDefinition /> |
|
168 |
<RowDefinition Height="Auto" /> |
|
169 |
</Grid.RowDefinitions> |
|
170 |
<Grid.ColumnDefinitions> |
|
171 |
<ColumnDefinition Width="Auto" /> |
|
172 |
<ColumnDefinition /> |
|
173 |
</Grid.ColumnDefinitions> |
|
174 |
<TextBlock Margin="3" |
|
175 |
VerticalAlignment="Center" |
|
176 |
Foreground="#0094FF" |
|
177 |
Text="Project" /> |
|
178 |
<TextBlock Grid.Row="1" |
|
179 |
Margin="3" |
|
180 |
VerticalAlignment="Center" |
|
181 |
Foreground="#0094FF" |
|
182 |
Text="SLIP" /> |
|
183 |
<TextBlock Grid.Row="2" |
|
184 |
Margin="3" |
|
185 |
VerticalAlignment="Center" |
|
186 |
Foreground="#0094FF" |
|
187 |
Text="VP" /> |
|
188 |
<TextBlock Grid.Column="1" |
|
189 |
Margin="0,0,0,0" |
|
190 |
VerticalAlignment="Center" |
|
191 |
Foreground="#3d3d3d" |
|
192 |
Text="{Binding PROJECT_NO}" /> |
|
193 |
<TextBlock Grid.Row="1" |
|
194 |
Grid.Column="1" |
|
195 |
Margin="0,0,0,0" |
|
196 |
VerticalAlignment="Center" |
|
197 |
Foreground="#3d3d3d" |
|
198 |
Text="{Binding GROUP_NO}" /> |
|
199 |
<TextBlock Grid.Row="2" |
|
200 |
Grid.Column="1" |
|
201 |
Margin="0,0,0,0" |
|
202 |
VerticalAlignment="Center" |
|
203 |
Foreground="#3d3d3d" |
|
204 |
Text="{Binding DOCUMENT_NO}" /> |
|
205 |
</Grid> |
|
206 |
</Border> |
|
207 |
<Border Grid.Column="1"> |
|
208 |
<Grid> |
|
209 |
<Grid.RowDefinitions> |
|
210 |
<RowDefinition /> |
|
211 |
<RowDefinition /> |
|
212 |
<RowDefinition /> |
|
213 |
</Grid.RowDefinitions> |
|
214 |
<Grid.ColumnDefinitions> |
|
215 |
<ColumnDefinition Width="Auto" /> |
|
216 |
<ColumnDefinition Width="*" /> |
|
217 |
</Grid.ColumnDefinitions> |
|
218 |
<TextBlock VerticalAlignment="Center" |
|
219 |
Foreground="#0094FF" |
|
220 |
Text="Scope" /> |
|
221 |
<TextBlock Grid.Row="1" |
|
222 |
VerticalAlignment="Center" |
|
223 |
Foreground="#0094FF" |
|
224 |
Text="CreateTime" /> |
|
225 |
--> |
|
226 |
<!-- |
|
227 |
<TextBlock Grid.Row="2" |
|
228 |
VerticalAlignment="Center" |
|
229 |
Foreground="#0094FF" |
|
230 |
Text="REV" /> |
|
231 |
--> |
|
232 |
<!-- |
|
233 |
|
|
234 |
<TextBox Grid.Column="1" |
|
235 |
Margin="0,0,0,0" |
|
236 |
BorderThickness="0" Background="Transparent" |
|
237 |
IsHitTestVisible="False" |
|
238 |
Text="{Binding FLAG, |
|
239 |
Converter={StaticResource enumStringConverter}}" |
|
240 |
TextAlignment="Center" /> |
|
241 |
<TextBlock Grid.Row="1" |
|
242 |
Grid.Column="1" |
|
243 |
Margin="0,0,0,0" |
|
244 |
HorizontalAlignment="Center" |
|
245 |
VerticalAlignment="Center" |
|
246 |
Foreground="#3d3d3d" |
|
247 |
Text="{Binding CREATE_TIME}" /> |
|
248 |
--> |
|
249 |
<!-- |
|
250 |
<TextBlock Grid.Row="2" |
|
251 |
Grid.Column="1" |
|
252 |
Margin="0,0,0,0" |
|
253 |
HorizontalAlignment="Center" |
|
254 |
VerticalAlignment="Center" |
|
255 |
Foreground="#3d3d3d" |
|
256 |
Text="{Binding RevNo}" /> |
|
257 |
--> |
|
258 |
<!-- |
|
259 |
|
|
260 |
<Border Grid.Row="2" Grid.ColumnSpan="2"> |
|
261 |
<Grid> |
|
262 |
<Grid.ColumnDefinitions> |
|
263 |
<ColumnDefinition /> |
|
264 |
<ColumnDefinition /> |
|
265 |
<ColumnDefinition /> |
|
266 |
<ColumnDefinition /> |
|
267 |
</Grid.ColumnDefinitions> |
|
268 |
|
|
269 |
<TextBlock Margin="0,0,0,0" |
|
270 |
VerticalAlignment="Center" |
|
271 |
Foreground="#0094FF" |
|
272 |
Text="REV" /> |
|
273 |
<TextBlock Grid.Column="2" |
|
274 |
Margin="0,0,0,0" |
|
275 |
VerticalAlignment="Center" |
|
276 |
Foreground="#0094FF" |
|
277 |
Text="Page" /> |
|
278 |
<TextBlock Grid.Column="1" |
|
279 |
Margin="0,0,0,0" |
|
280 |
HorizontalAlignment="Left" |
|
281 |
VerticalAlignment="Center" |
|
282 |
Foreground="#3d3d3d" |
|
283 |
Text="{Binding REVISION}" /> |
|
284 |
<TextBlock Grid.Column="3" |
|
285 |
Margin="0,0,0,0" |
|
286 |
HorizontalAlignment="Left" |
|
287 |
VerticalAlignment="Center" |
|
288 |
Foreground="#3d3d3d" |
|
289 |
Text="{Binding PAGE_NO}" /> |
|
290 |
</Grid> |
|
291 |
</Border> |
|
292 |
</Grid> |
|
293 |
</Border> |
|
294 |
</Grid> |
|
295 |
</Border> |
|
296 |
</Grid>--> |
|
297 |
</DataTemplate> |
|
298 |
</telerik:RadListBox.ItemTemplate> |
|
299 |
|
|
300 |
</telerik:RadListBox> |
|
301 |
</Grid> |
|
302 |
</UserControl> |
KCOM/Controls/FavoritePanel.xaml.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Windows; |
|
6 |
using System.Windows.Controls; |
|
7 |
using System.Windows.Data; |
|
8 |
using System.Windows.Documents; |
|
9 |
using System.Windows.Input; |
|
10 |
using System.Windows.Media; |
|
11 |
using System.Windows.Media.Imaging; |
|
12 |
using System.Windows.Navigation; |
|
13 |
using System.Windows.Shapes; |
|
14 |
using System.Data.Entity; |
|
15 |
using Telerik.Windows.Controls; |
|
16 |
using System.Net; |
|
17 |
using KCOM.Common; |
|
18 |
using KCOMDataModel.DataModel; |
|
19 |
|
|
20 |
namespace KCOM.Controls |
|
21 |
{ |
|
22 |
/// <summary> |
|
23 |
/// FavoritePanel.xaml에 대한 상호 작용 논리 |
|
24 |
/// </summary> |
|
25 |
public partial class FavoritePanel : UserControl |
|
26 |
{ |
|
27 |
bool IsLoaded = false; |
|
28 |
public FavoritePanel() |
|
29 |
{ |
|
30 |
InitializeComponent(); |
|
31 |
this.Loaded += FavoritePanel_Loaded; |
|
32 |
|
|
33 |
} |
|
34 |
|
|
35 |
private void FavoritePanel_Loaded(object sender, RoutedEventArgs e) |
|
36 |
{ |
|
37 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetFavoriteVPCompleted += BaseClient_GetFavoriteVPCompleted; |
|
38 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.EditFavoriteVPCompleted += BaseClient_EditFavoriteVPCompleted; |
|
39 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteMarkupCompleted += BaseClient_DeleteMarkupCompleted; |
|
40 |
|
|
41 |
if (!IsLoaded) |
|
42 |
{ |
|
43 |
if (App.ViewInfo != null && App.ViewInfo.ProjectNO != "") |
|
44 |
{ |
|
45 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
|
46 |
//autoSearchSymbol.Visibility = Visibility.Visible; |
|
47 |
} |
|
48 |
else |
|
49 |
{ |
|
50 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.FavoritePane.Visibility = System.Windows.Visibility.Collapsed; |
|
51 |
} |
|
52 |
|
|
53 |
IsLoaded = true; |
|
54 |
} |
|
55 |
|
|
56 |
} |
|
57 |
|
|
58 |
private void BaseClient_DeleteMarkupCompleted(object sender, ServiceDeepView.DeleteMarkupCompletedEventArgs e) |
|
59 |
{ |
|
60 |
if (e.Error == null && e.Result != null) |
|
61 |
{ |
|
62 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
|
63 |
} |
|
64 |
else |
|
65 |
{ |
|
66 |
|
|
67 |
} |
|
68 |
} |
|
69 |
private void BaseClient_EditFavoriteVPCompleted(object sender, ServiceDeepView.EditFavoriteVPCompletedEventArgs e) |
|
70 |
{ |
|
71 |
if (e.Error == null && e.Result != null) |
|
72 |
{ |
|
73 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
|
74 |
} |
|
75 |
} |
|
76 |
|
|
77 |
private void BaseClient_GetFavoriteVPCompleted(object sender, ServiceDeepView.GetFavoriteVPCompletedEventArgs e) |
|
78 |
{ |
|
79 |
if (e.Error == null && e.Result != null) |
|
80 |
{ |
|
81 |
ViewerDataModel.Instance.FavoriteSelctedSet = e.Result; |
|
82 |
ViewerDataModel.Instance.FavoriteSet = ViewerDataModel.Instance.FavoriteSelctedSet; |
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
if (cbState.SelectedIndex != 0 && cbState.SelectedIndex > 0) |
|
87 |
{ |
|
88 |
ViewerDataModel.Instance.FavoriteSet = ViewerDataModel.Instance.FavoriteSelctedSet.Where(data => data.FLAG == cbState.SelectedIndex - 1).ToList(); |
|
89 |
} |
|
90 |
|
|
91 |
lstFavoriteInternal.ItemsSource = ViewerDataModel.Instance.FavoriteSet; |
|
92 |
|
|
93 |
var InVp = ViewerDataModel.Instance.FavoriteSet.Where(data => data.PROJECT_NO == App.ViewInfo.ProjectNO && data.DOCUMENT_ID == App.ViewInfo.DocumentItemID).ToList(); |
|
94 |
if (InVp.Count() > 0) |
|
95 |
{ |
|
96 |
|
|
97 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator._FavoriteSet = InVp; |
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
|
|
102 |
private void cbState_Loaded(object sender, RoutedEventArgs e) |
|
103 |
{ |
|
104 |
cbState.Items.Clear(); |
|
105 |
Type typeFavorite = typeof(IKCOM.FAVORITE_FLAG); |
|
106 |
System.Reflection.FieldInfo[] arrFavoriteValues = typeFavorite.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); |
|
107 |
|
|
108 |
//cbState.Items.Add("All"); |
|
109 |
foreach (var item in arrFavoriteValues) |
|
110 |
{ |
|
111 |
cbState.Items.Add(item.GetValue(null).ToString()); |
|
112 |
} |
|
113 |
cbState.SelectedIndex = 0; |
|
114 |
} |
|
115 |
|
|
116 |
private void cbState_SelectionChanged(object sender, SelectionChangedEventArgs e) |
|
117 |
{ |
|
118 |
if (cbState.SelectedItem != null) |
|
119 |
{ |
|
120 |
|
|
121 |
if (cbState.SelectedItem.ToString() == IKCOM.FAVORITE_FLAG.ALL.ToString()) |
|
122 |
{ |
|
123 |
Common.ViewerDataModel.Instance.FavoriteSet = Common.ViewerDataModel.Instance.FavoriteSelctedSet; |
|
124 |
|
|
125 |
} |
|
126 |
else |
|
127 |
{ |
|
128 |
//Common.ViewerDataModel.Instance.FavoriteSet = Common.ViewerDataModel.Instance.FavoriteSelctedSet.Where(data => data.FLAG == cbState.SelectedIndex - 1).ToList(); |
|
129 |
Common.ViewerDataModel.Instance.FavoriteSet = Common.ViewerDataModel.Instance.FavoriteSelctedSet.Where(data => data.FLAG == cbState.SelectedIndex).ToList(); |
|
130 |
} |
|
131 |
lstFavoriteInternal.ItemsSource = ViewerDataModel.Instance.FavoriteSet; |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
135 |
private void lstFavoriteInternal_ItemDoubleClickEvent(object sender, MouseButtonEventArgs e) |
|
136 |
{ |
|
137 |
if (e.ClickCount == 2) |
|
138 |
{ |
|
139 |
FAVORITE_DOC instanceFavoVP = lstFavoriteInternal.SelectedItem as FAVORITE_DOC; |
|
140 |
|
|
141 |
//if (instanceFavoVP.PROJECT_NO == App.ViewInfo.ProjectNO && instanceFavoVP.DOCUMENT_ID == App.ViewInfo.DocumentItemID) |
|
142 |
//{ |
|
143 |
if (instanceFavoVP.PAGE_NO == Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber) |
|
144 |
{ |
|
145 |
Common.ViewerDataModel.Instance.SystemMain.DialogMessage_Alert("You have selected the current page", "Notice"); |
|
146 |
} |
|
147 |
else |
|
148 |
{ |
|
149 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(instanceFavoVP.PAGE_NO); |
|
150 |
} |
|
151 |
//} |
|
152 |
|
|
153 |
//else |
|
154 |
//{ |
|
155 |
// System.Diagnostics.Process.Start("kcom://eyJEb2N1bWVudEl0ZW1JRCI6IjMwMDAwMTc3IiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJhZG1pbiIsIk1vZGUiOjB9"); |
|
156 |
// //var chagePath = System.Windows.Browser.HtmlPage.Document.DocumentUri.AbsoluteUri.ToString(); |
|
157 |
// //var parameterCheck = chagePath.Split('&'); |
|
158 |
|
|
159 |
// //var export_ProjectNo = parameterCheck.Where(data => data.Contains("ProjectNo")).FirstOrDefault(); |
|
160 |
// //var export_UserID = parameterCheck.Where(data => data.Contains("UserID")).FirstOrDefault(); |
|
161 |
// //var export_SharepointItemID = parameterCheck.Where(data => data.Contains("SharepointItemID")).FirstOrDefault(); |
|
162 |
// //var export_bNewCommentPermission = parameterCheck.Where(data => data.Contains("bNewCommentPermission")).FirstOrDefault(); |
|
163 |
// //var export_bCreatFinalPDFPermission = parameterCheck.Where(data => data.Contains("bCreatFinalPDFPermission")).FirstOrDefault(); |
|
164 |
|
|
165 |
// //chagePath = chagePath.Replace(export_ProjectNo, "ProjectNo=" + instanceFavoVP.ProjectNo); |
|
166 |
// //chagePath = chagePath.Replace(export_UserID, "UserID=" + instanceFavoVP.CreateUserID); |
|
167 |
// //chagePath = chagePath.Replace(export_SharepointItemID, "SharepointItemID=" + instanceFavoVP.SharepointItemID + "_" + instanceFavoVP.PageNo); |
|
168 |
// //chagePath = chagePath.Replace(export_bNewCommentPermission, "bNewCommentPermission=false"); |
|
169 |
// //chagePath = chagePath.Replace(export_bCreatFinalPDFPermission, "bCreatFinalPDFPermission=false"); |
|
170 |
|
|
171 |
// //System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(chagePath), "_blank"); |
|
172 |
//} |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
176 |
public void FavoriteInternel_Edit(object sen, RoutedEventArgs e) |
|
177 |
{ |
|
178 |
if (lstFavoriteInternal.SelectedItem != null) |
|
179 |
{ |
|
180 |
FAVORITE_DOC favoInstance = lstFavoriteInternal.SelectedItem as FAVORITE_DOC; |
|
181 |
if (App.ViewInfo.UserID.ToLower() == favoInstance.MEMBER_USER_ID.ToLower()) |
|
182 |
{ |
|
183 |
addToFavoriteWindow_Internal addFavorite = new addToFavoriteWindow_Internal(favoInstance); |
|
184 |
addFavorite.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
|
185 |
addFavorite.Topmost = true; |
|
186 |
addFavorite.Show(); |
|
187 |
addFavorite.Closed += (s, eargs) => |
|
188 |
{ |
|
189 |
if (addFavorite.DialogResult == true) |
|
190 |
{ |
|
191 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
|
192 |
} |
|
193 |
}; |
|
194 |
} |
|
195 |
else |
|
196 |
{ |
|
197 |
Common.ViewerDataModel.Instance.SystemMain.DialogMessage_Alert("You are not item creator", "Notice"); |
|
198 |
} |
|
199 |
} |
|
200 |
//if (lstFavoriteInternal.SelectedItem != null) |
|
201 |
//{ |
|
202 |
// ServiceDeepView.FavoriteVP favoInstance = lstFavoriteInternal.SelectedItem as ServiceDeepView.FavoriteVP; |
|
203 |
|
|
204 |
|
|
205 |
// if (App.ViewInfo.UserID.ToLower() == favoInstance.CreateUserID) |
|
206 |
// { |
|
207 |
// editToFavoriteWindow_Internal editFavorite = new editToFavoriteWindow_Internal(BaseClient, favoInstance); |
|
208 |
|
|
209 |
// editFavorite.Show(); |
|
210 |
// editFavorite.Closed += (s, eargs) => |
|
211 |
// { |
|
212 |
// if (editFavorite.DialogResult == true) |
|
213 |
// { |
|
214 |
// BaseClient_SaveLoad.GetFavoriteVPAsync(_ViewInfo.ProjectNO, _ViewInfo.UserID, _ViewInfo.SharepointItemID); |
|
215 |
// } |
|
216 |
// }; |
|
217 |
// } |
|
218 |
// else |
|
219 |
// { |
|
220 |
// this.ParentOfType<MainWindow>().DialogMessage_Alert("You are not item creator", "Warning"); |
|
221 |
// } |
|
222 |
//} |
|
223 |
} |
|
224 |
|
|
225 |
|
|
226 |
|
|
227 |
public void FavoriteInternel_Del(object sen, RoutedEventArgs e) |
|
228 |
{ |
|
229 |
if (lstFavoriteInternal.SelectedItem != null) |
|
230 |
{ |
|
231 |
FAVORITE_DOC favoInstance = lstFavoriteInternal.SelectedItem as FAVORITE_DOC; |
|
232 |
//BaseClient_SaveLoad.DelFavoriteVPAsync(_ViewInfo.ProjectNO, _ViewInfo.UserID, pageNavigator.CurrentPage.PageNumber, |
|
233 |
// _VendorItem.sharepoint_itemid, |
|
234 |
|
|
235 |
|
|
236 |
if (favoInstance.MEMBER_USER_ID == App.ViewInfo.UserID) |
|
237 |
{ |
|
238 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DelFavoriteVPAsync(favoInstance.PROJECT_NO, favoInstance.MEMBER_USER_ID, favoInstance.PAGE_NO, |
|
239 |
favoInstance.ID); |
|
240 |
} |
|
241 |
else |
|
242 |
{ |
|
243 |
Common.ViewerDataModel.Instance.SystemMain.DialogMessage_Alert("You are not item creator", "Notice"); |
|
244 |
} |
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
|
|
249 |
//BaseClient_SaveLoad(_ViewInfo.ProjectNO, _ViewInfo.UserID); |
|
250 |
} |
|
251 |
} |
|
252 |
|
|
253 |
public void FavoriteInternel_Save(object sen, RoutedEventArgs e) |
|
254 |
{ |
|
255 |
|
|
256 |
addToFavoriteWindow_Internal addFavorite = new addToFavoriteWindow_Internal(null, cbState.SelectedIndex); |
|
257 |
addFavorite.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
|
258 |
addFavorite.Topmost = true; |
|
259 |
addFavorite.Show(); |
|
260 |
addFavorite.Closed += (s, eargs) => |
|
261 |
{ |
|
262 |
if (addFavorite.DialogResult == true) |
|
263 |
{ |
|
264 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
|
265 |
} |
|
266 |
}; |
|
267 |
} |
|
268 |
} |
|
269 |
} |
KCOM/Controls/addToFavoriteWindow_Internal.xaml | ||
---|---|---|
1 |
<Window x:Class="KCOM.Controls.addToFavoriteWindow_Internal" |
|
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:local="clr-namespace:KCOM.Controls" |
|
7 |
mc:Ignorable="d" |
|
8 |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
|
9 |
Title="Add to Favorite" Height="300" Width="400"> |
|
10 |
<Window.Resources> |
|
11 |
<SolidColorBrush x:Key="baseColor" Color="#3597C8" /> |
|
12 |
</Window.Resources> |
|
13 |
<Grid x:Name="LayoutRoot" Margin="2"> |
|
14 |
<Grid.RowDefinitions> |
|
15 |
<RowDefinition /> |
|
16 |
<RowDefinition Height="Auto" /> |
|
17 |
</Grid.RowDefinitions> |
|
18 |
|
|
19 |
<Border Margin="5"> |
|
20 |
<Grid> |
|
21 |
<Grid.ColumnDefinitions> |
|
22 |
<ColumnDefinition Width="Auto" /> |
|
23 |
<ColumnDefinition Width="*" /> |
|
24 |
</Grid.ColumnDefinitions> |
|
25 |
<Grid.RowDefinitions> |
|
26 |
<RowDefinition Height="30" /> |
|
27 |
<RowDefinition Height="*" /> |
|
28 |
</Grid.RowDefinitions> |
|
29 |
<TextBlock HorizontalAlignment="Center" |
|
30 |
VerticalAlignment="Center" |
|
31 |
FontSize="10" Margin="5,0,0,0" |
|
32 |
FontWeight="Bold" |
|
33 |
Text="FAVORITE TYPE" /> |
|
34 |
<telerik:RadComboBox x:Name="cbState" |
|
35 |
Grid.Column="1" |
|
36 |
Width="200" Margin="5,0,0,0" |
|
37 |
HorizontalAlignment="Left" |
|
38 |
ItemsSource="{Binding Favorites, |
|
39 |
Mode=TwoWay}" |
|
40 |
SelectedIndex="0" |
|
41 |
telerik:StyleManager.Theme="Windows8" /> |
|
42 |
|
|
43 |
<TextBlock Grid.Row="2" |
|
44 |
Grid.ColumnSpan="2" |
|
45 |
Margin="5" |
|
46 |
HorizontalAlignment="Left" |
|
47 |
VerticalAlignment="Top" |
|
48 |
FontSize="10" |
|
49 |
FontWeight="SemiBold" |
|
50 |
Text="DESCRIPTION" /> |
|
51 |
|
|
52 |
<TextBox x:Name="tbDescription" |
|
53 |
Grid.Row="1" |
|
54 |
Grid.ColumnSpan="2" |
|
55 |
Margin="5,30,5,5" |
|
56 |
AcceptsReturn="True" |
|
57 |
Background="#FFF9F9F9" |
|
58 |
BorderThickness="0.8" |
|
59 |
Foreground="#3d3d3d" VerticalContentAlignment="Top" |
|
60 |
TextWrapping="Wrap" BorderBrush="#FFD8D8D8" /> |
|
61 |
</Grid> |
|
62 |
</Border> |
|
63 |
<telerik:RadButton Grid.Row="1" |
|
64 |
Height="30" |
|
65 |
Margin="10" x:Name="btnOK" |
|
66 |
HorizontalAlignment="Right" |
|
67 |
Background="#3d3d3d" |
|
68 |
Click="OKButton_Click" |
|
69 |
Content="REGISTER" |
|
70 |
FontWeight="Black" |
|
71 |
Foreground="White" |
|
72 |
Padding="30,0,30,0" |
|
73 |
telerik:StyleManager.Theme="Office2016" /> |
|
74 |
</Grid> |
|
75 |
</Window> |
KCOM/Controls/addToFavoriteWindow_Internal.xaml.cs | ||
---|---|---|
1 |
using IKCOM; |
|
2 |
using KCOMDataModel.DataModel; |
|
3 |
using System; |
|
4 |
using System.Collections.Generic; |
|
5 |
using System.Collections.ObjectModel; |
|
6 |
using System.Linq; |
|
7 |
using System.Reflection; |
|
8 |
using System.Text; |
|
9 |
using System.Windows; |
|
10 |
using System.Windows.Controls; |
|
11 |
using System.Windows.Data; |
|
12 |
using System.Windows.Documents; |
|
13 |
using System.Windows.Input; |
|
14 |
using System.Windows.Media; |
|
15 |
using System.Windows.Media.Imaging; |
|
16 |
using System.Windows.Shapes; |
|
17 |
|
|
18 |
namespace KCOM.Controls |
|
19 |
{ |
|
20 |
/// <summary> |
|
21 |
/// addToFavoriteWindow_Internal.xaml에 대한 상호 작용 논리 |
|
22 |
/// </summary> |
|
23 |
public partial class addToFavoriteWindow_Internal : Window |
|
24 |
{ |
|
25 |
int _typeIdx { get; set; } |
|
26 |
bool IsEditMode { get; set; } |
|
27 |
FAVORITE_DOC instanceDoc { get; set; } |
|
28 |
private ObservableCollection<string> _Favorites { get; set; } |
|
29 |
public ObservableCollection<string> Favorites |
|
30 |
{ |
|
31 |
get |
|
32 |
{ |
|
33 |
return _Favorites; |
|
34 |
} |
|
35 |
set |
|
36 |
{ |
|
37 |
_Favorites = value; |
|
38 |
} |
|
39 |
} |
|
40 |
|
|
41 |
public addToFavoriteWindow_Internal(FAVORITE_DOC item, int typeIdx = 1) |
|
42 |
{ |
|
43 |
InitializeComponent(); |
|
44 |
if (item != null) |
|
45 |
{ |
|
46 |
instanceDoc = item; |
|
47 |
IsEditMode = true; |
|
48 |
} |
|
49 |
this.Loaded += AddToFavoriteWindow_Internal_Loaded; |
|
50 |
} |
|
51 |
|
|
52 |
private void AddToFavoriteWindow_Internal_Loaded(object sender, RoutedEventArgs e) |
|
53 |
{ |
|
54 |
Type typeFavorite = typeof(FAVORITE_FLAG); |
|
55 |
FieldInfo[] arrFavoriteValues = typeFavorite.GetFields(BindingFlags.Public | BindingFlags.Static); |
|
56 |
Favorites = new ObservableCollection<string>(); |
|
57 |
foreach (var item in arrFavoriteValues) |
|
58 |
{ |
|
59 |
Favorites.Add(item.GetValue(null).ToString()); |
|
60 |
} |
|
61 |
|
|
62 |
Favorites.RemoveAt(0); |
|
63 |
this.DataContext = this; |
|
64 |
if (IsEditMode) |
|
65 |
{ |
|
66 |
//instanceDoc |
|
67 |
tbDescription.Text = instanceDoc.DESCRIPTION; |
|
68 |
cbState.SelectedIndex = instanceDoc.FLAG - 1; |
|
69 |
btnOK.Content = "MODIFY"; |
|
70 |
|
|
71 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.EditFavoriteVPCompleted += BaseClient_EditFavoriteVPCompleted; |
|
72 |
} |
|
73 |
else |
|
74 |
{ |
|
75 |
cbState.SelectedIndex = _typeIdx == 2 ? _typeIdx - 1 : _typeIdx; |
|
76 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SetFavoriteVPCompleted += new EventHandler<ServiceDeepView.SetFavoriteVPCompletedEventArgs>(_Client_SetFavoriteVPCompleted); |
|
77 |
} |
|
78 |
tbDescription.Focus(); |
|
79 |
} |
|
80 |
|
|
81 |
private void BaseClient_EditFavoriteVPCompleted(object sender, ServiceDeepView.EditFavoriteVPCompletedEventArgs e) |
|
82 |
{ |
|
83 |
this.Close(); |
|
84 |
} |
|
85 |
|
|
86 |
void _Client_SetFavoriteVPCompleted(object sender, ServiceDeepView.SetFavoriteVPCompletedEventArgs e) |
|
87 |
{ |
|
88 |
if (e.Error != null || !e.Result) |
|
89 |
{ |
|
90 |
//미입력 |
|
91 |
} |
|
92 |
else |
|
93 |
{ |
|
94 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
|
95 |
|
|
96 |
} |
|
97 |
this.Close(); |
|
98 |
} |
|
99 |
|
|
100 |
private void OKButton_Click(object sender, RoutedEventArgs e) |
|
101 |
{ |
|
102 |
if (instanceDoc == null) |
|
103 |
{ |
|
104 |
FAVORITE_FLAG flag = (FAVORITE_FLAG)Enum.Parse(typeof(FAVORITE_FLAG), cbState.Text, true); |
|
105 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.GROUP_NO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.REVISION, |
|
106 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber, App.ViewInfo.DocumentItemID, tbDescription.Text, flag); |
|
107 |
} |
|
108 |
else |
|
109 |
{ |
|
110 |
FAVORITE_FLAG flag = (FAVORITE_FLAG)Enum.Parse(typeof(FAVORITE_FLAG), cbState.Text, true); |
|
111 |
|
|
112 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.EditFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, instanceDoc.ID, Convert.ToInt32(flag), tbDescription.Text); |
|
113 |
} |
|
114 |
} |
|
115 |
} |
|
116 |
} |
KCOM/Controls/editToFavoriteWindow_Internal.xaml | ||
---|---|---|
1 |
<Window x:Class="KCOM.Controls.editToFavoriteWindow_Internal" |
|
2 |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
4 |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
5 |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
6 |
xmlns:local="clr-namespace:KCOM.Controls" |
|
7 |
mc:Ignorable="d" |
|
8 |
d:DesignHeight="450" d:DesignWidth="800" |
|
9 |
Title="editToFavoriteWindow_Internal"> |
|
10 |
|
|
11 |
<Grid> |
|
12 |
|
|
13 |
</Grid> |
|
14 |
</Window> |
KCOM/Controls/editToFavoriteWindow_Internal.xaml.cs | ||
---|---|---|
1 |
using KCOMDataModel.DataModel; |
|
2 |
using System; |
|
3 |
using System.Collections.Generic; |
|
4 |
using System.Linq; |
|
5 |
using System.Text; |
|
6 |
using System.Windows; |
|
7 |
using System.Windows.Controls; |
|
8 |
using System.Windows.Data; |
|
9 |
using System.Windows.Documents; |
|
10 |
using System.Windows.Input; |
|
11 |
using System.Windows.Media; |
|
12 |
using System.Windows.Media.Imaging; |
|
13 |
using System.Windows.Navigation; |
|
14 |
using System.Windows.Shapes; |
|
15 |
|
|
16 |
namespace KCOM.Controls |
|
17 |
{ |
|
18 |
/// <summary> |
|
19 |
/// editToFavoriteWindow_Internal.xaml에 대한 상호 작용 논리 |
|
20 |
/// </summary> |
|
21 |
public partial class editToFavoriteWindow_Internal : Window |
|
22 |
{ |
|
23 |
FAVORITE_DOC favoriteItem { get; set; } |
|
24 |
|
|
25 |
public editToFavoriteWindow_Internal() |
|
26 |
{ |
|
27 |
InitializeComponent(); |
|
28 |
this.Loaded += EditToFavoriteWindow_Internal_Loaded; |
|
29 |
} |
|
30 |
|
|
31 |
private void EditToFavoriteWindow_Internal_Loaded(object sender, RoutedEventArgs e) |
|
32 |
{ |
|
33 |
|
|
34 |
} |
|
35 |
} |
|
36 |
} |
내보내기 Unified diff