프로젝트

일반

사용자정보

개정판 b63dcfbb

IDb63dcfbb07762fe4064d4368bafc3b5fb0380f89
상위 87d56836
하위 bf5f463c, 5b372dc6

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

markusEntities 추가

Change-Id: Iac863d0665e1d7e6ef8ceb0f709348cfb30966a2

차이점 보기:

ConvertService/ServiceBase/IServiceBase/ConvertItem.cs
99 99
            this._FileName = result;
100 100
        }
101 101

  
102
        //public ConvertItem(string key, string ProjectNo, string ID, string originfilePath, string convertPath, string Status, int currentPageNo, int totalPage, string exception
103
        //    ,string revision, string documentNo, string documentName, string groupName)
104
        //{//세미
105
        //    this._uniqueKey = key;
106
        //    this._projectNumber = ProjectNo;
107
        //    this._convertID = ID;
108
        //    this._originfilePath = originfilePath;
109
        //    this._convertPath = convertPath;
110
        //    this._convertState = Status;
111
        //    this._currentPageNo = currentPageNo;
112
        //    this._totalPage = totalPage;
113
        //    this._exception = exception;
114
        //    this._revision = revision;
115
        //    this._documentNo = documentNo;
116
        //    this._docuemnt_Name = documentName;
117
        //    this._GroupName = groupName;
118

  
119
        //    string result = "";
120
        //    if (originfilePath.Contains("/"))
121
        //    {
122
        //        result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
123
        //    }
124
        //    else
125
        //    {
126
        //        result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
127
        //    }
128
        //    this._FileName = result;
129
        //}
102
        //DataSearch 상단 그리드 Search 
103
        public ConvertItem(string ConvertId ,string ProjectNo, int Status, string documentID, string documentName, string documentNo, string document_URL, string revision, int currentPageNo, int totalPage, string exception, string groupNo)
104
        {//세미
105
            ConvertID = ConvertId;
106
            ProjectNumber = ProjectNo;
107
            ConvertState = (StatusCodeType)Status;
108
            DocumentID = documentID;
109
            DocumnetName = documentName;
110
            DocumnetNo = documentNo;
111
            DocumnetURL = document_URL;
112
            Revision = revision;
113
            CurrentPageNo = currentPageNo;
114
            TotalPage = totalPage;
115
            Exception = exception;
116
            GroupNo = groupNo;
117
        }
130 118

  
131 119

  
132 120
        string _uniqueKey;
......
146 134
        string _docuemnt_Name;
147 135
        string _GroupName;
148 136
        string _documentID;
137
        string _documentURL;
149 138
        string _validation;
150 139
        string _MarkusLink;
151 140

  
......
491 480
        }
492 481

  
493 482
        [DataMember]
483
        public string DocumnetURL
484
        {
485
            get
486
            {
487
                return _documentURL;
488
            }
489
            set
490
            {
491
                if (_documentURL != value)
492
                {
493
                    _documentURL = value;
494
                    OnPropertyChanged("_documentURL");
495

  
496
                }
497
            }
498
        }
499

  
500
            
501

  
502
        [DataMember]
494 503
        public string GroupNo
