Пример #1
0
        public ITR_Master()
        {
            this.InitializeComponent();
            Serializer = new CControlSerializer();
            DocRepository = new CDocRepository(Windows.Storage.ApplicationData.Current.LocalFolder, "FiwpItrList.xml");
            Doc = new QAQCDoc();

            BaseFolder = Lib.ContentPath.OffModeUserFolder;
            Helper = new WinAppLibrary.Utilities.Helper();

            ProximityHandler = new Lib.ProximityHandler();
            ProximityHandler.OnException += ProximityHandler_OnException;
            ProximityHandler.OnMessage += ProximityHandler_OnMessage;
            
            lvNFCSignList.SelectionChanged += lvNFCSignList_SelectionChanged;
            
         //   uiSlideButton.SetImage(WinAppLibrary.Utilities.Helper.BaseUri + "Assets/stop.png");
          //  uiSlideButton.ContentClick += uiSlideButton_ContentClick;
        }
Пример #2
0
        public async Task<bool> SaveFileDayilyBrassSign(object dtolist, string strkeyvalue)
        {
            bool retValue = false;
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                var xmlstream = helper.EncryptSerializeTo<List<RevealProjectSvc.DailybrasssignDTO>>(dtolist);
                await helper.SaveFileStream(ContentPath.OffModeUserFolder, Lib.ContentPath.BrassSignIn, xmlstream);
                WinAppLibrary.Utilities.Helper.SetValueInStorage(Lib.HashKey.Key_CrewBrassIn, strkeyvalue);

                retValue = true;
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, strkeyvalue);
                throw e;
            }

            return retValue;
        }
Пример #3
0
        public async Task<bool> SaveFileLoginAccount(object dtolist, string strkeyvalue)
        {
            bool retValue = false;
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                var xmlstream = helper.EncryptSerializeTo<RevealUserSvc.MobileLoginDTO>(dtolist);
                await helper.SaveFileStream(ContentPath.OffModeLoginFolder, Lib.ContentPath.LoginAccount, xmlstream);
                WinAppLibrary.Utilities.Helper.SetValueInStorage(Lib.HashKey.Key_LoginAccount, strkeyvalue);

                retValue = true;
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, strkeyvalue);
                throw e;
            }

            return retValue;
        }
Пример #4
0
        public async Task<bool> SaveProjectModule(int curproject, string curdiscipline)
        {
             bool retValue = false;
             WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

             try
             {
                 var projects = this.GetAllProject();
                 var modules = this.GetAllModule();

                 //Save project
                 var xmlstream = helper.EncryptHashSerializeTo<List<DataItem>>(projects);
                 await helper.SaveFileStream(ContentPath.OffModeFolder, Lib.ContentPath.ProjectSource, xmlstream);

                 //Save Module
                 xmlstream = helper.EncryptHashSerializeTo<List<DataItem>>(modules);
                 await helper.SaveFileStream(ContentPath.OffModeFolder, Lib.ContentPath.ModuleSource, xmlstream);

                 WinAppLibrary.Utilities.Helper.SetValueInStorage(Lib.HashKey.Key_Project, curproject);
                 WinAppLibrary.Utilities.Helper.SetValueInStorage(Lib.HashKey.Key_Module, curdiscipline);
             }
             catch (Exception e)
             {
                 helper.ExceptionHandler(e, "SaveProjectModule");
                 throw e;
             }

             return retValue;
        }
Пример #5
0
        public async Task<bool> SaveToQaqcformtemplate(List<QaqcformtemplateDTO> dto, Windows.Storage.StorageFolder _path, string _filename)
        {
            bool retValue = false;
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                var xmlstream = FormSerialize.EncryptHashSerializeTo<List<QaqcformtemplateDTO>>(dto);
                retValue =  await helper.SaveFileStream(_path, _filename, xmlstream);
                
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "SaveToQaqcformtemplate");
                throw e;
            }

            return retValue;
        }
