개정판 4142eefa
issue #0000
공지사항(notice) 수정
- 기존 공지사항 삭제하지 않도록 수정
Change-Id: I5173bcea3472174f25c11587a29964023fc518ab
ID2.Manager/ID2.Manager.Dapper/Repository/AttFileRepository.cs | ||
---|---|---|
31 | 31 |
try |
32 | 32 |
{ |
33 | 33 |
string query = $@" |
34 |
select top 1 * from dbo.AttachFIles where RefID=@RefID and Category=@Category order by CreatedDate"; |
|
34 |
select top 1 * from dbo.AttachFIles where RefID=@RefID and Category=@Category order by CreatedDate desc";
|
|
35 | 35 |
return QueryFirstOrDefault<AttFileInfo>(query, new { RefID = refID, Category = category }); |
36 | 36 |
} |
37 | 37 |
catch (Exception ex) |
... | ... | |
53 | 53 |
foreach (AttFileInfo attFile in attFiles) |
54 | 54 |
{ |
55 | 55 |
attFile.Creator = userId; |
56 |
|
|
57 |
switch (attFile.Category) |
|
58 |
{ |
|
59 |
case "notice": |
|
60 |
query = $@"delete dbo.AttachFIles where RefID=@RefID and Category=@Category"; |
|
61 |
break; |
|
62 |
} |
|
63 |
query += $@" |
|
56 |
query = $@" |
|
64 | 57 |
insert into dbo.AttachFIles (FileID,RefID,Category,FileType,FileName,FilePath,FileExtension,FileData,Creator) |
65 | 58 |
values |
66 | 59 |
( |
... | ... | |
74 | 67 |
,@FileData |
75 | 68 |
,@Creator |
76 | 69 |
)"; |
77 |
|
|
78 | 70 |
base.Execute(query, attFile, transaction); |
79 | 71 |
} |
80 | 72 |
|
내보내기 Unified diff