프로젝트

일반

사용자정보

개정판 43b2e236

ID43b2e2365f0c1d951345ce47cb0d5e81a408e3c9
상위 604465bd
하위 73cb17e3, 10beebc8

semi 이(가) 약 5년 전에 추가함

ConvertAddDialog DispatcherTimer 주석 후 완료

Change-Id: I18738739e0f43df7504da284fe6c8fdd6962ed1e

차이점 보기:

ConvertService/ServiceBase/Markus.Service.StationController/Markus.Service.StationController.csproj
115 115
      <SpecificVersion>False</SpecificVersion>
116 116
      <HintPath>..\Telerik\Telerik.Windows.Controls.dll</HintPath>
117 117
    </Reference>
118
    <Reference Include="Telerik.Windows.Controls.Docking, Version=2020.1.218.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
119
      <HintPath>C:\Program Files (x86)\Progress\Telerik UI for WPF R1 2020\Binaries\WPF45\Telerik.Windows.Controls.Docking.dll</HintPath>
120
      <Private>True</Private>
121
    </Reference>
118 122
    <Reference Include="Telerik.Windows.Controls.GridView, Version=2019.3.917.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
119 123
      <SpecificVersion>False</SpecificVersion>
120 124
      <HintPath>..\Telerik\Telerik.Windows.Controls.GridView.dll</HintPath>
......
193 197
      <DependentUpon>MarkusModel.tt</DependentUpon>
194 198
    </Compile>
195 199
    <Compile Include="ViewModel\AliveViewModel.cs" />
200
    <Compile Include="ViewModel\ConvertAddDialogViewModel.cs" />
196 201
    <Compile Include="ViewModel\DataBaseByStatusViewModel.cs" />
197 202
    <Compile Include="ViewModel\DataBaseItemsModel.cs" />
198 203
    <Compile Include="ViewModel\MergeDataViewModel.cs" />
199 204
    <Compile Include="ViewModel\MainViewModel.cs" />
200 205
    <Compile Include="ViewModel\TotalStatusViewModel.cs" />
206
    <Compile Include="Views\ConvertAddDialog.xaml.cs">
207
      <DependentUpon>ConvertAddDialog.xaml</DependentUpon>
208
    </Compile>
201 209
    <Compile Include="Views\DataBaseView.xaml.cs">
202 210
      <DependentUpon>DataBaseView.xaml</DependentUpon>
203 211
    </Compile>
......
255 263
      <SubType>Designer</SubType>
256 264
      <Generator>MSBuild:Compile</Generator>
257 265
    </Page>
266
    <Page Include="Views\ConvertAddDialog.xaml">
267
      <Generator>MSBuild:Compile</Generator>
268
      <SubType>Designer</SubType>
269
    </Page>
258 270
    <Page Include="Views\DataBaseView.xaml">
259 271
      <Generator>MSBuild:Compile</Generator>
260 272
      <SubType>Designer</SubType>
ConvertService/ServiceBase/Markus.Service.StationController/MarkusModel.Context.cs
105 105
    
106 106
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<SELECT_RERECONVERT_ITEM_Result>("markusEntities.SELECT_RERECONVERT_ITEM", p_IDParameter, p_RECONVERTERParameter, p_STATUSParameter);
107 107
        }
108
    
109
        public virtual int SELECT_CONVERT_INSERT(string p_ID, string p_PROJECT_NO, string p_DOCUMENT_URL, string p_DOCUMENT_ID)