Пример #6
0
        public async Task<List<QaqcformtemplateDTO>> LoadToQaqcformtemplate()
        {
            List<QaqcformtemplateDTO> filedto = new List<QaqcformtemplateDTO>();
            try
            {
                if (BaseFolder.GetFileAsync(Lib.ITRList.DownloadList) != null)
                {
                    WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();
                    var stream = await helper.GetFileStream(BaseFolder, Lib.ITRList.DownloadList);
                    filedto = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealProjectSvc.QaqcformtemplateDTO>>(stream);
                }
                else
                {
                    WinAppLibrary.Utilities.Helper.SimpleMessage("File Download First!", "Error");
                }
            }
            catch (Exception e)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(e, "LoadToQaqcformtemplate");
                throw e;
            }

            return filedto;
        }
Пример #7
0
        private async Task<Dictionary<string, RevealUserSvc.MobileLoginDTO>> GetLoginUserInfo()
        {
            Dictionary<string, RevealUserSvc.MobileLoginDTO> retValue = new Dictionary<string, RevealUserSvc.MobileLoginDTO>();
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                //Get Crew BrassSignIn List
                var stream = await helper.GetFileStream(Lib.ContentPath.OffModeLoginFolder, Lib.ContentPath.LoginAccount);
                var list = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<RevealUserSvc.MobileLoginDTO>(stream);
                retValue.Add(Lib.HashKey.Key_LoginAccount, list);
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "LoginInfo");
                throw e;
            }

            return retValue;
        }
Пример #8
0
        private async Task<Dictionary<string, List<RevealCommonSvc.ComboBoxDTO>>> GetGrouping()
        {
            Dictionary<string, List<RevealCommonSvc.ComboBoxDTO>> retValue = new Dictionary<string, List<RevealCommonSvc.ComboBoxDTO>>();
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                //Get CWP
                var stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.GroupingCWP);
                var list = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealCommonSvc.ComboBoxDTO>>(stream);
                retValue.Add(HashKey.Key_CWP, list);
                //Get FIWP
                stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.GroupingFIWP);
                list = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealCommonSvc.ComboBoxDTO>>(stream);
                retValue.Add(HashKey.Key_FIWP, list);
                //Get Drawing Type
                stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.GroupingDrawingType);
                list = await helper.EncryptDeserializeFrom<List<RevealCommonSvc.ComboBoxDTO>>(stream);
                retValue.Add(HashKey.Key_DrawingType, list);
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "GetGrouping");
                throw e;
            }

            return retValue;
        }
Пример #9
0
        private async void RemoveITR()
        {
            List<QaqcformDTO> removeDto = new List<QaqcformDTO>();
            List<QaqcformtemplateDTO> forKeep =new List<QaqcformtemplateDTO>();
            List<QaqcformtemplateDTO> forRemove = new List<QaqcformtemplateDTO>();
            string filename = "";
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                if (gvDocument.SelectedItems.Count > 0)
                {
                    List<QaqcformtemplateDTO> targets = (List<QaqcformtemplateDTO>)gvDocument.SelectedItems;

                    if (_ofiles.Count <= 0)
                    {
                        return;
                    }

                    forRemove = _ofiles.Intersect(targets).ToList();  // 삭제
                    forKeep = _ofiles.Except(targets).ToList();  // 유지

                    foreach (QaqcformtemplateDTO data in _ofiles)
                    {
                        if (targets.Contains(data) == true)
                        {
                            QaqcformDTO dto = new QaqcformDTO();
                            filename = data.QAQCFormTemplateID.ToString() + "_" + data.QAQCTypeLUID.ToString() + ".xml";
                            dto = await LoadToQaqcform(filename);
                            dto.UpdatedDate = DateTime.Now;
                            dto.UpdatedBy = Login.UserAccount.UserName;
                            dto.DTOStatus = (int)WinAppLibrary.Utilities.RowStatus.Delete;  // QaqcformDTO Delete mark
                            dto.QaqcfromDetails.Select(c => { c.DTOStatus = (int)WinAppLibrary.Utilities.RowStatus.Delete; return c; });  // QaqcformdetailDTO Delete mark

                            removeDto.Add(dto);

                            data.DTOStatus = (int)WinAppLibrary.Utilities.RowStatus.Delete;
                            data.QAQCFormCode = "3";  // Status for Submit

                            // Update local file
                            await SaveToQaqcForm(dto, BaseFolder, filename);
                        }
                    }

                    switch (Login.LoginMode)
                    {
                        // OnMode일 때 서버로 내용 전달하고 file 삭제 / List 갱신
                        case WinAppLibrary.UI.LogMode.OnMode:
                            //Save To Server
                            await _FillOutSubmitITR.SaveQaqcformForSubmit(removeDto);

                            // Delete files
                            foreach (QaqcformtemplateDTO item in forRemove)
                            {
                                filename = item.QAQCFormTemplateID.ToString() + "_" + item.QAQCTypeLUID.ToString() + ".xml";
                                await helper.DeleteFileStream(BaseFolder, filename);
                            }

                            // Update for keep FileList
                            await SaveToQaqcformtemplate(forKeep, BaseFolder, Lib.ITRList.DownloadList);
                            break;
                        case WinAppLibrary.UI.LogMode.OffMode:
                            // Update for All FileList
                            await SaveToQaqcformtemplate(_ofiles, BaseFolder, Lib.ITRList.DownloadList);
                            break;
                    }

                    BindList();

                    WinAppLibrary.Utilities.Helper.SimpleMessage("Remove Complete", "Complete!");
                }
            }
            catch (Exception ex)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(ex, "btnRemove_Click");
            }
        }