495 504
        {
496 505
            get
ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs
77 77
        /// <summary>
78 78
        /// 상단 그리드 선택된 Status에 따라 DB에서 값 가져온다.
79 79
        /// </summary>
80
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(int status,string ProjectNumberFilter, string UniqueKeyFilter, string Docuemnt_NameFilter, string Service_IDFilter, string Docuemnt_NOFilter, int? ReconverterFilter
81
            , string RevisionFilter)
82
        {
83
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
84
            var query = from items in entities.CONVERTER_DOC
85
                        join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
86
                        from subpet in GroupItems.DefaultIfEmpty()
87
                        where items.STATUS == status &&
88
                        //
89
                        (
90
                         items.PROJECT_NO.Contains(ProjectNumberFilter)
91
                         || subpet.DOCUMENT_NAME.Contains(Docuemnt_NameFilter)
92
                         || items.SERVICE_ID.Contains(Service_IDFilter)
93
                         || subpet.ID.Contains(UniqueKeyFilter)
94
                         || subpet.DOCUMENT_NO.Contains(Docuemnt_NOFilter)
95
                         || items.RECONVERTER == ReconverterFilter
96
                         || subpet.REVISION.Contains(RevisionFilter)
97
                         )
98
                       //
99
                        orderby items.CREATE_DATETIME descending
100
                        select new
101
                        {
102
                            ID = items.ID,
103
                            DOCUMENT_URL = items.DOCUMENT_URL,
104
                            RECONVERTER = items.RECONVERTER,
105
                            SERVICE_ID = items.SERVICE_ID,
106
                            STATUS = items.STATUS,
107
                            CREATE_DATETIME = items.CREATE_DATETIME,
108
                            START_DATETIME = items.START_DATETIME,
109
                            END_DATETIME = items.END_DATETIME,
110
                            TOTAL_PAGE = items.TOTAL_PAGE,
111
                            CURRENT_PAGE = items.CURRENT_PAGE,
112
                            EXCEPTION = items.EXCEPTION,
113
                            PROJECT_NO = items.PROJECT_NO,
114
                            DOCUMENT_ID = items.DOCUMENT_ID,
115
                            REVISION = subpet.REVISION,
116
                            DOCUMENT_NO = subpet.DOCUMENT_NO,
117
                            DOCUMENT_NAME = subpet.DOCUMENT_NAME,
118
                            GROUP_NO = subpet.GROUP_NO,
119
                        };
120

  
121
            if (query.Count() > 0)//세미
122
            {
123
                foreach (var item in query)
124
                {
125
                    Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
126
                    {
127

  
128
                        ReConverter = item.RECONVERTER,
129
                        ServiceID = item.SERVICE_ID,
130
                        ConvertState = (StatusCodeType)item.STATUS,
131
                        CreateTime = item.CREATE_DATETIME,
132
                        StartTime = (DateTime)item.START_DATETIME,
133
                        EndTime = (DateTime)item.END_DATETIME,
134
                        TotalPage = item.TOTAL_PAGE,
135
                        CurrentPageNo = item.CURRENT_PAGE,
136
                        Exception = item.EXCEPTION,
137
                        ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
138

  
139
                        Revision = item.REVISION,
140
                        DocumnetNo = item.DOCUMENT_NO,
141
                        DocumnetName = item.DOCUMENT_NAME,
142
                        GroupNo = item.GROUP_NO,
143
                        DocumentID = item.DOCUMENT_ID,
144

  
145
                        MarkusLink = "kcom://" + Markus.Service.DataBase.Extensions.MarkusAPI.CreateMarkusParam(item.PROJECT_NO, item.DOCUMENT_ID, "doftech")
146
                    };
147
                    convertItems.Add(convertitem);
148
                }
149
            }
150
            return convertItems;
151

  
152
        }
153

  
80 154
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(int status)
81 155
        {
82 156
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
......
84 158
                        join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
85 159
                        from subpet in GroupItems.DefaultIfEmpty()
86 160
                        where items.STATUS == status
87
                         orderby items.CREATE_DATETIME descending
161
                        orderby items.CREATE_DATETIME descending
88 162
                        select new
89 163
                        {
90 164
                            ID = items.ID,
ConvertService/ServiceBase/Markus.Service.StationController/App.config
4 4
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
5 5
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
6 6
  </configSections>
7
  <connectionStrings />
7
  <connectionStrings>
8
    <add name="markusEntities" connectionString="metadata=res://*/MarkusModel.csdl|res://*/MarkusModel.ssdl|res://*/MarkusModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.0.67;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
9
  </connectionStrings>
8 10
  <startup>
9 11
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
10 12
  </startup>
ConvertService/ServiceBase/Markus.Service.StationController/Controls/DatabaseFilter.xaml
1
<UserControl x:Name="userControl" x:Class="Markus.Service.StationController.Controls.DatabaseFilter"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
6
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
7
      xmlns:local="clr-namespace:Markus.Service.StationController.Views"
8
      xmlns:VM="clr-namespace:Markus.Service.StationController.ViewModel"
9
      mc:Ignorable="d"  >
10
    <Grid HorizontalAlignment="Left">
11
        <Grid.Style>
12
            <Style>
13
                <Setter Property="TextBlock.Margin" Value="20,0,0,0"/>
14
            </Style>
15
        </Grid.Style>
16
        <!--<Grid.RowDefinitions>
17
            <RowDefinition />
18
            <RowDefinition/>
19
            <RowDefinition />
20
            <RowDefinition/>
21
            <RowDefinition/>
22
        </Grid.RowDefinitions>
23
        <Grid.ColumnDefinitions>
24
            <ColumnDefinition />
25
            <ColumnDefinition />
26
            <ColumnDefinition />
27
            <ColumnDefinition />
28
            <ColumnDefinition />
29
            <ColumnDefinition />
30
        </Grid.ColumnDefinitions>-->
31
        <Grid.RowDefinitions>
32
            <RowDefinition />
33
            <RowDefinition />
34
            <RowDefinition />
35
        </Grid.RowDefinitions>
36
        <Grid.ColumnDefinitions>
37
            <ColumnDefinition Width="*" />
38
            <ColumnDefinition Width="Auto"/>
39
            <ColumnDefinition Width="*"/>
40
            <ColumnDefinition Width="Auto"/>
41
            <ColumnDefinition Width="*"/>
42
            <ColumnDefinition Width="Auto"/>
43
            <ColumnDefinition Width="*"/>
44
            <ColumnDefinition Width="Auto"/>
45
        </Grid.ColumnDefinitions>
46
        
47
        <TextBlock Text="ProjectNumber  " Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"/>
48
        <telerik:RadMaskedTextInput IsClearButtonVisible="True" Grid.Row="0" Grid.Column="1"  Width="300"
49
         EmptyContent="ProjectNumber" InputBehavior="Replace" HorizontalContentAlignment="Stretch"
50
         TextMode="PlainText" Value="{Binding ProjectNo,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay, ElementName=userControl}"
51
         VerticalAlignment="Center" />
52

  
53
        <TextBlock Text="UniqueKey  " Grid.Row="0" Grid.Column="2" Margin="20,0,0,0" VerticalAlignment="Center"/>
54
        <telerik:RadMaskedTextInput IsClearButtonVisible="True"  Width="300"
55
         EmptyContent="UniqueKey" Value="{Binding UniqueKeyFilter, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
56
         TextMode="PlainText" Grid.Row="0" Grid.Column="3"
57
         HorizontalAlignment="Center"
58
         VerticalAlignment="Center"/>
59

  
60
        <!--<TextBlock Text="ConvertState : " Grid.Row="1" Grid.Column="0"/>-->
61
        <!--<telerik:RadMaskedTextInput IsClearButtonVisible="True"
62
         EmptyContent="ConvertState" Value="{Binding ConvertStateFilter, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
63
         TextMode="PlainText"  Grid.Row="1" Grid.Column="1"
64
         HorizontalAlignment="Center"
65
         VerticalAlignment="Center"/>-->
66

  
67

  
68
        <TextBlock Text="Docuemnt Name  " Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,10"/>
69
        <telerik:RadMaskedTextInput IsClearButtonVisible="True"  Width="300"
70
         EmptyContent="Docuemnt Name" Value="{Binding Docuemnt_NameFilter , UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
71
         TextMode="PlainText" Grid.Row="1" Grid.Column="1"
72
         HorizontalContentAlignment="Stretch"
73
         VerticalAlignment="Center"/>
74

  
75
        <TextBlock Text="Docuemnt NO  " Grid.Row="1" Grid.Column="2" Margin="20,0,0,0"  VerticalAlignment="Center"/>
76
        <telerik:RadMaskedTextInput IsClearButtonVisible="True"  Width="300"
77
         EmptyContent="Docuemnt NO" Value="{Binding Docuemnt_NOFilter , UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
78
         TextMode="PlainText" Grid.Row="1" Grid.Column="3"
79
         HorizontalAlignment="Center"
80
         VerticalAlignment="Center"/>
81

  
82
        <TextBlock Text="Service ID  " Grid.Row="0" Grid.Column="4"  Margin="20,0,10,0" VerticalAlignment="Center"/>
83
        <telerik:RadMaskedTextInput IsClearButtonVisible="True"  Width="300"
84
         EmptyContent="Service ID" Value="{Binding Service_IDFilter, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
85
         TextMode="PlainText" Grid.Row="0" Grid.Column="5"
86
         HorizontalAlignment="Center"
87
         VerticalAlignment="Center"/>
88

  
89

  
90
        <TextBlock Text="Reconverter " Grid.Row="1" Grid.Column="4"  Margin="20,0,0,0" VerticalAlignment="Center"/>
91
        <telerik:RadMaskedTextInput IsClearButtonVisible="True"  Width="300"
92
         EmptyContent="Reconverter"  Value="{Binding ReconverterFilter, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
93
         TextMode="PlainText" Grid.Row="1" Grid.Column="5"
94
         HorizontalAlignment="Center"
95
         VerticalAlignment="Center"/>
96

  
97
        <TextBlock Text="Revision  " Grid.Row="0" Grid.Column="6" VerticalAlignment="Center"  Margin="20,0,10,0"/>
98
        <telerik:RadMaskedTextInput IsClearButtonVisible="True"  Width="300"
99
         EmptyContent="Revision" Value="{Binding RevisionFilter, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
100
         TextMode="PlainText" Grid.Row="0" Grid.Column="7"
101
         HorizontalContentAlignment="Stretch"
102
         VerticalAlignment="Center"/>
103

  
104
        <StackPanel Grid.Row="2" Grid.ColumnSpan="8">
105
            <StackPanel Orientation="Horizontal">
106
                <TextBlock Text="CreateTime  " VerticalAlignment="Center"/>
107
                <telerik:RadDateTimePicker x:Name="datePicker1" Width="800"
108
                                   InputMode="DateTimePicker"  
109
                                   VerticalAlignment="Center"
110
                                   HorizontalAlignment="Center"
111
                                   SelectedValue="{Binding SelectedCreateTimeBegin ,Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged }" >
112
                </telerik:RadDateTimePicker>
113
                <!--<DatePicker Text="{Binding OpenStartTime, StringFormat='yy.mm.dd HH:mm:ss' ,RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}}" SelectedDate="{Binding SelectedOpenTime}" Width="124" SelectedDateFormat="Long" Margin="0,-1,0,1"/>-->
114
                <TextBlock Text="  ~  "/>
115
                <telerik:RadDateTimePicker x:Name="datePicker2"
116
                                   InputMode="DateTimePicker"  HorizontalAlignment="Stretch"
117
                                   VerticalAlignment="Center"
118
                                   Width="800"
119
                                   SelectedValue="{Binding SelectedCreateTimeEnd ,Mode=TwoWay,  UpdateSourceTrigger=PropertyChanged}"
120
                                   Margin="0,1">
121
                </telerik:RadDateTimePicker>
122
                <Button Content="Clear" Margin="5"  Width="50" Height="20" HorizontalAlignment="Left" Command="{Binding RemoveCreateTimeFilterCommand, Mode=OneWay}"/>
123

  
124
                <!--<telerik:RadToggleButton Content=" 검색" Command="{Binding DataFilterCommand, Mode=OneWay}" Width="100" Grid.Row="3"/>-->
125
                <!--<DatePicker Text="{Binding OpenStartTime, StringFormat='yy.mm.dd HH:mm:ss' ,RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}}" SelectedDate="{Binding SelectedOpenTime}" Width="124" SelectedDateFormat="Long" Margin="0,-1,0,1"/>-->
126

  
127

  
128
                <!--<telerik:RadMaskedTextInput IsClearButtonVisible="True"
129
         EmptyContent="placeholder text"
130
         TextMode="PlainText" 
131
         HorizontalAlignment="Center"
132
         VerticalAlignment="Center"/>-->
133
            </StackPanel>
134
        </StackPanel>
135
    </Grid>
136
</UserControl>
137

  
138
    
ConvertService/ServiceBase/Markus.Service.StationController/Controls/DatabaseFilter.xaml.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
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 Markus.Service.StationController.Controls
17
{
18
    /// <summary>
19
    /// DatabaseFilter.xaml에 대한 상호 작용 논리
20
    /// </summary>
21
    public partial class DatabaseFilter : UserControl
22
    {
23
        public DatabaseFilter()
24
        {
25
            InitializeComponent();
26
        }
27

  
28
        public static readonly DependencyProperty ProjectNoProperty = DependencyProperty.Register("ProjectNo", typeof(string), typeof(DatabaseFilter), null);
29
        public static readonly DependencyProperty UniqueKeyProperty = DependencyProperty.Register("UniqueKey", typeof(string), typeof(DatabaseFilter), null);
30
        public static readonly DependencyProperty Docuemnt_NOProperty = DependencyProperty.Register("Docuemnt_NO", typeof(string), typeof(DatabaseFilter), null);
31
        public static readonly DependencyProperty Docuemnt_NameProperty = DependencyProperty.Register("Docuemnt_Name", typeof(string), typeof(DatabaseFilter), null);
32
        public static readonly DependencyProperty ReconverterProperty = DependencyProperty.Register("Reconverter", typeof(string), typeof(DatabaseFilter), null);
33
        public static readonly DependencyProperty Service_IDProperty = DependencyProperty.Register("Service_ID", typeof(string), typeof(DatabaseFilter), null);
34
        public static readonly DependencyProperty RevisionProperty = DependencyProperty.Register("Revision", typeof(string), typeof(DatabaseFilter), null);
35
        public static readonly DependencyProperty CreateTimeBeginProperty = DependencyProperty.Register("CreateTimeBegin", typeof(string), typeof(DatabaseFilter), null);
36
        public static readonly DependencyProperty CreateTimeEndProperty = DependencyProperty.Register("CreateTimeEnd", typeof(string), typeof(DatabaseFilter), null);
37

  
38
        public string ProjectNo
39
        {
40
            get
41
            {
42
                return (string)this.GetValue(ProjectNoProperty);
43
            }
44
            set
45
            {
46
                this.SetValue(ProjectNoProperty, value);
47
            }
48
        }
49

  
50
        public string UniqueKey
51
        {
52
            get
53
            {
54
                return (string)this.GetValue(ProjectNoProperty);
55
            }
56
            set
57
            {
58
                this.SetValue(ProjectNoProperty, value);
59
            }
60
        }
61
        public string Docuemnt_NO
62
        {
63
            get
64
            {
65
                return (string)this.GetValue(ProjectNoProperty);
66
            }
67
            set
68
            {
69
                this.SetValue(ProjectNoProperty, value);
70
            }
71
        }
72
        public string Docuemnt_Name
73
        {
74
            get
75
            {
76
                return (string)this.GetValue(ProjectNoProperty);
77
            }
78
            set
79
            {
80
                this.SetValue(ProjectNoProperty, value);
81
            }
82
        }
83
        public int? Reconverter
84
        {
85
            get
86
            {
87
                return (int?)this.GetValue(ProjectNoProperty);
88
            }
89
            set
90
            {
91
                this.SetValue(ProjectNoProperty, value);
92
            }
93
        }
94
        public string Service_ID
95
        {
96
            get
97
            {
98
                return (string)this.GetValue(ProjectNoProperty);
99
            }
100
            set
101
            {
102
                this.SetValue(ProjectNoProperty, value);
103
            }
104
        }
105
        public string Revision
106
        {
107
            get
108
            {
109
                return (string)this.GetValue(ProjectNoProperty);
110
            }
111
            set
112
            {
113
                this.SetValue(ProjectNoProperty, value);
114
            }
115
        }
116
        public DateTime CreateTimeBegin
117
        {
118
            get
119
            {
120
                return (DateTime)this.GetValue(ProjectNoProperty);
121
            }
122
            set
123
            {
124
                this.SetValue(ProjectNoProperty, value);
125
            }
126
        }
127
        public DateTime CreateTimeEnd
128
        {
129
            get
130
            {
131
                return (DateTime)this.GetValue(ProjectNoProperty);
132
            }
133
            set
134
            {
135
                this.SetValue(ProjectNoProperty, value);
136
            }
137
        }
138
    }
139
}
ConvertService/ServiceBase/Markus.Service.StationController/Markus.Service.StationController.csproj
95 95
    <Reference Include="System.Data" />
96 96
    <Reference Include="System.Drawing" />
97 97
    <Reference Include="System.Runtime.Serialization" />
98
    <Reference Include="System.Security" />
98 99
    <Reference Include="System.ServiceModel" />
99 100
    <Reference Include="System.Web" />
100 101
    <Reference Include="System.Windows.Forms" />
......
152 153
    <Compile Include="Behaviors\RichTextBoxBehaviors.cs" />
153 154
    <Compile Include="Behaviors\StatusTypeList.cs" />
154 155
    <Compile Include="Behaviors\StatusTypeSet.cs" />
156
    <Compile Include="Controls\DatabaseFilter.xaml.cs">
157
      <DependentUpon>DatabaseFilter.xaml</DependentUpon>
158
    </Compile>
155 159
    <Compile Include="Controls\ITraceTextSink.cs" />
156 160
    <Compile Include="Controls\RowIndexColumn.cs" />
157 161
    <Compile Include="Controls\TraceDocument.xaml.cs">
......
167 171
    <Compile Include="Extensions\DataExport.cs" />
168 172
    <Compile Include="Extensions\GetStatusTypeEnums.cs" />
169 173
    <Compile Include="Extensions\VisualTreeHelper.cs" />
174
    <Compile Include="MarkusModel.Context.cs">
175
      <AutoGen>True</AutoGen>
176
      <DesignTime>True</DesignTime>
177
      <DependentUpon>MarkusModel.Context.tt</DependentUpon>
178
    </Compile>
179
    <Compile Include="MarkusModel.cs">
180
      <AutoGen>True</AutoGen>
181
      <DesignTime>True</DesignTime>
182
      <DependentUpon>MarkusModel.tt</DependentUpon>
183
    </Compile>
184
    <Compile Include="MarkusModel.Designer.cs">
185
      <AutoGen>True</AutoGen>
186
      <DesignTime>True</DesignTime>
187
      <DependentUpon>MarkusModel.edmx</DependentUpon>
188
    </Compile>
189
    <Compile Include="SELECT_CONVERT_ITEM_Result.cs">
190
      <DependentUpon>MarkusModel.tt</DependentUpon>
191
    </Compile>
192
    <Compile Include="SELECT_RERECONVERT_ITEM_Result.cs">
193
      <DependentUpon>MarkusModel.tt</DependentUpon>
194
    </Compile>
170 195
    <Compile Include="ViewModel\AliveViewModel.cs" />
171 196
    <Compile Include="ViewModel\DataBaseByStatusViewModel.cs" />
172 197
    <Compile Include="ViewModel\DataBaseItemsModel.cs" />
173 198
    <Compile Include="ViewModel\MergeDataViewModel.cs" />
174 199
    <Compile Include="ViewModel\MainViewModel.cs" />
175 200
    <Compile Include="ViewModel\TotalStatusViewModel.cs" />
176
    <Compile Include="Views\DatabaseFilter.xaml.cs">
177
      <DependentUpon>DatabaseFilter.xaml</DependentUpon>
178
    </Compile>
179 201
    <Compile Include="Views\DataBaseView.xaml.cs">
180 202
      <DependentUpon>DataBaseView.xaml</DependentUpon>
181 203
    </Compile>
......
201 223
    <Compile Include="Views\TotalStatusView.xaml.cs">
202 224
      <DependentUpon>TotalStatusView.xaml</DependentUpon>
203 225
    </Compile>
226
    <Page Include="Controls\DatabaseFilter.xaml">
227
      <Generator>MSBuild:Compile</Generator>
228
      <SubType>Designer</SubType>
229
    </Page>
204 230
    <Page Include="Controls\TraceDocument.xaml">
205 231
      <Generator>MSBuild:Compile</Generator>
206 232
      <SubType>Designer</SubType>
......
229 255
      <SubType>Designer</SubType>
230 256
      <Generator>MSBuild:Compile</Generator>
231 257
    </Page>
232
    <Page Include="Views\DatabaseFilter.xaml">
233
      <Generator>MSBuild:Compile</Generator>
234
      <SubType>Designer</SubType>
235
    </Page>
236 258
    <Page Include="Views\DataBaseView.xaml">
237 259
      <Generator>MSBuild:Compile</Generator>
238 260
      <SubType>Designer</SubType>
......
287 309
    <None Include="..\Markus.Service.Station\ServiceStation.ini">
288 310
      <Link>ServiceStation.ini</Link>
289 311
    </None>
312
    <EntityDeploy Include="MarkusModel.edmx">
313
      <Generator>EntityModelCodeGenerator</Generator>
314
      <LastGenOutput>MarkusModel.Designer.cs</LastGenOutput>
315
    </EntityDeploy>
316
    <None Include="MarkusModel.edmx.diagram">
317
      <DependentUpon>MarkusModel.edmx</DependentUpon>
318
    </None>
290 319
    <None Include="packages.config" />
291 320
    <None Include="Properties\Settings.settings">
292 321
      <Generator>SettingsSingleFileGenerator</Generator>
......
345 374
  <ItemGroup>
346 375
    <Folder Include="Converters\" />
347 376
  </ItemGroup>
377
  <ItemGroup>
378
    <Content Include="MarkusModel.Context.tt">
379
      <Generator>TextTemplatingFileGenerator</Generator>
380
      <LastGenOutput>MarkusModel.Context.cs</LastGenOutput>
381
      <DependentUpon>MarkusModel.edmx</DependentUpon>
382
    </Content>
383
    <Content Include="MarkusModel.tt">
384
      <Generator>TextTemplatingFileGenerator</Generator>
385
      <DependentUpon>MarkusModel.edmx</DependentUpon>
386
      <LastGenOutput>MarkusModel.cs</LastGenOutput>
387
    </Content>
388
  </ItemGroup>
389
  <ItemGroup>
390
    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
391
  </ItemGroup>
348 392
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
349 393
  <PropertyGroup>
350 394
    <PostBuildEvent>mkdir $(TargetDir)Bin
ConvertService/ServiceBase/Markus.Service.StationController/MarkusModel.Context.cs
1
//------------------------------------------------------------------------------
2
// <auto-generated>
3
//     이 코드는 템플릿에서 생성되었습니다.
4
//
5
//     이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
6
//     이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
7
// </auto-generated>
8
//------------------------------------------------------------------------------
9

  
10
namespace Markus.Service.StationController
11
{
12
    using System;
13
    using System.Data.Entity;
14
    using System.Data.Entity.Infrastructure;
15
    using System.Data.Entity.Core.Objects;
16
    using System.Linq;
17
    
18
    public partial class markusEntities : DbContext
19
    {
20
        public markusEntities()
21
            : base("name=markusEntities")
22
        {
23
        }
24
    
25
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
26
        {
27
            throw new UnintentionalCodeFirstException();
28
        }
29
    
30
    
31
        public virtual ObjectResult<SELECT_CONVERT_ITEM_Result> SELECT_CONVERT_ITEM(string p_PROJECT_NO, string p_DOCUMENT_ID, Nullable<int> p_STATUS, Nullable<int> p_TAKE_COUNT, Nullable<System.DateTime> p_BEGIN_CREATE_DATETIME, Nullable<System.DateTime> p_FINISH_CREATE_DATETIME, Nullable<System.DateTime> p_BEGIN_START_DATETIE, Nullable<System.DateTime> p_FINISH_START_DATETIME, Nullable<System.DateTime> p_BEGIN_END_DATETIME, Nullable<System.DateTime> p_FINISH_END_DATETIME, string p_GROUP_NO, string p_DOCUMENT_NAME, string p_DOCUMENT_NO, string p_REVISION)
32
        {
33
            var p_PROJECT_NOParameter = p_PROJECT_NO != null ?
34
                new ObjectParameter("P_PROJECT_NO", p_PROJECT_NO) :
35
                new ObjectParameter("P_PROJECT_NO", typeof(string));
36
    
37
            var p_DOCUMENT_IDParameter = p_DOCUMENT_ID != null ?
38
                new ObjectParameter("P_DOCUMENT_ID", p_DOCUMENT_ID) :
39
                new ObjectParameter("P_DOCUMENT_ID", typeof(string));
40
    
41
            var p_STATUSParameter = p_STATUS.HasValue ?
42
                new ObjectParameter("P_STATUS", p_STATUS) :
43
                new ObjectParameter("P_STATUS", typeof(int));
44
    
45
            var p_TAKE_COUNTParameter = p_TAKE_COUNT.HasValue ?
46
                new ObjectParameter("P_TAKE_COUNT", p_TAKE_COUNT) :
47
                new ObjectParameter("P_TAKE_COUNT", typeof(int));
48
    
49
            var p_BEGIN_CREATE_DATETIMEParameter = p_BEGIN_CREATE_DATETIME.HasValue ?
50
                new ObjectParameter("P_BEGIN_CREATE_DATETIME", p_BEGIN_CREATE_DATETIME) :
51
                new ObjectParameter("P_BEGIN_CREATE_DATETIME", typeof(System.DateTime));
52
    
53
            var p_FINISH_CREATE_DATETIMEParameter = p_FINISH_CREATE_DATETIME.HasValue ?
54
                new ObjectParameter("P_FINISH_CREATE_DATETIME", p_FINISH_CREATE_DATETIME) :
55
                new ObjectParameter("P_FINISH_CREATE_DATETIME", typeof(System.DateTime));
56
    
57
            var p_BEGIN_START_DATETIEParameter = p_BEGIN_START_DATETIE.HasValue ?
58
                new ObjectParameter("P_BEGIN_START_DATETIE", p_BEGIN_START_DATETIE) :
59
                new ObjectParameter("P_BEGIN_START_DATETIE", typeof(System.DateTime));
60
    
61
            var p_FINISH_START_DATETIMEParameter = p_FINISH_START_DATETIME.HasValue ?
62
                new ObjectParameter("P_FINISH_START_DATETIME", p_FINISH_START_DATETIME) :
63
                new ObjectParameter("P_FINISH_START_DATETIME", typeof(System.DateTime));
64
    
65
            var p_BEGIN_END_DATETIMEParameter = p_BEGIN_END_DATETIME.HasValue ?
66
                new ObjectParameter("P_BEGIN_END_DATETIME", p_BEGIN_END_DATETIME) :
67
                new ObjectParameter("P_BEGIN_END_DATETIME", typeof(System.DateTime));
68
    
69
            var p_FINISH_END_DATETIMEParameter = p_FINISH_END_DATETIME.HasValue ?
70
                new ObjectParameter("P_FINISH_END_DATETIME", p_FINISH_END_DATETIME) :
71
                new ObjectParameter("P_FINISH_END_DATETIME", typeof(System.DateTime));
72
    
73
            var p_GROUP_NOParameter = p_GROUP_NO != null ?
74
                new ObjectParameter("P_GROUP_NO", p_GROUP_NO) :
75
                new ObjectParameter("P_GROUP_NO", typeof(string));
76
    
77
            var p_DOCUMENT_NAMEParameter = p_DOCUMENT_NAME != null ?
78
                new ObjectParameter("P_DOCUMENT_NAME", p_DOCUMENT_NAME) :
79
                new ObjectParameter("P_DOCUMENT_NAME", typeof(string));
80
    
81
            var p_DOCUMENT_NOParameter = p_DOCUMENT_NO != null ?
82
                new ObjectParameter("P_DOCUMENT_NO", p_DOCUMENT_NO) :
83
                new ObjectParameter("P_DOCUMENT_NO", typeof(string));
84
    
85
            var p_REVISIONParameter = p_REVISION != null ?
86
                new ObjectParameter("P_REVISION", p_REVISION) :
87
                new ObjectParameter("P_REVISION", typeof(string));
88
    
89
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<SELECT_CONVERT_ITEM_Result>("markusEntities.SELECT_CONVERT_ITEM", p_PROJECT_NOParameter, p_DOCUMENT_IDParameter, p_STATUSParameter, p_TAKE_COUNTParameter, p_BEGIN_CREATE_DATETIMEParameter, p_FINISH_CREATE_DATETIMEParameter, p_BEGIN_START_DATETIEParameter, p_FINISH_START_DATETIMEParameter, p_BEGIN_END_DATETIMEParameter, p_FINISH_END_DATETIMEParameter, p_GROUP_NOParameter, p_DOCUMENT_NAMEParameter, p_DOCUMENT_NOParameter, p_REVISIONParameter);
90
        }
91
    
92
        public virtual ObjectResult<SELECT_RERECONVERT_ITEM_Result> SELECT_RERECONVERT_ITEM(string p_ID, Nullable<int> p_RECONVERTER, Nullable<int> p_STATUS)
93
        {
94
            var p_IDParameter = p_ID != null ?
95
                new ObjectParameter("P_ID", p_ID) :
96
                new ObjectParameter("P_ID", typeof(string));
97
    
98
            var p_RECONVERTERParameter = p_RECONVERTER.HasValue ?
99
                new ObjectParameter("P_RECONVERTER", p_RECONVERTER) :
100
                new ObjectParameter("P_RECONVERTER", typeof(int));
101
    
102
            var p_STATUSParameter = p_STATUS.HasValue ?
103
                new ObjectParameter("P_STATUS", p_STATUS) :
104
                new ObjectParameter("P_STATUS", typeof(int));
105
    
106
            return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<SELECT_RERECONVERT_ITEM_Result>("markusEntities.SELECT_RERECONVERT_ITEM", p_IDParameter, p_RECONVERTERParameter, p_STATUSParameter);
107
        }
108
    }
109
}
ConvertService/ServiceBase/Markus.Service.StationController/MarkusModel.Context.tt
1
<#@ template language="C#" debug="false" hostspecific="true"#>
2
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
3
 output extension=".cs"#><#
4

  
5
const string inputFile = @"MarkusModel.edmx";
6
var textTransform = DynamicTextTransformation.Create(this);
7
var code = new CodeGenerationTools(this);
8
var ef = new MetadataTools(this);
9
var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
10
var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors);
11
var itemCollection = loader.CreateEdmItemCollection(inputFile);
12
var modelNamespace = loader.GetModelNamespace(inputFile);
13
var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
14

  
15
var container = itemCollection.OfType<EntityContainer>().FirstOrDefault();
16
if (container == null)
17
{
18
    return string.Empty;
19
}
20
#>
21
//------------------------------------------------------------------------------
22
// <auto-generated>
23
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
24
//
25
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
26
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
27
// </auto-generated>
28
//------------------------------------------------------------------------------
29

  
30
<#
31

  
32
var codeNamespace = code.VsNamespaceSuggestion();
33
if (!String.IsNullOrEmpty(codeNamespace))
34
{
35
#>
36
namespace <#=code.EscapeNamespace(codeNamespace)#>
37
{
38
<#
39
    PushIndent("    ");
40
}
41

  
42
#>
43
using System;
44
using System.Data.Entity;
45
using System.Data.Entity.Infrastructure;
46
<#
47
if (container.FunctionImports.Any())
48
{
49
#>
50
using System.Data.Entity.Core.Objects;
51
using System.Linq;
52
<#
53
}
54
#>
55

  
56
<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext
57
{
58
    public <#=code.Escape(container)#>()
59
        : base("name=<#=container.Name#>")
60
    {
61
<#
62
if (!loader.IsLazyLoadingEnabled(container))
63
{
64
#>
65
        this.Configuration.LazyLoadingEnabled = false;
66
<#
67
}
68

  
69
foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
70
{
71
    // Note: the DbSet members are defined below such that the getter and
72
    // setter always have the same accessibility as the DbSet definition
73
    if (Accessibility.ForReadOnlyProperty(entitySet) != "public")
74
    {
75
#>
76
        <#=codeStringGenerator.DbSetInitializer(entitySet)#>
77
<#
78
    }
79
}
80
#>
81
    }
82

  
83
    protected override void OnModelCreating(DbModelBuilder modelBuilder)
84
    {
85
        throw new UnintentionalCodeFirstException();
86
    }
87

  
88
<#
89
    foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
90
    {
91
#>
92
    <#=codeStringGenerator.DbSet(entitySet)#>
93
<#
94
    }
95

  
96
    foreach (var edmFunction in container.FunctionImports)
97
    {
98
        WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false);
99
    }
100
#>
101
}
102
<#
103

  
104
if (!String.IsNullOrEmpty(codeNamespace))
105
{
106
    PopIndent();
107
#>
108
}
109
<#
110
}
111
#>
112
<#+
113

  
114
private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
115
{
116
    if (typeMapper.IsComposable(edmFunction))
117
    {
118
#>
119

  
120
    [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")]
121
    <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#>
122
    {
123
<#+
124
        codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
125
#>
126
        <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#>
127
    }
128
<#+
129
    }
130
    else
131
    {
132
#>
133

  
134
    <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#>
135
    {
136
<#+
137
        codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
138
#>
139
        <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#>
140
    }
141
<#+
142
        if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption))
143
        {
144
            WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true);
145
        }
146
    }