110
        {
111
            var p_IDParameter = p_ID != null ?
112
                new ObjectParameter("P_ID", p_ID) :
113
                new ObjectParameter("P_ID", typeof(string));
114
    
115
            var p_PROJECT_NOParameter = p_PROJECT_NO != null ?
116
                new ObjectParameter("P_PROJECT_NO", p_PROJECT_NO) :
117
                new ObjectParameter("P_PROJECT_NO", typeof(string));
118
    
119
            var p_DOCUMENT_URLParameter = p_DOCUMENT_URL != null ?
120
                new ObjectParameter("P_DOCUMENT_URL", p_DOCUMENT_URL) :
121
                new ObjectParameter("P_DOCUMENT_URL", typeof(string));
122
    
123
            var p_DOCUMENT_IDParameter = p_DOCUMENT_ID != null ?
124
                new ObjectParameter("P_DOCUMENT_ID", p_DOCUMENT_ID) :
125
                new ObjectParameter("P_DOCUMENT_ID", typeof(string));
126
    
127
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("markusEntities.SELECT_CONVERT_INSERT", p_IDParameter, p_PROJECT_NOParameter, p_DOCUMENT_URLParameter, p_DOCUMENT_IDParameter);
128
        }
108 129
    }
109 130
}
ConvertService/ServiceBase/Markus.Service.StationController/MarkusModel.edmx
5 5
    <!-- SSDL content -->
6 6
    <edmx:StorageModels>
7 7
    <Schema Namespace="markusModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
8
        <Function Name="SELECT_CONVERT_INSERT" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
9
          <Parameter Name="P_ID" Type="nvarchar" Mode="In" />
10
          <Parameter Name="P_PROJECT_NO" Type="nvarchar" Mode="In" />
11
          <Parameter Name="P_DOCUMENT_URL" Type="nvarchar" Mode="In" />
12
          <Parameter Name="P_DOCUMENT_ID" Type="nvarchar" Mode="In" />
13
        </Function>
8 14
        <Function Name="SELECT_CONVERT_ITEM" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
9 15
          <Parameter Name="P_PROJECT_NO" Type="nvarchar" Mode="In" />
10 16
          <Parameter Name="P_DOCUMENT_ID" Type="nvarchar" Mode="In" />
......
53 59
            <Parameter Name="P_RECONVERTER" Mode="In" Type="Int32" />
54 60
            <Parameter Name="P_STATUS" Mode="In" Type="Int32" />
55 61
          </FunctionImport>
62
          <FunctionImport Name="SELECT_CONVERT_INSERT">
63
            <Parameter Name="P_ID" Mode="In" Type="String" />
64
            <Parameter Name="P_PROJECT_NO" Mode="In" Type="String" />
65
            <Parameter Name="P_DOCUMENT_URL" Mode="In" Type="String" />
66
            <Parameter Name="P_DOCUMENT_ID" Mode="In" Type="String" />
67
          </FunctionImport>
56 68
        </EntityContainer>
57 69
        <ComplexType Name="SELECT_CONVERT_ITEM_Result">
58 70
          <Property Type="String" Name="ID" Nullable="false" MaxLength="50" />
......
118 130
              </ComplexTypeMapping>
119 131
            </ResultMapping>
120 132
          </FunctionImportMapping>
133
          <FunctionImportMapping FunctionImportName="SELECT_CONVERT_INSERT" FunctionName="markusModel.Store.SELECT_CONVERT_INSERT" />
121 134
        </EntityContainerMapping>
122 135
      </Mapping>