Пример #10
0
        public async Task<QaqcformDTO> LoadToQaqcform(string filename)
        {
            QaqcformDTO filedto = new QaqcformDTO();
            try
            {
                if (BaseFolder.GetFileAsync(filename) != null)
                {
                    WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();
                    var stream = await helper.GetFileStream(BaseFolder, filename);
                    filedto = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<RevealProjectSvc.QaqcformDTO>(stream);
                }
                else
                {
                    WinAppLibrary.Utilities.Helper.SimpleMessage("Not Found Download File", "Error");
                }
            }
            catch (Exception e)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(e, "LoadToQaqcform");
                throw e;
            }

            return filedto;
        }
Пример #11
0
        private async Task<Dictionary<string, List<RevealProjectSvc.ToolboxsignDTO>>> GetToolboxinList()
        {
            Dictionary<string, List<RevealProjectSvc.ToolboxsignDTO>> retValue = new Dictionary<string, List<RevealProjectSvc.ToolboxsignDTO>>();
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                //Get ToolboxIn List
                var stream = await helper.GetFileStream(Lib.ContentPath.OffModeUserFolder, Lib.ContentPath.ToolBoxTalk);
                var list = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealProjectSvc.ToolboxsignDTO>>(stream);
                retValue.Add(Lib.HashKey.Key_ToolboxIn, list);
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "GetGrouping-ToolboxIn");
                throw e;
            }

            return retValue;
        }
Пример #12
0
        public async Task<bool> SaveDrawingOption(Dictionary<string, ObservableCollection<RevealCommonSvc.ComboBoxDTO>> options,
            ObservableCollection<RevealProjectSvc.DocumentnoteDTO> notes,
            string engtag, string title, string sortoption)
        {
            bool retValue = false;
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                Stream xmlstream = helper.EncryptSerializeTo<List<RevealCommonSvc.ComboBoxDTO>>(options[HashKey.Key_CWP].ToList());
                await helper.SaveFileStream(ContentPath.OffModeFolder, ContentPath.GroupingCWP, xmlstream);

                xmlstream = helper.EncryptSerializeTo<List<RevealCommonSvc.ComboBoxDTO>>(options[HashKey.Key_FIWP].ToList());
                await helper.SaveFileStream(ContentPath.OffModeFolder, ContentPath.GroupingFIWP, xmlstream);

                xmlstream = helper.EncryptSerializeTo<List<RevealCommonSvc.ComboBoxDTO>>(options[HashKey.Key_DrawingType].ToList());
                await helper.SaveFileStream(ContentPath.OffModeFolder, ContentPath.GroupingDrawingType, xmlstream);

                xmlstream = helper.EncryptSerializeTo<ObservableCollection<RevealProjectSvc.DocumentnoteDTO>>(notes);
                await helper.SaveFileStream(ContentPath.OffModeFolder, ContentPath.DocumentNote, xmlstream);

                WinAppLibrary.Utilities.Helper.SetValueInStorage(HashKey.Key_EngTag, engtag);
                WinAppLibrary.Utilities.Helper.SetValueInStorage(HashKey.Key_Title, title);
                WinAppLibrary.Utilities.Helper.SetValueInStorage(HashKey.Key_Sort, sortoption);

                //This was banned for temporary until finding alternative as Windows Apps doesn't support serialize Dictionary with List for value.
                //Stream xmlstream = helper.EncryptHashSerializeTo<Dictionary<string, List<WinAppLibrary.RevealCommonSvc.ComboBoxDTO>>>(options);
                //await helper.SaveFileStream(ContentPath.OffModeFolder, ContentPath.GroupingSource, xmlstream);

                retValue = true;
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "SaveDrawingOption");
                throw e;
            }

            return retValue;
        }