147
}
148

  
149
public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit)
150
{
151
#>
152
        var <#=name#> = <#=isNotNull#> ?
153
            <#=notNullInit#> :
154
            <#=nullInit#>;
155

  
156
<#+
157
}
158

  
159
public const string TemplateId = "CSharp_DbContext_Context_EF6";
160

  
161
public class CodeStringGenerator
162
{
163
    private readonly CodeGenerationTools _code;
164
    private readonly TypeMapper _typeMapper;
165
    private readonly MetadataTools _ef;
166

  
167
    public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
168
    {
169
        ArgumentNotNull(code, "code");
170
        ArgumentNotNull(typeMapper, "typeMapper");
171
        ArgumentNotNull(ef, "ef");
172

  
173
        _code = code;
174
        _typeMapper = typeMapper;
175
        _ef = ef;
176
    }
177

  
178
    public string Property(EdmProperty edmProperty)
179
    {
180
        return string.Format(
181
            CultureInfo.InvariantCulture,
182
            "{0} {1} {2} {{ {3}get; {4}set; }}",
183
            Accessibility.ForProperty(edmProperty),
184
            _typeMapper.GetTypeName(edmProperty.TypeUsage),
185
            _code.Escape(edmProperty),
186
            _code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
187
            _code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
188
    }
189

  
190
    public string NavigationProperty(NavigationProperty navProp)
191
    {
192
        var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
193
        return string.Format(
194
            CultureInfo.InvariantCulture,
195
            "{0} {1} {2} {{ {3}get; {4}set; }}",
196
            AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
197
            navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
198
            _code.Escape(navProp),
199
            _code.SpaceAfter(Accessibility.ForGetter(navProp)),
200
            _code.SpaceAfter(Accessibility.ForSetter(navProp)));
201
    }
202
    
203
    public string AccessibilityAndVirtual(string accessibility)
204
    {
205
        return accessibility + (accessibility != "private" ? " virtual" : "");
206
    }
207
    
208
    public string EntityClassOpening(EntityType entity)
209
    {
210
        return string.Format(
211
            CultureInfo.InvariantCulture,
212
            "{0} {1}partial class {2}{3}",
213
            Accessibility.ForType(entity),
214
            _code.SpaceAfter(_code.AbstractOption(entity)),
215
            _code.Escape(entity),
216
            _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
217
    }
218
    
219
    public string EnumOpening(SimpleType enumType)
220
    {
221
        return string.Format(
222
            CultureInfo.InvariantCulture,
223
            "{0} enum {1} : {2}",
224
            Accessibility.ForType(enumType),
225
            _code.Escape(enumType),
226
            _code.Escape(_typeMapper.UnderlyingClrType(enumType)));
227
        }
228
    
229
    public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
230
    {
231
        var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
232
        foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
233
        {
234
            var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
235
            var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
236
            var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
237
            writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
238
        }
239
    }
240
    
241
    public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
242
    {
243
        var parameters = _typeMapper.GetParameters(edmFunction);
244
        
245
        return string.Format(
246
            CultureInfo.InvariantCulture,
247
            "{0} IQueryable<{1}> {2}({3})",
248
            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
249
            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
250
            _code.Escape(edmFunction),
251
            string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
252
    }
253
    
254
    public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
255
    {
256
        var parameters = _typeMapper.GetParameters(edmFunction);
257
        
258
        return string.Format(
259
            CultureInfo.InvariantCulture,
260
            "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
261
            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
262
            edmFunction.NamespaceName,
263
            edmFunction.Name,
264
            string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
265
            _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
266
    }
267
    
268
    public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
269
    {
270
        var parameters = _typeMapper.GetParameters(edmFunction);
271
        var returnType = _typeMapper.GetReturnType(edmFunction);
272

  
273
        var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
274
        if (includeMergeOption)
275
        {
276
            paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
277
        }
278

  
279
        return string.Format(
280
            CultureInfo.InvariantCulture,
281
            "{0} {1} {2}({3})",
282
            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
283
            returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
284
            _code.Escape(edmFunction),
285
            paramList);
286
    }
287
    
288
    public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
289
    {
290
        var parameters = _typeMapper.GetParameters(edmFunction);
291
        var returnType = _typeMapper.GetReturnType(edmFunction);
292

  
293
        var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
294
        if (includeMergeOption)
295
        {
296
            callParams = ", mergeOption" + callParams;
297
        }
298
        
299
        return string.Format(
300
            CultureInfo.InvariantCulture,
301
            "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
302
            returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
303
            edmFunction.FullName,
304
            callParams);
305
    }
306
    
307
    public string DbSet(EntitySet entitySet)
308
    {
309
        return string.Format(
310
            CultureInfo.InvariantCulture,
311
            "{0} virtual DbSet<{1}> {2} {{ get; set; }}",
312
            Accessibility.ForReadOnlyProperty(entitySet),
313
            _typeMapper.GetTypeName(entitySet.ElementType),
314
            _code.Escape(entitySet));
315
    }
316

  
317
    public string DbSetInitializer(EntitySet entitySet)
318
    {
319
        return string.Format(
320
            CultureInfo.InvariantCulture,
321
            "{0} = Set<{1}>();",
322
            _code.Escape(entitySet),
323
            _typeMapper.GetTypeName(entitySet.ElementType));
324
    }
325

  
326
    public string UsingDirectives(bool inHeader, bool includeCollections = true)
327
    {
328
        return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
329
            ? string.Format(
330
                CultureInfo.InvariantCulture,
331
                "{0}using System;{1}" +
332
                "{2}",
333
                inHeader ? Environment.NewLine : "",
334
                includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
335
                inHeader ? "" : Environment.NewLine)
336
            : "";
337
    }
338
}
339

  
340
public class TypeMapper
341
{
342
    private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
343

  
344
    private readonly System.Collections.IList _errors;
345
    private readonly CodeGenerationTools _code;
346
    private readonly MetadataTools _ef;
347

  
348
    public static string FixNamespaces(string typeName)
349
    {
350
        return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
351
    }
352

  
353
    public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
354
    {
355
        ArgumentNotNull(code, "code");
356
        ArgumentNotNull(ef, "ef");
357
        ArgumentNotNull(errors, "errors");
358

  
359
        _code = code;
360
        _ef = ef;
361
        _errors = errors;
362
    }
363

  
364
    public string GetTypeName(TypeUsage typeUsage)
365
    {
366
        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
367
    }
368

  
369
    public string GetTypeName(EdmType edmType)
370
    {
371
        return GetTypeName(edmType, isNullable: null, modelNamespace: null);
372
    }
373

  
374
    public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
375
    {
376
        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
377
    }
378

  
379
    public string GetTypeName(EdmType edmType, string modelNamespace)
380
    {
381
        return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
382
    }
383

  
384
    public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
385
    {
386
        if (edmType == null)
387
        {
388
            return null;
389
        }
390

  
391
        var collectionType = edmType as CollectionType;
392
        if (collectionType != null)
393
        {
394
            return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
395
        }
396

  
397
        var typeName = _code.Escape(edmType.MetadataProperties
398
                                .Where(p => p.Name == ExternalTypeNameAttributeName)
399
                                .Select(p => (string)p.Value)
400
                                .FirstOrDefault())
401
            ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
402
                _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
403
                _code.Escape(edmType));
404

  
405
        if (edmType is StructuralType)
406
        {
407
            return typeName;
408
        }
409

  
410
        if (edmType is SimpleType)
411
        {
412
            var clrType = UnderlyingClrType(edmType);
413
            if (!IsEnumType(edmType))
414
            {
415
                typeName = _code.Escape(clrType);
416
            }
417

  
418
            typeName = FixNamespaces(typeName);
419

  
420
            return clrType.IsValueType && isNullable == true ?
421
                String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
422
                typeName;
423
        }
424

  
425
        throw new ArgumentException("edmType");
426
    }
427
    
428
    public Type UnderlyingClrType(EdmType edmType)
429
    {
430
        ArgumentNotNull(edmType, "edmType");
431

  
432
        var primitiveType = edmType as PrimitiveType;
433
        if (primitiveType != null)
434
        {
435
            return primitiveType.ClrEquivalentType;
436
        }
437

  
438
        if (IsEnumType(edmType))
439
        {
440
            return GetEnumUnderlyingType(edmType).ClrEquivalentType;
441
        }
442

  
443
        return typeof(object);
444
    }
445
    
446
    public object GetEnumMemberValue(MetadataItem enumMember)
447
    {
448
        ArgumentNotNull(enumMember, "enumMember");
449
        
450
        var valueProperty = enumMember.GetType().GetProperty("Value");
451
        return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
452
    }
453
    
454
    public string GetEnumMemberName(MetadataItem enumMember)
455
    {
456
        ArgumentNotNull(enumMember, "enumMember");
457
        
458
        var nameProperty = enumMember.GetType().GetProperty("Name");
459
        return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
460
    }
461

  
462
    public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
463
    {
464
        ArgumentNotNull(enumType, "enumType");
465

  
466
        var membersProperty = enumType.GetType().GetProperty("Members");
467
        return membersProperty != null 
468
            ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
469
            : Enumerable.Empty<MetadataItem>();
470
    }
471
    
472
    public bool EnumIsFlags(EdmType enumType)
473
    {
474
        ArgumentNotNull(enumType, "enumType");
475
        
476
        var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
477
        return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
478
    }
479

  
480
    public bool IsEnumType(GlobalItem edmType)
481
    {
482
        ArgumentNotNull(edmType, "edmType");
483

  
484
        return edmType.GetType().Name == "EnumType";
485
    }
486

  
487
    public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
488
    {
489
        ArgumentNotNull(enumType, "enumType");
490

  
491
        return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
492
    }
493

  
494
    public string CreateLiteral(object value)
495
    {
496
        if (value == null || value.GetType() != typeof(TimeSpan))
497
        {
498
            return _code.CreateLiteral(value);
499
        }
500

  
501
        return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
502
    }
503
    
504
    public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
505
    {
506
        ArgumentNotNull(types, "types");
507
        ArgumentNotNull(sourceFile, "sourceFile");
508
        
509
        var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
510
        if (types.Any(item => !hash.Add(item)))
511
        {
512
            _errors.Add(
513
                new CompilerError(sourceFile, -1, -1, "6023",
514
                    String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
515
            return false;
516
        }
517
        return true;
518
    }
519
    
520
    public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
521
    {
522
        return GetItemsToGenerate<SimpleType>(itemCollection)
523
            .Where(e => IsEnumType(e));
524
    }
525
    
526
    public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
527
    {
528
        return itemCollection
529
            .OfType<T>()
530
            .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
531
            .OrderBy(i => i.Name);
532
    }
533

  
534
    public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
535
    {
536
        return itemCollection
537
            .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
538
            .Select(g => GetGlobalItemName(g));
539
    }
540

  
541
    public string GetGlobalItemName(GlobalItem item)
542
    {
543
        if (item is EdmType)
544
        {
545
            return ((EdmType)item).Name;
546
        }
547
        else
548
        {
549
            return ((EntityContainer)item).Name;
550
        }
551
    }
552

  
553
    public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
554
    {
555
        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
556
    }
557
    
558
    public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
559
    {
560
        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
561
    }
562
    
563
    public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
564
    {
565
        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
566
    }
567
    
568
    public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
569
    {
570
        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
571
    }
572

  
573
    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
574
    {
575
        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
576
    }
577
    
578
    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
579
    {
580
        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
581
    }
582

  
583
    public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
584
    {
585
        return type.NavigationProperties.Where(np => np.DeclaringType == type);
586
    }
587
    
588
    public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
589
    {
590
        return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
591
    }
592
    
593
    public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
594
    {
595
        ArgumentNotNull(edmFunction, "edmFunction");
596

  
597
        var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
598
        return returnParamsProperty == null
599
            ? edmFunction.ReturnParameter
600
            : ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
601
    }
602

  
603
    public bool IsComposable(EdmFunction edmFunction)
604
    {
605
        ArgumentNotNull(edmFunction, "edmFunction");
606

  
607
        var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
608
        return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
609
    }
610

  
611
    public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
612
    {
613
        return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
614
    }
615

  
616
    public TypeUsage GetReturnType(EdmFunction edmFunction)
617
    {
618
        var returnParam = GetReturnParameter(edmFunction);
619
        return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
620
    }
621
    
622
    public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
623
    {
624
        var returnType = GetReturnType(edmFunction);
625
        return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
626
    }
627
}
628

  
629
public static void ArgumentNotNull<T>(T arg, string name) where T : class
630
{
631
    if (arg == null)
632
    {
633
        throw new ArgumentNullException(name);
634
    }
635
}
636
#>
ConvertService/ServiceBase/Markus.Service.StationController/MarkusModel.Designer.cs
1
// 모델 'E:\Source\MARKUS\ConvertService\ServiceBase\Markus.Service.StationController\MarkusModel.edmx'에 대해 T4 코드 생성이 사용됩니다. 
2
// 레거시 코드 생성을 사용하려면 '코드 생성 전략' 디자이너 속성의 값을
3
// 'Legacy ObjectContext'로 변경하십시오. 이 속성은 모델이 디자이너에서 열릴 때
4
// 속성 창에서 사용할 수 있습니다.
5

  
6
// 컨텍스트 및 엔터티 클래스가 생성되지 않은 경우 빈 모델을 만들었기 때문일 수도 있지만
7
// 사용할 Entity Framework 버전을 선택하지 않았기 때문일 수도 있습니다. 모델에 맞는 컨텍스트 클래스 및
8
// 엔터티 클래스를 생성하려면 디자이너에서 모델을 열고 디자이너 화면에서 마우스 오른쪽 단추를 클릭한
9
// 다음 '데이터베이스에서 모델 업데이트...', '모델에서 데이터베이스 생성...' 또는 '코드 생성 항목 추가...'를
10
// 선택하십시오.
ConvertService/ServiceBase/Markus.Service.StationController/MarkusModel.cs
1
//------------------------------------------------------------------------------
2
// <auto-generated>
3
//     이 코드는 템플릿에서 생성되었습니다.
4
//
5
//     이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
6
//     이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
7
// </auto-generated>
8
//------------------------------------------------------------------------------
9

  
ConvertService/ServiceBase/Markus.Service.StationController/MarkusModel.edmx
1
<?xml version="1.0" encoding="utf-8"?>
2
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
3
  <!-- EF Runtime content -->
4
  <edmx:Runtime>
5
    <!-- SSDL content -->
6
    <edmx:StorageModels>
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_ITEM" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
9
          <Parameter Name="P_PROJECT_NO" Type="nvarchar" Mode="In" />
10
          <Parameter Name="P_DOCUMENT_ID" Type="nvarchar" Mode="In" />
11
          <Parameter Name="P_STATUS" Type="int" Mode="In" />
12
          <Parameter Name="P_TAKE_COUNT" Type="int" Mode="In" />
13
          <Parameter Name="P_BEGIN_CREATE_DATETIME" Type="datetime" Mode="In" />
14
          <Parameter Name="P_FINISH_CREATE_DATETIME" Type="datetime" Mode="In" />
15
          <Parameter Name="P_BEGIN_START_DATETIE" Type="datetime" Mode="In" />
16
          <Parameter Name="P_FINISH_START_DATETIME" Type="datetime" Mode="In" />
17
          <Parameter Name="P_BEGIN_END_DATETIME" Type="datetime" Mode="In" />
18
          <Parameter Name="P_FINISH_END_DATETIME" Type="datetime" Mode="In" />
19
          <Parameter Name="P_GROUP_NO" Type="nvarchar" Mode="In" />
20
          <Parameter Name="P_DOCUMENT_NAME" Type="nvarchar" Mode="In" />
21
          <Parameter Name="P_DOCUMENT_NO" Type="nvarchar" Mode="In" />
22
          <Parameter Name="P_REVISION" Type="nvarchar" Mode="In" />
23
        </Function>
24
        <Function Name="SELECT_RERECONVERT_ITEM" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
25
          <Parameter Name="P_ID" Type="nvarchar" Mode="In" />
26
          <Parameter Name="P_RECONVERTER" Type="int" Mode="In" />
27
          <Parameter Name="P_STATUS" Type="int" Mode="In" />
28
        </Function>
29
        <EntityContainer Name="markusModelStoreContainer" />
30
      </Schema></edmx:StorageModels>
31
    <!-- CSDL content -->
32
    <edmx:ConceptualModels>
33
      <Schema Namespace="markusModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
34
        <EntityContainer Name="markusEntities" annotation:LazyLoadingEnabled="true" >
35
          <FunctionImport Name="SELECT_CONVERT_ITEM" ReturnType="Collection(markusModel.SELECT_CONVERT_ITEM_Result)">
36
            <Parameter Name="P_PROJECT_NO" Mode="In" Type="String" />
37
            <Parameter Name="P_DOCUMENT_ID" Mode="In" Type="String" />
38
            <Parameter Name="P_STATUS" Mode="In" Type="Int32" />
39
            <Parameter Name="P_TAKE_COUNT" Mode="In" Type="Int32" />
40
            <Parameter Name="P_BEGIN_CREATE_DATETIME" Mode="In" Type="DateTime" />
41
            <Parameter Name="P_FINISH_CREATE_DATETIME" Mode="In" Type="DateTime" />
42
            <Parameter Name="P_BEGIN_START_DATETIE" Mode="In" Type="DateTime" />
43
            <Parameter Name="P_FINISH_START_DATETIME" Mode="In" Type="DateTime" />
44
            <Parameter Name="P_BEGIN_END_DATETIME" Mode="In" Type="DateTime" />
45
            <Parameter Name="P_FINISH_END_DATETIME" Mode="In" Type="DateTime" />
46
            <Parameter Name="P_GROUP_NO" Mode="In" Type="String" />
47
            <Parameter Name="P_DOCUMENT_NAME" Mode="In" Type="String" />
48
            <Parameter Name="P_DOCUMENT_NO" Mode="In" Type="String" />
49
            <Parameter Name="P_REVISION" Mode="In" Type="String" />
50
          </FunctionImport>
51
          <FunctionImport Name="SELECT_RERECONVERT_ITEM" ReturnType="Collection(markusModel.SELECT_RERECONVERT_ITEM_Result)">
52
            <Parameter Name="P_ID" Mode="In" Type="String" />
53
            <Parameter Name="P_RECONVERTER" Mode="In" Type="Int32" />
54
            <Parameter Name="P_STATUS" Mode="In" Type="Int32" />
55
          </FunctionImport>
56
        </EntityContainer>
57
        <ComplexType Name="SELECT_CONVERT_ITEM_Result">
58
          <Property Type="String" Name="ID" Nullable="false" MaxLength="50" />
59
          <Property Type="String" Name="PROJECT_NO" Nullable="false" MaxLength="10" />
60
          <Property Type="String" Name="DOCUMENT_URL" Nullable="false" MaxLength="500" />
61
          <Property Type="String" Name="DOCUMENT_ID" Nullable="false" MaxLength="50" />
62
          <Property Type="DateTime" Name="CREATE_DATETIME" Nullable="false" Precision="23" />
63
          <Property Type="Int32" Name="STATUS" Nullable="false" />
64
          <Property Type="Int32" Name="TOTAL_PAGE" Nullable="false" />
65
          <Property Type="Int32" Name="CURRENT_PAGE" Nullable="false" />
66
          <Property Type="String" Name="EXCEPTION" Nullable="true" />
67
          <Property Type="DateTime" Name="END_DATETIME" Nullable="true" Precision="23" />
68
          <Property Type="DateTime" Name="START_DATETIME" Nullable="true" Precision="23" />
69
          <Property Type="String" Name="SERVICE_ID" Nullable="true" MaxLength="50" />
70
          <Property Type="Int32" Name="RECONVERTER" Nullable="true" />
71
          <Property Type="String" Name="REVISION" Nullable="true" MaxLength="50" />
72
          <Property Type="String" Name="DOCUMENT_NO" Nullable="true" MaxLength="50" />
73
          <Property Type="String" Name="DOCUMENT_NAME" Nullable="true" MaxLength="500" />
74
          <Property Type="String" Name="GROUP_NO" Nullable="true" MaxLength="50" />
75
          <Property Type="String" Name="RESULT_FILE" Nullable="true" MaxLength="500" />
76
          <Property Type="String" Name="RESULT" Nullable="true" MaxLength="50" />
77
        </ComplexType>
78
        <ComplexType Name="SELECT_RERECONVERT_ITEM_Result">
79
          <Property Type="String" Name="EX" Nullable="true" MaxLength="50" />
80
          <Property Type="Int32" Name="RETURNVALUE" Nullable="true" />
81
        </ComplexType>
82
      </Schema>
83
    </edmx:ConceptualModels>
84
    <!-- C-S mapping content -->
85
    <edmx:Mappings>
86
      <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
87
        <EntityContainerMapping StorageEntityContainer="markusModelStoreContainer" CdmEntityContainer="markusEntities" >
88
          <FunctionImportMapping FunctionImportName="SELECT_CONVERT_ITEM" FunctionName="markusModel.Store.SELECT_CONVERT_ITEM">
89
            <ResultMapping>
90
              <ComplexTypeMapping TypeName="markusModel.SELECT_CONVERT_ITEM_Result">
91
                <ScalarProperty Name="ID" ColumnName="ID" />
92
                <ScalarProperty Name="PROJECT_NO" ColumnName="PROJECT_NO" />
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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