Esempio n. 1
0
        //Json 메서드에 pagesize 파라미터 추가되어 있음, 일단 10으로 넘김.
        public async Task<DataLibrary.DrawingPageTotal> GetDrawingForDrawingViewer(int projectId, List<string> cwpIds, List<string> fiwpIds, List<string> drawingtypes, string enTag, string title, string sortoption, int curpage)
        {
            DataLibrary.DrawingPageTotal retValue = new DataLibrary.DrawingPageTotal();
            try
            {
                List<dynamic> param = new List<dynamic>();
                param.Add(projectId);
                param.Add(cwpIds);
                param.Add(fiwpIds);
                param.Add(drawingtypes);
                param.Add(enTag);
                param.Add(title);
                param.Add(sortoption);
                param.Add(curpage);
                param.Add(20);   //pagesize
                var result = await JsonHelper.GetDataAsync<DataLibrary.DrawingPageTotal>("JsonGetDrawingForDrawingViewer", param, JsonHelper.ProjectService);

                retValue = result;
            }
            catch (Exception e)
            {
                _helper.ExceptionHandler(e, "GetDrawingForDrawingViewer");
            }
            return retValue;
        }
Esempio n. 2
0
        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<DataLibrary.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;
        }
Esempio n. 3
0
        public async Task<bool> GetDrawingOnMode(int projectId, List<string> cwpIds, List<string> fiwpIds, List<string> 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;
        }