Пример #13
0
        public async Task<bool> SaveDrawing(int projectId, int moduleId, string enTag, string title, string sortoption)
        {
            bool retValue = false;
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                Stream xmlstream;
                var drawingpagetotal = await (new Lib.ServiceModel.ProjectModel()).GetDrawingForDrawingViewer(projectId,
                                _grouplist[Lib.HashKey.Key_CWP].Where(x => x.ParentID > 0).Select(x => x.DataID).ToList(),
                                _grouplist[Lib.HashKey.Key_FIWP].Where(x => x.ParentID > 0).Select(x => x.DataID).ToList(),
                                _grouplist[Lib.HashKey.Key_DrawingType].Where(x => x.ParentID > 0).Select(x => x.DataID).ToList(),
                                enTag, title, sortoption, 1);

                if (drawingpagetotal != null && drawingpagetotal.drawing != null && drawingpagetotal.drawing.Count > 0)
                {
                    foreach (var d in drawingpagetotal.drawing)
                    {
                        var stream = await helper.GetImageStreamFromUri(new Uri(d.DrawingFilePath + d.DrawingFileURL));
                        if (stream == null)
                            stream = await helper.GetImageStreamFromUri(new Uri(WinAppLibrary.Utilities.Helper.BaseUri + ContentPath.DefaultDrawing));

                        await helper.SaveFileStream(ContentPath.OffModeFolder, d.DrawingFileURL, stream);
                        d.DrawingFilePath = ContentPath.OffModeFolder.Path + "\\";
                    }
                }

                xmlstream = helper.EncryptSerializeTo<RevealProjectSvc.DrawingPageTotal>(drawingpagetotal);
                await helper.SaveFileStream(ContentPath.OffModeFolder, ContentPath.DrawingSource, xmlstream);

                await SaveDrawingOption(_grouplist, _documentnote, enTag, title, sortoption);
                retValue = true;
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "SaveDrawing");
                throw e;
            }

            return retValue;
        }
Пример #14
0
        private async Task<ObservableCollection<RevealProjectSvc.DocumentnoteDTO>> GetDocumentNote()
        {
            ObservableCollection<RevealProjectSvc.DocumentnoteDTO> retValue = new ObservableCollection<RevealProjectSvc.DocumentnoteDTO>();
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                //Get Sticky Note
                var stream = await helper.GetFileStream(ContentPath.OffModeFolder, ContentPath.DocumentNote);
                retValue = await helper.EncryptDeserializeFrom<ObservableCollection<RevealProjectSvc.DocumentnoteDTO>>(stream);
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "GetStickyNote");
                throw e;
            }

            return retValue;
        }
Пример #15
0
        private async Task<ObservableCollection<DataGroup>> GetProjectModuleOffMode()
        {
            try
            {
                WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();
                var stream = await helper.GetFileStream(ContentPath.OffModeFolder, Lib.ContentPath.ProjectSource);
                var projects = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealProjectSvc.ProjectDTO>>(stream);

                stream = await helper.GetFileStream(Lib.ContentPath.OffModeFolder, Lib.ContentPath.ModuleSource);
                var modules = await (new WinAppLibrary.Utilities.Helper()).EncryptDeserializeFrom<List<RevealCommonSvc.ModuleDTO>>(stream);

                SetProjectModuleGroup(projects, modules);

                DataGroup datagroup = _datasource.GetGroup("Project");
                string selected = WinAppLibrary.Utilities.Helper.GetValueFromStorage(Lib.HashKey.Key_Project);
                var item = datagroup.Items.Where(x => x.UniqueId == selected).FirstOrDefault();
                if (item != null)
                    item.Selected = true;

                datagroup = _datasource.GetGroup("Module");
                selected = WinAppLibrary.Utilities.Helper.GetValueFromStorage(Lib.HashKey.Key_Module);
                item = datagroup.Items.Where(x => x.UniqueId == selected).FirstOrDefault();
                if (item != null)
                    item.Selected = true;

                //DataGroup group = _datasource.GetGroup("Project");
                //group.Items.Clear();

                //foreach (var item in projects)
                //    group.Items.Add(item);
                //retValue.Add(group);

                //group = _datasource.GetGroup("Module");
                //group.Items.Clear();

                //foreach (var item in modules)
                //    group.Items.Add(item);
                //retValue.Add(group);

            }
            catch (Exception e)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(e, "GetProjectModuleOffMode");
                throw e;
            }

            return _datasource.AllGroups;
        }
