개정판 52b947bb
issue #0000 .net 4.6.1
Change-Id: If9eb1a3d5665e0ec07c39223aff26deb3171caa6
ConvertService/ServiceBase/Markus.Service.DataBase.Dapper/Repositories/DOCPAGERepository.cs | ||
---|---|---|
31 | 31 |
var tran = Connection.BeginTransaction(); |
32 | 32 |
var parameter = new DynamicParameters(); |
33 | 33 |
|
34 |
parameter.AddTable("@DOCPAGES", "TYPE_INSERT_DOCPAGE", docPages); |
|
34 |
var items = docPages.Select(x => new InsertDocPage { DOCINFO_ID = x.DOCINFO_ID,PAGE_NUMBER = x.PAGE_NUMBER, PAGE_ANGLE = x.PAGE_ANGLE, PAGE_HEIGHT = x.PAGE_HEIGHT, PAGE_WIDTH = x.PAGE_WIDTH }).ToList(); |
|
35 |
|
|
36 |
|
|
37 |
parameter.AddTable("@DOCPAGES", "TYPE_INSERT_DOCPAGE", items); |
|
35 | 38 |
|
36 | 39 |
var id = await Connection.ExecuteAsync("CONVERT_INSERT_DOCPAGE", parameter, tran, commandType: CommandType.StoredProcedure); |
37 | 40 |
|
... | ... | |
46 | 49 |
|
47 | 50 |
return result; |
48 | 51 |
} |
52 |
|
|
53 |
private class InsertDocPage |
|
54 |
{ |
|
55 |
public string DOCINFO_ID { get; set; } |
|
56 |
public int PAGE_NUMBER { get; set; } |
|
57 |
public string PAGE_WIDTH { get; set; } |
|
58 |
public string PAGE_HEIGHT { get; set; } |
|
59 |
public int PAGE_ANGLE { get; set; } |
|
60 |
} |
|
49 | 61 |
} |
50 | 62 |
} |
51 | 63 |
|
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseConvertDoc.cs | ||
---|---|---|
33 | 33 |
GetConvertDocSingle(); |
34 | 34 |
} |
35 | 35 |
|
36 |
|
|
37 |
[Test, Description("GetConvertDocSingle Test")] |
|
36 | 38 |
private void GetConvertDocSingle() |
37 | 39 |
{ |
38 | 40 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr,dbtype)) |
... | ... | |
46 | 48 |
|
47 | 49 |
} |
48 | 50 |
} |
51 |
|
|
52 |
[Test, Description("Select Top 10 Convert Doc MS SQL Test")] |
|
53 |
public void SelectTop10ConvertDoc() |
|
54 |
{ |
|
55 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
|
56 |
{ |
|
57 |
string sql = @"SELECT TOP(10) ID, PROJECT_NO, DOCUMENT_URL, DOCUMENT_ID, CREATE_DATETIME, STATUS, TOTAL_PAGE, CURRENT_PAGE, EXCEPTION, END_DATETIME, START_DATETIME, SERVICE_ID," |
|
58 |
+ "RECONVERTER FROM CONVERTER_DOC where CREATE_DATETIME >= @CREATE_DATETIME order by CREATE_DATETIME"; |
|
59 |
|
|
60 |
var parameter = new List<sqlParameter>(); |
|
61 |
parameter.Add(new sqlParameter("@CREATE_DATETIME", DateTime.Now.AddDays(-10), System.Data.DbType.DateTime)); |
|
62 |
|
|
63 |
var items = repository.GetAsync<Markus.Service.DataBase.Entities.ConvertDoc>(sql, parameter).GetAwaiter().GetResult(); |
|
64 |
|
|
65 |
foreach (var item in items) |
|
66 |
{ |
|
67 |
Assert.Pass(item.ID); |
|
68 |
} |
|
69 |
} |
|
70 |
} |
|
49 | 71 |
} |
50 | 72 |
} |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseConvertDocPG.cs | ||
---|---|---|
15 | 15 |
public List<string> newConvertDocIDs = new List<string>(); |
16 | 16 |
|
17 | 17 |
|
18 |
[Test, Description("Craete Convert Doc PostgreSQL Test")]
|
|
19 |
public void CreateConvertDoc()
|
|
18 |
[Test, Description("Select Top 10 Convert Doc PostgreSQL Test")]
|
|
19 |
public void SelectTop10ConvertDoc()
|
|
20 | 20 |
{ |
21 | 21 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
22 | 22 |
{ |
내보내기 Unified diff