Пример #1
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;
        }
Пример #2
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;
        }
Пример #3
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;
        }
Пример #4
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;
        }
Пример #5
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;
        }
Пример #6
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;
        }
Пример #7
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;
        }
Пример #8
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;
        }