Beispiel #1
0
        public static GroupModel GetDataSrouce()
        {
            GroupModel _datasource = new GroupModel();
            string meneXmlPath = Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path, "Lib/Data/MainMenu.xml");

            XDocument loadData = XDocument.Load(meneXmlPath);

            DataGroup dataGroup = null;
            var groups = loadData.Root.Elements();
            foreach (var group in groups)
            {
                dataGroup = new DataGroup(group.Attribute("uniqueId").Value, group.Attribute("title").Value, group.Attribute("imagePath").Value);
                foreach (var dataitem in group.Elements())
                {
                    dataGroup.Items.Add(new DataItem(dataitem.Attribute("uniqueId").Value,
                                                     dataitem.Attribute("title").Value,
                                                     dataitem.Attribute("imagePath").Value,
                                                     dataitem.Attribute("content").Value,
                                                     dataGroup));
                }

                _datasource.AllGroups.Add(dataGroup);
            }

            return _datasource;
        }
Beispiel #2
0
        public void InitiateMenu()
        {
            _datasource.AllGroups.Clear();

            var group1 = new DataGroup("Manage Schedule",
                    "Manage Schedule",
                    "Assets/DarkGray.png");

            group1.Items.Add(new DataItem(Lib.SubMenuList.IWPSchedule, "Installation Work Package Schedule", "../../../Assets/manageshedule_default_packageschedule.png", "", group1));
            group1.Items.Add(new DataItem(Lib.SubMenuList.ManpowerLoading, "Manpower Loading", "../../../Assets/manageshedule_default_manpowerloading.png", "", group1));
          //  group1.Items.Add(new DataItem(Lib.SubMenuList.ProjectSchedule, "Project Schedule", "../../../Assets/manageshedule_default_projectschedule.png", "", group1));

            _datasource.AllGroups.Add(group1);            
        }