123 136
    </edmx:Mappings>
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/ConvertAddDialogViewModel.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using Telerik.Windows.Controls;
7
using System.IO;
8
using Microsoft.Win32;
9
using Markus.Service.Extensions;
10
using System.Windows;
11

  
12
namespace Markus.Service.StationController.ViewModel
13
{
14
    class ConvertAddDialogViewModel : Mvvm.ToolKit.ViewModelBase
15
    {
16
        #region Construrtor
17

  
18
        public ConvertAddDialogViewModel()
19
        {
20
            ConverAdd_Select_FoldCommand = new DelegateCommand(ConverAdd_Select_Fold);
21
            ConverAdd_OKCommand = new DelegateCommand(ConverAdd_OK);
22
        }
23

  
24
        #endregion
25

  
26
        #region Propertise
27

  
28
        private string _ConverAdd_Project_NO;
29
        public string ConverAdd_Project_NO
30
        {
31
            get { return _ConverAdd_Project_NO; }
32
            set
33
            {
34
                _ConverAdd_Project_NO = value;
35
                OnPropertyChanged(() => ConverAdd_Project_NO);
36
            }
37
        }
38

  
39
        private string _ConverAdd_DOCUMENT_ID;
40
        public string ConverAdd_DOCUMENT_ID
41
        {
42
            get { return _ConverAdd_DOCUMENT_ID; }
43
            set
44
            {
45
                _ConverAdd_DOCUMENT_ID = value;
46
                OnPropertyChanged(() => ConverAdd_DOCUMENT_ID);
47
            }
48
        }
49

  
50
        private string _ConverAdd_DOCUMENT_URL;
51
        public string ConverAdd_DOCUMENT_URL
52
        {
53
            get { return _ConverAdd_DOCUMENT_URL; }
54
            set
55
            {
56
                _ConverAdd_DOCUMENT_URL = value;
57
                OnPropertyChanged(() => ConverAdd_DOCUMENT_URL);
58
            }
59
        }
60

  
61
        #endregion
62

  
63
        #region Command
64

  
65
        public DelegateCommand ConverAdd_Select_FoldCommand { get; private set; }
66
        public DelegateCommand ConverAdd_OKCommand { get; private set; }
67

  
68
        #endregion
69

  
70
        #region Fuction
71

  
72
        #region ConverAdd_Select_Fold
73

  
74
        /// <summary>
75
        /// 그리드 상단 Conver 추가 버튼에서 Document URL Select Fold 버튼
76
        /// </summary>
77

  
78
        public void ConverAdd_Select_Fold(object obj)
79
        {
80
            //RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
81

  
82
            //openFileDialog.ShowDialog();
83

  
84
            //
85
            SaveFileDialog saveFileDialog = new SaveFileDialog();
86

  
87
            saveFileDialog.FileName = "Document"; // Default file name
88
            saveFileDialog.DefaultExt = ".txt"; // Default file extension
89
            saveFileDialog.Filter = "Word Documents (*.doc)|*.doc|Excel Worksheets (*.xls;*.xlsx)|*.xls;*.xlsx|PowerPoint Presentations (*.ppt)|*.ppt" +
90
                         "|Office Files (*.doc;*.xls;*.ppt)|*.doc;*.xls;*.ppt" +
91
                         "|All Files (*.*)|*.*";
92

  
93

  
94
            if (saveFileDialog.ShowDialog() == true)
95
            {
96

  
97

  
98
                if (!string.IsNullOrWhiteSpace(saveFileDialog.FileName))
99
                {
100
                    ConverAdd_DOCUMENT_URL = saveFileDialog.FileName;
101
                }
102
            }
103
            //
104

  
105
            //        if (openFileDialog.DialogResult == true)
106
            //{
107
            //    try
108
            //    {
109

  
110
            //    }
111
            //    catch (Exception ex)
112
            //    {
113
            //        MessageBox.Show(ex.ToString());
114
            //    }
115
            //}
116

  
117
        }
118
        #endregion
119

  
120
        #region ConverAdd_OK
121
        /// <summary>
122
        /// 그리드 상단 Conver 추가 버튼
123
        /// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 
124
        /// </summary>
125
        public void ConverAdd_OK(object obj)
126
        {
127

  
128
            try
129
            {
130

  
131
                using (markusEntities entities = new markusEntities())
132
                {
133
                    string ConverAdd_ID = GuidExtension.shortGuid();
134
                    var items = entities.SELECT_CONVERT_INSERT(ConverAdd_ID, ConverAdd_Project_NO, ConverAdd_DOCUMENT_URL, ConverAdd_DOCUMENT_ID);
135
                    System.Diagnostics.Debug.WriteLine(items);
136

  
137
                }
138
                MessageBox.Show("데이터베이스에 추가 완료! ");
139
            }
140
            catch (Exception ex)
141
            {
142
                MessageBox.Show(ex.ToString());
143
            }
144
        }
145

  
146
        #endregion
147

  
148

  
149
        #endregion
150
    }
151
}
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs
527 527
        /// </summary>
