프로젝트

일반

사용자정보

개정판 ff990784

IDff990784cede17a522d95a52aa7b5097c296ade2
상위 fb735d21
하위 9ca8730b

유성호이(가) 일년 이상 전에 추가함

issue #0000
- document 저장 성공 시 markus document 저장 하도록 수정
- document no 중복 체크(서버체크)

Change-Id: Id4a5a4f91041447d0080ce8b45e15139a0609a1c

차이점 보기:

ID2.Manager/ID2.Manager.Controller/Controllers/DocumentController.cs
138 138
            }
139 139
        }
140 140

  
141
        public int ExistsDocument(string projectGroupID, List<string> newDwgNos)
142
        {
143
            try
144
            {
145
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
146
                {
147
                    return rep.ExistsDocument(projectGroupID, newDwgNos);
148
                }
149
            }
150
            catch (Exception ex)
151
            {
152
                throw ex;
153
            }
154
        }
155

  
141 156
        public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList, string userId)
142 157
        {
143 158
            try
ID2.Manager/ID2.Manager.Dapper/Repository/BaseRepository.cs
220 220

  
221 221
            return await _DbConnection.ExecuteAsync(SQL, parameters, transaction, commandType: commandType);
222 222
        }
223
        public T ExecuteScalar<T>(string query, object param)
224
        {
225
            if (this._DbConnection.State != ConnectionState.Open)
226
            {
227
                this._DbConnection.Open();
228
            }
229

  
230
            return this._DbConnection.ExecuteScalar<T>(query, param);
231
        }
232

  
223 233

  
224 234
        public T ExecuteScalar<T>(string query, object param, IDbTransaction dbTran)
225 235
        {
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs
247 247
            }
248 248
        }
249 249

  
250
        public int ExistsDocument(string projectGroupID, List<string> newDwgNos)
251
        {
252
            var dynamicParameters = new DynamicParameters();
253
            StringBuilder sbWhere = new StringBuilder();
254
            var parameters = new Dictionary<string, object>();
255
            if (!string.IsNullOrEmpty(projectGroupID))
256
            {
257
                sbWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID=@RefGroupID) ");
258
                parameters.Add("RefGroupID", projectGroupID);
259
            }
260

  
261
            if (newDwgNos.Count > 0)
262
            {
263
                string dwgNoList = string.Join("','", newDwgNos.Where(x => !string.IsNullOrEmpty(x)).Select(x => x).ToList());
264

  
265
                if (dwgNoList.Length > 0)
266
                {
267
                    if (!string.IsNullOrEmpty(projectGroupID))
268
                    {
269
                        sbWhere.Append($@" and doc.DocumentNo in ('{dwgNoList}') ");
270
                    }
271
                }
272
            }
273

  
274
            try
275
            {
276
                string query = $@"
277
select   count(*) cnt
278
from     dbo.Documents doc
279
where    doc.IsDeleted=0 {sbWhere}";
280

  
281
                if (parameters.Count > 0)
282
                {
283
                    dynamicParameters.AddDynamicParams(parameters);
284
                }
285

  
286
                return ExecuteScalar<int>(query, dynamicParameters);
287
            }
288
            catch (Exception ex)
289
            {
290
                throw ex;
291
            }
292
        }
293

  
250 294
        public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList, string userId)
251 295
        {
252 296
            bool isSuccess = false;
ID2.Manager/ID2.Manager/Main.cs
1802 1802
            {
1803 1803
                if (RadMessageBox.Show("Do you want to Save?", Globals.Name, MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
1804 1804
                {
1805
                    #region document no 중복 유효성 체크
1806
                    int dupDwgNoCount = 0;
1807
                    List<string> newDwgNos =  this.documents.Where(x => string.IsNullOrEmpty(x.DocID)).Select(x => x.DocumentNo).ToList();
1808
                    if (newDwgNos.Count > 0)
1809
                    {
1810
                        dupDwgNoCount = new DocumentController().ExistsDocument(informations.ActiveProject.ProjectID, newDwgNos);
1811
                    }
1812

  
1813
                    if (dupDwgNoCount > 0)
1814
                    {
1815
                        RadMessageBox.Show($"Duplicate Dwg No exists.({dupDwgNoCount})", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
1816
                        return;
1817
                    }
1818
                    #endregion
1819

  
1805 1820
                    var worker = new SetDocumentsWorker(this.documents, this.orgDocuments, this.radGridViewDocuments);
1806 1821
                    worker.OnWorkCompletedHandler += (e) =>
1807 1822
                    {
1808
                        bool result = (bool)e.Result;
1809

  
1810
                        bool markusResult = new MarkusInfoController().SetMarkusInfo(this.documents);
1823
                        bool result = false;
1824
                        bool markusResult = false;
1825
                        bool markusMembersResult = false;
1811 1826

  
1812
                        bool markusMembersResult = new MarkusInfoController().SetMembers(informations.UserList);
1827
                        result = (bool)e.Result;
1828
                        if (result)
1829
                        {
1830
                            markusResult = new MarkusInfoController().SetMarkusInfo(this.documents);
1831
                            markusMembersResult = new MarkusInfoController().SetMembers(informations.UserList);
1832
                        }
1813 1833

  
1814 1834
                        if (result && markusResult && markusMembersResult)
1815 1835
                        {

내보내기 Unified diff

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