Beispiel #3
0
        public List<DataGroup> GetGroupedDocument()
        {
            List<DataGroup> grouplist = new List<DataGroup>();

            DataGroup group;
            if (_iwpdrawing.WFP != null && _iwpdrawing.WFP.Count > 0)
            {
                group = new DataGroup("Goup1", "Installed Work Package", "");
                group.Items = _iwpdrawing.WFP.Select(x => new DataItem(x.DocumentID + "WFP", x.Description, x.LocationURL,
                            "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.drawing != null && _iwpdrawing.drawing.Count > 0)
            {
                group = new DataGroup("Group2", WinAppLibrary.Utilities.SPCollectionName.Drawing, "");
                group.Items = _iwpdrawing.drawing.Select(x => new DataItem(x.DrawingID + "Drawing", x.DrawingName,
                    Login.UserAccount.SPURL + "/" + WinAppLibrary.Utilities.SPCollectionName.Drawing + "/" + x.DrawingFileURL,
                    "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.SafetyDoc != null && _iwpdrawing.SafetyDoc.Count > 0)
            {
                group = new DataGroup("Goup3", WinAppLibrary.Utilities.SPCollectionName.SafetyDoc, "");
                group.Items = _iwpdrawing.SafetyDoc.Select(x => new DataItem(x.DocumentID + "Safety", x.Description, x.LocationURL,
                            "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.RFIDoc != null && _iwpdrawing.RFIDoc.Count > 0)
            {
                group = new DataGroup("Group4", WinAppLibrary.Utilities.SPCollectionName.RFIDoc, "");
                group.Items = _iwpdrawing.RFIDoc.Select(x => new DataItem(x.DocumentID + "RFI", x.Description, x.LocationURL,
                            "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.QAQC != null && _iwpdrawing.QAQC.Count > 0)
            {
                group = new DataGroup("Group5", WinAppLibrary.Utilities.SPCollectionName.QAQC, "");
                group.Items = _iwpdrawing.QAQC.Select(x => new DataItem(x.DTOStatus + "QAQC",
                    x.Description, x.LocationURL, "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            return grouplist;
        }
Beispiel #4
0
        public void InitiateProjectModule()
        {
            _datasource.AllGroups.Clear();

            var group1 = new DataGroup("Project",
                    "Project",
                    "Assets/DarkGray.png");

            _datasource.AllGroups.Add(group1);

            var group2 = new DataGroup("Module",
                    "Module",
                    "Assets/LightGray.png");

            _datasource.AllGroups.Add(group2);
        }
Beispiel #5
0
        public void InitiateMenu()
        {
            _datasource.AllGroups.Clear();

            var group = new DataGroup(Lib.MainMenuGroup.CREWTASK,
                    Lib.MainMenuGroup.CREWTASK,
                    "Assets/DarkGray.png");

            group.Items.Add(new DataItem(Lib.MainMenuList.BRASSIN, Lib.MainMenuList.BRASSIN, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_brassin.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.BRASSOUT, Lib.MainMenuList.BRASSOUT, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_brassout.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.TIMEPROGRESS, Lib.MainMenuList.TIMEPROGRESS, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_timeandprogress.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.SAFETY, Lib.MainMenuList.SAFETY, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_safety.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.MANAGETIMESHEET, Lib.MainMenuList.MANAGETIMESHEET, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_managetimeandprogress.png", "", group));
            _datasource.AllGroups.Add(group);

            group = new DataGroup(Lib.MainMenuGroup.ITR,
                    Lib.MainMenuGroup.ITR,
                    "Assets/DarkGray.png");

            group.Items.Add(new DataItem(Lib.MainMenuList.ITRMenu, Lib.MainMenuList.ITRMenu, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/truetask_icon_itr.png", "", group));
            _datasource.AllGroups.Add(group);

            group = new DataGroup(Lib.MainMenuGroup.REPORT,
                    Lib.MainMenuGroup.REPORT,
                    "Assets/DarkGray.png");

            group.Items.Add(new DataItem(Lib.MainMenuList.RFISTATUS, Lib.MainMenuList.RFISTATUS, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_rfistatus.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.IWPREPORT, Lib.MainMenuList.IWPREPORT, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_iwpreport.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.SIWPREPORT, Lib.MainMenuList.SIWPREPORT, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_siwpreport.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.MATERIALREPORT, Lib.MainMenuList.MATERIALREPORT, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_materialreport.png", "", group));
            _datasource.AllGroups.Add(group);

            group = new DataGroup(Lib.MainMenuGroup.VISUAL,
                    Lib.MainMenuGroup.VISUAL,
                    "Assets/DarkGray.png");

            group.Items.Add(new DataItem(Lib.MainMenuList.IWPVIEWER, Lib.MainMenuList.IWPVIEWER, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_iwpviewer.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.SIWPVIEWER, Lib.MainMenuList.SIWPVIEWER, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_siwpviewer.png", "", group));
            group.Items.Add(new DataItem(Lib.MainMenuList.DRAWINGVIEWER, Lib.MainMenuList.DRAWINGVIEWER, WinAppLibrary.Utilities.Helper.BaseUri + "Assets/Menu/crew_drawingviewer.png", "", group));
            _datasource.AllGroups.Add(group);
            
            //_datasource.AllGroups.Add(group2);
        }
        public List<DataGroup> GetGroupITRList()
        {
            //List<RevealProjectSvc.FiwpqaqcDTO> titles = new List<RevealProjectSvc.FiwpqaqcDTO>();
            List<string> titles = new List<string>();
            List<DataGroup> grouplist = new List<DataGroup>();

            DataGroup group;
            //titles = _ITRList.Select(x => x.Group).Distinct().ToList();
            
            group = new DataGroup("Group" + 1, titles[0], "");

            group.Items = _ITRList.Select(y =>
                    new DataItem(y.QAQCFormTemplateID.ToString(), y.QAQCFormCode, y.QAQCFormTypeLUID.ToString(), y.QAQCFormTemplateName.ToString(), group) { }).ToObservableCollection();

            grouplist.Add(group);


            return grouplist;
        }
        public List<DataGroup> GetGroupSharePoint()
        {
            //List<RevealProjectSvc.DocumentDTO> titles = new List<RevealProjectSvc.DocumentDTO>();
            List<string> titles = new List<string>();
            List<DataGroup> grouplist = new List<DataGroup>();

            DataGroup group;
            titles = _Document.Select(x => x.Group).Distinct().ToList();

            for (int i = 0; i < titles.Count(); i++)
            {
                group = new DataGroup("Group" + i.ToString(), titles[i], "");

                group.Items = _Document.Where(x => x.Group == titles[i]).Select(y =>
                        new DataItem(y.SPCollectionID.ToString(), y.Group, y.LocationURL.ToString(), y.Description.ToString(), group) { }).ToObservableCollection();

                grouplist.Add(group);
            }

            return grouplist;
        }
Beispiel #8
0
        public List<DataGroup> GetGroupedDocument(string wfpTitle)
        {
            List<DataGroup> grouplist = new List<DataGroup>();
            
            DataGroup group;
            if (_iwpdrawing.documents != null && _iwpdrawing.documents.Count > 0)
            {
                group = new DataGroup("Goup1", wfpTitle, "");
                group.Items = _iwpdrawing.documents.Where(x => x.FileCategory == DataLibrary.Utilities.FileCategory.REPORT && x.LocationURL.ToString().LastIndexOf(".jpg") >-1).OrderBy(x=> Convert.ToInt32(x.SortOrder))
                    .Select(x => new DataItem(x.DocumentID + "WFP",  x.Description, x.LocationURL.Replace("\\\\", "/").Replace("\\", "/"), "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.drawings != null && _iwpdrawing.drawings.Count > 0)
            {
                 group = new DataGroup("Group2", DataLibrary.Utilities.CollectionName.DRAWING, "");
                 group.Items = _iwpdrawing.drawings.Where(x=> x.DrawingFileURL.ToString().LastIndexOf(".jpg")> -1).Select(x => new DataItem(x.DrawingID + "Drawing", x.DrawingName, x.DrawingFileURL.Replace("\\\\", "/").Replace("\\", "/"), "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.documents != null && _iwpdrawing.documents.Count > 0)
            {
                group = new DataGroup("Goup3", DataLibrary.Utilities.CollectionName.SAFETY, "");
                group.Items = _iwpdrawing.documents.Where(x => x.FileCategory == DataLibrary.Utilities.FileCategory.DOCUMENT && x.DocumentTypeLUID == DataLibrary.Utilities.FileType.SAFETY_FORM && x.LocationURL.ToString().LastIndexOf(".jpg") > -1)
                    .Select(x => new DataItem(x.DocumentID + "Safety", x.Description, x.LocationURL.Replace("\\\\", "/").Replace("\\", "/"), "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.documents != null && _iwpdrawing.documents.Count > 0)
            {
                group = new DataGroup("Goup4", DataLibrary.Utilities.CollectionName.ITR, "");
                group.Items = _iwpdrawing.documents.Where(x => x.FileCategory == DataLibrary.Utilities.FileCategory.DOCUMENT && x.DocumentTypeLUID == DataLibrary.Utilities.FileType.ITR && x.LocationURL.ToString().LastIndexOf(".jpg") > -1)
                    .Select(x => new DataItem(x.DocumentID + "ITR", x.Description, x.LocationURL.Replace("\\\\", "/").Replace("\\", "/"), "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.documents != null && _iwpdrawing.documents.Count > 0)
            {
                group = new DataGroup("Goup5", DataLibrary.Utilities.CollectionName.SPEC, "");
                group.Items = _iwpdrawing.documents.Where(x => x.FileCategory == DataLibrary.Utilities.FileCategory.DOCUMENT && x.DocumentTypeLUID == DataLibrary.Utilities.FileType.SPEC )
                    .Select(x => new DataItem(x.DocumentID + "Spec", x.Description, x.LocationURL.Replace("\\\\", "/").Replace("\\", "/"), "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            if (_iwpdrawing.documents != null && _iwpdrawing.documents.Count > 0)
            {
                group = new DataGroup("Goup6", DataLibrary.Utilities.CollectionName.MOC, "");
                group.Items = _iwpdrawing.documents.Where(x => x.FileCategory == DataLibrary.Utilities.FileCategory.DOCUMENT && x.DocumentTypeLUID == DataLibrary.Utilities.FileType.MOC)
                    .Select(x => new DataItem(x.DocumentID + "MOC", x.Description, x.LocationURL.Replace("\\\\", "/").Replace("\\", "/"), "", group) { }).ToObservableCollection();
                grouplist.Add(group);
            }

            return grouplist;
        }
        private void GrouingDrawing(int sortindex)
        {
            List<DataGroup> source = null;
            DataGroup datagroup = null;
            bool isshow = false;

            if (_drawingsource.DrawingPage != null && _drawingsource.DrawingPage.drawing != null)
            {
                switch (sortindex)
                {
                    //Group by CWP
                    case 0:
                        source = _drawingsource.DrawingPage.drawing.GroupBy(x => new { x.CWPName, x.CWPID }).Select(x => datagroup = new DataGroup(x.Key.CWPID.ToString(), x.Key.CWPName, "Assets/semantic_cwp.png")
                        {
                            Items = x.Select(y => new DataItem(y.DrawingID.ToString(), y.DrawingName, y.DrawingFilePath + y.DrawingFileURL, y.Description, datagroup) { }).ToObservableCollection()
                        }).ToList();
                        break;
                    //Group by 
                    case 1:
                        source = _drawingsource.DrawingPage.drawing.GroupBy(x => new { x.CWPName, x.CWPID }).Select(x => datagroup = new DataGroup(x.Key.CWPID.ToString(), x.Key.CWPName, "Assets/semantic_cwp.png")
                        {
                            Items = x.Select(y => new DataItem(y.DrawingID.ToString(), y.DrawingName, y.DrawingFileURL + y.DrawingFilePath, y.Description, datagroup) { }).ToObservableCollection()
                        }).ToList();
                        break;
                    default:
                        datagroup = new DataGroup("Drawing", "", "");
                        datagroup.Items = _drawingsource.DrawingPage.drawing.Select(x =>
                            new DataItem(x.DrawingID.ToString(), x.DrawingName, x.DrawingFilePath + x.DrawingFileURL, x.Description, datagroup) { }).ToObservableCollection();
                        source = new List<DataGroup>();
                        source.Add(datagroup);
                        break;
                }

                isshow = true;
            }
            else
                WinAppLibrary.Utilities.Helper.SimpleMessage("There is no drawings exist.", "Loading Error!");

            cvDrawingList.Source = source;
            /* this.DefaultViewModel["Drawings"] = source;
             this.DrawingSlider.Value = _drawingsource.DrawingPage.CurrentPage;
             this.DrawingSlider.Maxnumber = _drawingsource.DrawingPage.TotalPageCount;
             this.DrawingSlider.SwingShow(isshow);
             this.FlipView.SelectedItem = this.gvDrawing.SelectedItem = null;
             this.gvViewType.SelectedIndex = 0;*/


        }
        private ObservableCollection<DataGroup> GetSortingCategories()
        {
            ObservableCollection<DataGroup> retValue = new ObservableCollection<DataGroup>();

            var group = new DataGroup("Sotring", "Sorting Drawing", "");
            retValue.Add(group);
            retValue[0].Items.Add(new DataItem("DrawingName", "DrawingName", "", "", group));
            retValue[0].Items.Add(new DataItem("DrawingPlantNo", "Plant Number", "", "", group));
            retValue[0].Items.Add(new DataItem("DrawingSubject", "Drawing Title", "", "", group));
            retValue[0].Items.Add(new DataItem("CWPName", "CWP", "", "", group));
            retValue[0].Items.Add(new DataItem("DrawingTypeLUID", "Drawing Type", "", "", group));
            retValue[0].Items.Add(new DataItem("DrawingNo", "Drawing Number", "", "", group));

            return retValue;
        }
Beispiel #11
0
        public List<DataGroup> GetGroupedSchedule()
        {
            List<DataLibrary.ProjectscheduleDTO> titles = new List<DataLibrary.ProjectscheduleDTO>();
            List<DataGroup> grouplist = new List<DataGroup>();

            DataGroup group;

            if (_scheduleJson != null)
            {
                titles = _scheduleJson.Where(x => x.IsWBS == DataLibrary.Utilities.IsWBS.Level3).ToList();
            }

            try
            {
                for (int i = 0; i < titles.Count(); i++)
                {
                    group = new DataGroup("Group" + i.ToString(), titles[i].ProjectScheduleName, "");

                    //group.Items = _scheduleJson.Where(y => y.IsWBS == 3 && titles[i].P6WBSCode == y.P6WBSCode.Split('.')[0]).Select(y =>
                    group.Items = _scheduleJson.Where(y => y.IsWBS == DataLibrary.Utilities.IsWBS.Level4 && titles[i].P6ActivityObjectID == y.P6ParentObjectID).Select(y =>
                            new DataItem(y.ProjectScheduleID.ToString(), y.P6ActivityID + " - " + y.ProjectScheduleName, y.StartDate + "~" + y.FinishDate, y.LeaderId, group) { }).ToObservableCollection();

                    //group.Items = _schedule.Where(y => y.IsWBS == 3
                    //    && titles[i].P6WBSCode == y.P6WBSCode.Substring(0, y.P6WBSCode.LastIndexOf("."))).Select(y =>
                    //        new DataItem(y.ProjectScheduleID.ToString(), y.P6ActivityID + " - " + y.ProjectScheduleName, y.StartDate + "~" + y.FinishDate, y.DepartStructureID.ToString(), group) { }).ToObservableCollection();

                    if (group.Items.Count > 0)
                        grouplist.Add(group);
                }
            }
            catch (Exception e)
            {
                throw e;
            }

            return grouplist;
        }
Beispiel #12
0
 public DataItem(String uniqueId, String title, String imagePath, String content, DataGroup group)
     : base(uniqueId, title, imagePath)
 {
     this._content = content;
     this._group = group;
 }
Beispiel #13
0
        public List<DataGroup> GetGroupedDrawing()
        {
            List<DataGroup> grouplist = new List<DataGroup>();
            DataGroup group;
            group = new DataGroup("Drawing", "", "");
            if (_drawing !=null && _drawing.Count > 0)
            {
                group.Items = _drawing.Select(x =>
                    new DataItem(x.DataID.ToString(), x.DataName, x.ExtraValue1.Replace("\\", "/").Replace("//", "/").Replace("http:","http:/") , "", group) { }).ToObservableCollection();
            }
            grouplist.Add(group);

            return grouplist;
        }
        private void GrouingDrawing(int sortindex)
        {
            List<DataGroup> source = null;
            DataGroup datagroup = null;
            bool isshow = false;

            if (_drawingsource.DrawingPage != null && _drawingsource.DrawingPage.drawing != null)
            {
                switch (sortindex)
                {
                    //Group by CWP
                    case 0:
                        source = _drawingsource.DrawingPage.drawing.GroupBy(x => new { x.CWPName, x.CWPID }).Select(x => datagroup = new DataGroup(x.Key.CWPID.ToString(), x.Key.CWPName, "Assets/semantic_cwp.png")
                        {
                            Items = x.Select(y => new DataItem(y.DrawingID.ToString(), y.DrawingName, y.DrawingFileURL.Replace("\\\\", "/").Replace("\\", "/"), y.Description, datagroup) { }).ToObservableCollection()
                        }).ToList();
                        break;
                    //Group by 
                    case 1:
                        source = _drawingsource.DrawingPage.drawing.GroupBy(x => new { x.CWPName, x.CWPID }).Select(x => datagroup = new DataGroup(x.Key.CWPID.ToString(), x.Key.CWPName, "Assets/semantic_cwp.png")
                        {
                            Items = x.Select(y => new DataItem(y.DrawingID.ToString(), y.DrawingName, y.DrawingFileURL.Replace("\\\\", "/").Replace("\\", "/"), y.Description, datagroup) { }).ToObservableCollection()
                        }).ToList();
                        break;
                    default:
                        datagroup = new DataGroup("Drawing", "", "");
                        datagroup.Items = _drawingsource.DrawingPage.drawing.Where(x=> x.DrawingFileURL.ToString().LastIndexOf(".jpg")> -1).Select(x =>
                            new DataItem(x.DrawingID.ToString(), x.DrawingName, x.DrawingFileURL.Replace("\\\\", "/").Replace("\\", "/"), x.Description, datagroup) { }).ToObservableCollection();
                        source = new List<DataGroup>();
                        source.Add(datagroup);
                        break;
                }

                isshow = true;
            }
            else
                Helper.SimpleMessage("There is no drawings exist.", "Alert!");

            
            this.DefaultViewModel["Drawings"] = source;
            this.DrawingSlider.Value = _drawingsource.DrawingPage.CurrentPage;
            this.DrawingSlider.Maxnumber = _drawingsource.DrawingPage.TotalPageCount.Equals(0) ? 1 : _drawingsource.DrawingPage.TotalPageCount;
            this.DrawingSlider.SwingShow(isshow);
            this.FlipView.SelectedItem = this.gvDrawing.SelectedItem = null;
            this.gvViewType.SelectedIndex = 0;
            
            //((GridView)SemanticZoomDrawing.ZoomedOutView).ItemsSource = cvDrawingList.View.CollectionGroups;
        }