public async Task<RevealProjectSvc.DrawingPageTotal> GetDrawingForDrawingViewer(int projectId, List<int> cwpIds, List<int> fiwpIds, List<int> drawingtypes, string enTag, string title, string sortoption, int curpage) { RevealProjectSvc.DrawingPageTotal retValue = new RevealProjectSvc.DrawingPageTotal(); try { RevealProjectSvc.ProjectServiceClient project = ServiceHelper.GetServiceClient<RevealProjectSvc.ProjectServiceClient>(ServiceHelper.ProjectService); retValue = await project.GetDrawingForDrawingViewerAsync(Helper.DBInstance, projectId, cwpIds.ToList(), fiwpIds.ToList(), drawingtypes.ToList(), enTag, title, sortoption, curpage); await project.CloseAsync(); } catch (Exception e) { _helper.ExceptionHandler(e, "GetDrawingForDrawingViewer"); } return retValue; }
public async Task<bool> GetDrawingOffMode(int curpage) { bool retValue = false; WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper(); try { if (_drawingpage_off == null) { var stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.DrawingSource); _drawingpage_off = await helper.EncryptDeserializeFrom<RevealProjectSvc.DrawingPageTotal>(stream); } if (_drawingpage_off != null && _drawingpage_off.drawing != null) { int from = (int)Math.Min(Math.Floor(_drawingpage_off.drawing.Count / (double)ItemCount), curpage - 1); int count = (int)Math.Min(_drawingpage_off.drawing.Count - from * ItemCount, ItemCount); _drawingpage.drawing = _drawingpage_off.drawing.GetRange(from * ItemCount, count); _drawingpage.CurrentPage = from + 1; _drawingpage.TotalPageCount = (int)Math.Ceiling(_drawingpage_off.drawing.Count / (double)ItemCount); retValue = true; } } catch (Exception e) { helper.ExceptionHandler(e, "GetDrawingOffMode"); throw e; } return retValue; }
public async Task<bool> GetDrawingOnMode(int projectId, List<int> cwpIds, List<int> fiwpIds, List<int> drawingtypes, string enTag, string title, string sortoption, int curpage) { bool retValue = false; _drawingpage = await (new Lib.ServiceModel.ProjectModel()).GetDrawingForDrawingViewer(projectId, cwpIds, fiwpIds, drawingtypes, enTag, title, sortoption, curpage); if (_drawingpage != null) retValue = true; return retValue; }