Пример #16
0
        private async void SubmitITR()
        {
            bool retvalue = false;
            List<QaqcformDTO> ReadyDto = new List<QaqcformDTO>();
            List<QaqcformtemplateDTO> NotReadyToSubmit = new List<QaqcformtemplateDTO>();
            List<QaqcformtemplateDTO> ReadyToSubmit = new List<QaqcformtemplateDTO>();
            string filename = "";
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                if (_ofiles.Count > 0)
                {
                    ReadyToSubmit = _ofiles.Where(x => x.QAQCFormCode == "3").ToList();
                    NotReadyToSubmit = _ofiles.Where(x => x.QAQCFormCode != "3").ToList();
                }
                //Search : Ready To Sumbmit List 
                foreach (QaqcformtemplateDTO item in ReadyToSubmit)
                {
                    QaqcformDTO dto = new QaqcformDTO();
                    filename = item.QAQCFormTemplateID.ToString() + "_" + item.QAQCTypeLUID.ToString() + ".xml";
                    dto = await LoadToQaqcform(filename);
                    if (item.DTOStatus != (int)WinAppLibrary.Utilities.RowStatus.Delete)
                    {
                        dto.UpdatedDate = DateTime.Now;
                        dto.UpdatedBy = Login.UserAccount.UserName;
                        dto.IsSubmitted = 1;  //0=Download / 1=Submit
                        dto.DTOStatus = (int)WinAppLibrary.Utilities.RowStatus.Update;
                    }
                    ReadyDto.Add(dto);
                }

                //Save To Server
                retvalue = await _FillOutSubmitITR.SaveQaqcformForSubmit(ReadyDto);

                //Delete Files
                foreach (QaqcformtemplateDTO item in _ofiles.Where(x => x.QAQCFormCode == "3"))
                {
                    filename = item.QAQCFormTemplateID.ToString() + "_" + item.QAQCTypeLUID.ToString() + ".xml";
                    await helper.DeleteFileStream(BaseFolder, filename);
                }

                //Update FileList
                await SaveToQaqcformtemplate(NotReadyToSubmit, BaseFolder, Lib.ITRList.DownloadList);

                BindList();

                WinAppLibrary.Utilities.Helper.SimpleMessage("Submit Complete", "Complete!");
            }
            catch (Exception ex)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(ex, "SubmitITR");
            }
                        
        }
Пример #17
0
        public async Task<bool> SaveProjectModuleFull(int curproject, int curmodule)
        {
            bool retValue = false;
            WinAppLibrary.Utilities.Helper helper = new WinAppLibrary.Utilities.Helper();

            try
            {
                var projects = await (new ServiceModel.ProjectModel()).GetAllProject();
                var modules = await (new ServiceModel.CommonModel()).GetAllModule();

                //Save project
                var xmlstream = helper.EncryptSerializeTo<List<RevealProjectSvc.ProjectDTO>>(projects);
                await helper.SaveFileStream(ContentPath.OffModeFolder, Lib.ContentPath.ProjectSource, xmlstream);

                //Save Module
                xmlstream = helper.EncryptSerializeTo<List<RevealCommonSvc.ModuleDTO>>(modules);
                await helper.SaveFileStream(ContentPath.OffModeFolder, Lib.ContentPath.ModuleSource, xmlstream);

                WinAppLibrary.Utilities.Helper.SetValueInStorage(Lib.HashKey.Key_Project, curproject);
                WinAppLibrary.Utilities.Helper.SetValueInStorage(Lib.HashKey.Key_Module, curmodule);
            }
            catch (Exception e)
            {
                helper.ExceptionHandler(e, "SaveProjectModuleFull");
                throw e;
            }

            return retValue;
        }
Пример #18
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<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;
        }