528 528

  
529 529
        private DispatcherTimer dispatcherTimer;
530
        public override void Loaded()
531
        {
532
            base.Loaded();
533

  
534
            if (!App.IsDesignMode)
535
            {
536
                dispatcherTimer = new DispatcherTimer();
537
                dispatcherTimer.Tick += new EventHandler(Timer_Tick);
538
                dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
539
                dispatcherTimer.Start();
540
            }
541
        }
530
        //public override void Loaded()
531
        //{
532
        //    base.Loaded();
533

  
534
        //    if (!App.IsDesignMode)
535
        //    {
536
        //        dispatcherTimer = new DispatcherTimer();
537
        //        dispatcherTimer.Tick += new EventHandler(Timer_Tick);
538
        //        dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
539
        //        dispatcherTimer.Start();
540
        //    }
541
        //}
542 542

  
543 543
        private async void Timer_Tick(object sender, EventArgs e)
544 544
        {
......
1263 1263

  
1264 1264
        public void ConverAdd(object obj)
1265 1265
        {
1266
            //줄 530줄 load부분 주석 처리하면 잘됨 
1267
            //dispatcherTimer.Stop();
1268

  
1269
            Views.ConvertAddDialog convertAddDialog = new Views.ConvertAddDialog();
1270
            convertAddDialog.ShowDialog();
1266 1271

  
1272
            //dispatcherTimer.Start();
1267 1273
        }
1268 1274

  
1269 1275
        #endregion
ConvertService/ServiceBase/Markus.Service.StationController/Views/ConvertAddDialog.xaml
1
<telerik:RadWindow x:Class="Markus.Service.StationController.Views.ConvertAddDialog"
2
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
5
        xmlns:VM="clr-namespace:Markus.Service.StationController.ViewModel"
6
        Header="Convert Items Insert" Height="300" Width="500" >
7
    <telerik:RadWindow.DataContext>
8
        <VM:ConvertAddDialogViewModel/>
9
    </telerik:RadWindow.DataContext>
10
    <Grid>
11
        <Grid.Resources>
12
            <ResourceDictionary>
13

  
14
                <Style x:Key="InfoStyle" TargetType="{x:Type TextBox}">
15
                    <Setter Property="Margin" Value="5,5,0,0"/>
16
                    <Setter Property="VerticalAlignment" Value="Center"/>
17
                    <Setter Property="Foreground" Value="Black"/>
18
                    <Setter Property="Background" Value="Transparent"/>
19
                    <Setter Property="BorderBrush" Value="Transparent"/>
20
                    <Setter Property="BorderThickness" Value="0"/>
21
                    <Setter Property="IsReadOnly" Value="true"/>
22
                    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
23
                    <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
24
                    <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
25
                    <Setter Property="Template">
26
                        <Setter.Value>
27
                            <ControlTemplate TargetType="{x:Type TextBox}">
28
                                <Border x:Name="Bd" 
29
                    BorderThickness="{TemplateBinding BorderThickness}" 
30
                    SnapsToDevicePixels="true">
31
                                    <ScrollViewer x:Name="PART_ContentHost" BorderThickness="{TemplateBinding BorderThickness}"
32
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
33
                                </Border>
34
                            </ControlTemplate>
35
                        </Setter.Value>
36
                    </Setter>
37
                </Style>
38

  
39
                <Style TargetType="TextBlock">
40
                    <Setter Property="FontFamily" Value="Segoe UI Semibold" />
41
                    <Setter Property="VerticalAlignment" Value="Center" />
42
                    <Setter Property="Foreground" Value="#FF7A7A7A" />
43
                </Style>
44

  
45
                <Style TargetType="TextBox">
46
                    <Setter Property="FontFamily" Value="Segoe UI Semibold" />
47
                    <Setter Property="VerticalAlignment" Value="Center" />
48
                    <Setter Property="Foreground" Value="#FF333333" />
49
                    <Setter Property="BorderBrush" Value="#FFD6D4D4" />
50
                </Style>
51
            </ResourceDictionary>
52
        </Grid.Resources>
53

  
54
        <Grid x:Name="LayoutRoot" Background="White">
55
            <Grid.RowDefinitions>
56
                <RowDefinition />
57
                <RowDefinition Height="Auto" />
58
                <RowDefinition Height="Auto" />
59
            </Grid.RowDefinitions>
60

  
61
            <Grid Grid.Row="0" Margin="10">
62
                <Grid.ColumnDefinitions>
63
                    <ColumnDefinition Width="90" />
64
                    <ColumnDefinition Width="10" />
65
                    <ColumnDefinition />
66
                </Grid.ColumnDefinitions>
67
                <Grid.RowDefinitions>
68
                    <RowDefinition />
69
                    <RowDefinition />
70
                    <RowDefinition />
71
                </Grid.RowDefinitions>
72

  
73
                <TextBlock Grid.Row="0" Text="Project NO" />
74
                <TextBlock Grid.Row="1" Text="DOCUMENT ID" />
75
                <TextBlock Grid.Row="2" Text="Document URL" />
76
 
77
                <TextBox Text="{Binding ConverAdd_Project_NO, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="2" />
78
                <TextBox Text="{Binding ConverAdd_DOCUMENT_ID, Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="2" />
79
                <TextBox Text="{Binding ConverAdd_DOCUMENT_URL,  Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="2" />
80
                <StackPanel Orientation="Horizontal"  Grid.Row="2" Grid.Column="2" Height="30">
81
                    <TextBox Text="{Binding ConverAdd_DOCUMENT_URL, Mode=TwoWay}" Width="270" />
82
                    <telerik:RadButton  Command="{Binding ConverAdd_Select_FoldCommand , Mode=TwoWay}" Width="90" >
83
                        <TextBox Text="Select Folder" Style="{StaticResource InfoStyle}"/>
84
                    </telerik:RadButton>
85
                </StackPanel>
86
                <!--<telerik:RadButton Grid.Row="2" Grid.Column="2" Click="SelectFolderClick" Width="207" Height="20"/>-->
87
                <!--<telerik:RadFilePathPicker Text="{Binding ConverAdd_DOCUMENT_URL, Mode=OneWayToSource}" ShowDialogButtonContent="&#xe11f;" Grid.Row="2" Grid.Column="2" ClearButtonContent="&#xe11d;" />-->
88

  
89
            </Grid>
90
            <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" Margin="0 0 0 10">
91

  
92
                <telerik:RadButton Content=" SEND" MinWidth="50" Margin="8 0" VerticalAlignment="Center"
93
							   Command="{Binding ConverAdd_OKCommand , Mode=TwoWay}" />
94

  
95
                <telerik:RadButton Content="CANCEL" MinWidth="80" Margin="0 0 10 0" VerticalAlignment="Center"
96
							   IsCancel="True" />
97
            </StackPanel>
98

  
99
        </Grid>
100
    </Grid>
101
</telerik:RadWindow>
ConvertService/ServiceBase/Markus.Service.StationController/Views/ConvertAddDialog.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.Shapes;
13

  
14
using Telerik.Windows.Controls;
15

  
16
namespace Markus.Service.StationController.Views
17
{
18
    /// <summary>
19
    /// Interaction logic for ConvertAddDialog1.xaml
20
    /// </summary>
21
    public partial class ConvertAddDialog
22
    {
23
        public ConvertAddDialog()
24
        {
25
            InitializeComponent();
26
        }
27
    }
28
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)