Exemplo n.º 1
0
        private void Organization()
        {
            vTreeNode _vTreeNode = new vTreeNode(LangCtrl.GetString("mnode_Org", "Organization"))
            {
                ImageIndex = 1,
                Tag        = null
            };

            this.ROOT.Nodes.Add(_vTreeNode);
            vTreeNode _vTreeNode1 = new vTreeNode(LangCtrl.GetString("mnode_Dept", "Departments"))
            {
                ImageIndex = 2,
                Tag        = "Dept_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode1);
            vTreeNode _vTreeNode2 = new vTreeNode(LangCtrl.GetString("mnode_Accounts", "Accounts"))
            {
                ImageIndex = 3,
                Tag        = "Accounts_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode2);
            vTreeNode _vTreeNode3 = new vTreeNode(LangCtrl.GetString("mnode_AD", "Active Directory"))
            {
                ImageIndex = 7,
                Tag        = "AD_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode3);
        }
Exemplo n.º 2
0
        private void menuTree_NodeMouseUp(object sender, vTreeViewMouseEventArgs e)
        {
            vTreeNode node = e.Node;

            if (node.Tag != null)
            {
                string tag  = (string)node.Tag;
                string str  = tag;
                string str1 = str;
                if (str != null)
                {
                    switch (str1)
                    {
                    case "Accounts_Plugin":
                    case "Dept_Plugin":
                    case "Asset_Plugin":
                    case "Cfg_Plugin":
                    case "Cfg_Cloud":
                    case "Cfg_SysParams":
                    case "Cfg_FileMgr":
                    case "Camera_Plugin":
                    case "AD_Plugin":
                    case "Cfg_Email":
                    case "Cfg_License":
                    case "Rpt_Plugin":
                    case "Cut_Plugin":
                    case "Plg_Restore":
                    case "Plg_VisionCamera":
                    case "Plg_ALog":
                    {
                        if (!this._Plugins.ContainsKey(tag))
                        {
                            break;
                        }
                        try
                        {
                            this.PluginPanel.Controls.Clear();
                            IPlugin item = this._Plugins[tag];
                            this.PluginPanel.Controls.Add((Control)item);
                            break;
                        }
                        catch
                        {
                            break;
                        }
                        break;
                    }

                    default:
                    {
                        return;
                    }
                    }
                }
            }
        }
Exemplo n.º 3
0
 private void InitTreeMenu()
 {
     menuTree.Nodes.Clear();
     ROOT = new vTreeNode(LangCtrl.GetString("mnode_Root", "C3 Sentinel Management"))
     {
         ImageIndex = 0,
         Tag        = null
     };
     menuTree.Nodes.Add(this.ROOT);
     Organization();
     Assets();
     Config();
     Logs();
     Reports();
 }
Exemplo n.º 4
0
        private void InitTree()
        {
            vTree.Nodes.Clear();
            NodeRecord nodeRecord = new NodeRecord();

            nodeRecord.Name       = LangCtrl.GetString("node_FilesByDate", "Files By Date Uploaded");
            nodeRecord.RecType    = NodeType.ROOT_NODE;
            nodeRecord.ImgIdx     = 0;
            nodeRecord.FolderPath = string.Empty;
            ROOT            = new vTreeNode(nodeRecord.Name);
            ROOT.ImageIndex = 0;
            ROOT.Tag        = nodeRecord;
            vTree.Nodes.Add(ROOT);
            TreeNode = ROOT.Nodes;
        }
Exemplo n.º 5
0
        private void Assets()
        {
            vTreeNode _vTreeNode = new vTreeNode(LangCtrl.GetString("mnode_Inventory", "Inventory"))
            {
                ImageIndex = 4,
                Tag        = null
            };

            ROOT.Nodes.Add(_vTreeNode);
            vTreeNode _vTreeNode1 = new vTreeNode(LangCtrl.GetString("mnode_Assets", "Assets"))
            {
                ImageIndex = 5,
                Tag        = "Asset_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode1);
        }
Exemplo n.º 6
0
        private void Reports()
        {
            vTreeNode _vTreeNode = new vTreeNode(LangCtrl.GetString("mnode_Reports", "Reports"))
            {
                ImageIndex = 19,
                Tag        = null
            };

            this.ROOT.Nodes.Add(_vTreeNode);
            vTreeNode _vTreeNode1 = new vTreeNode(LangCtrl.GetString("mnode_SysReports", "System Reports"))
            {
                ImageIndex = 20,
                Tag        = "Rpt_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode1);
        }
Exemplo n.º 7
0
        private void Logs()
        {
            vTreeNode _vTreeNode = new vTreeNode(LangCtrl.GetString("mnode_Logs", "Logs"))
            {
                ImageIndex = 17,
                Tag        = null
            };

            ROOT.Nodes.Add(_vTreeNode);
            vTreeNode _vTreeNode1 = new vTreeNode(LangCtrl.GetString("mnode_AccountLogs", "Account Logs"))
            {
                ImageIndex = 18,
                Tag        = "Plg_ALog"
            };

            _vTreeNode.Nodes.Add(_vTreeNode1);
        }
Exemplo n.º 8
0
 private void mnu_NewSetFile_Click(object sender, EventArgs e)
 {
     try
     {
         vTreeNode selectedNode = this.vTree.SelectedNode;
         if (selectedNode.Selected && selectedNode.Depth == 1)
         {
             NodeRecord tag = (NodeRecord)selectedNode.Tag;
             if (!string.IsNullOrEmpty(tag.Name) && (new DataUpload(this.AccountID, tag.Name)).ShowDialog(this) == DialogResult.OK)
             {
                 this.Callback(this, new CmdEventArgs(tag));
             }
         }
     }
     catch
     {
     }
 }
Exemplo n.º 9
0
 public void InitTree(string Title)
 {
     vTree.Nodes.Clear();
     ROOT            = new vTreeNode(Title);
     ROOT.ImageIndex = 0;
     ROOT.Tag        = null;
     vTree.Nodes.Add(this.ROOT);
     TreeNode = this.ROOT.Nodes;
     using (RPM_Account rpmAccount = new RPM_Account())
     {
         Account account = rpmAccount.GetAccount(this.AccountID);
         ROOT.Nodes.Add(new vTreeNode(string.Format("{0} [{1}]", account.ToString(), account.BadgeNumber))
         {
             ImageIndex = 1,
             Tag        = account.Id
         });
     }
 }
Exemplo n.º 10
0
        private void LoadYears()
        {
            string str       = string.Format("{0}\\{1}", Global.RelativePath, Account_ID);
            string uNCServer = Global.UNCServer;

            if (!uNCServer.Contains(":"))
            {
                if (!uNCServer.StartsWith("\\\\"))
                {
                    uNCServer = string.Concat("\\\\", uNCServer);
                }
            }
            else if (uNCServer.Contains(":") && !uNCServer.Contains(":\\"))
            {
                uNCServer = uNCServer.Replace(":", ":\\");
            }
            RootPath = Path.Combine(uNCServer, str);
            if (Directory.Exists(RootPath))
            {
                string[] directories = Directory.GetDirectories(RootPath);
                if (directories.Length > 0)
                {
                    string[] strArrays = directories;
                    for (int i = 0; i < (int)strArrays.Length; i++)
                    {
                        string     str1       = strArrays[i];
                        string     fileName   = Path.GetFileName(str1);
                        NodeRecord nodeRecord = new NodeRecord()
                        {
                            Name       = fileName,
                            ImgIdx     = 1,
                            RecType    = NodeType.YEAR,
                            FolderPath = str1
                        };
                        vTreeNode _vTreeNode = new vTreeNode(fileName)
                        {
                            Tag        = nodeRecord,
                            ImageIndex = 1
                        };
                        ROOT.Nodes.Add(_vTreeNode);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public void InitTree()
        {
            SetLanguage();
            vTree.Nodes.Clear();
            vAcctList.Items.Clear();
            NodeRecord nodeRecord = new NodeRecord();

            nodeRecord.Name    = LangCtrl.GetString("mnode_Dept", "Departments");
            nodeRecord.RecType = NodeType.ROOT_NODE;
            nodeRecord.ImgIdx  = 0;
            nodeRecord.RecIdx  = Guid.Empty;
            ROOT            = new vTreeNode(nodeRecord.Name);
            ROOT.ImageIndex = 0;
            ROOT.Tag        = nodeRecord;
            vTree.Nodes.Add(ROOT);
            TreeNode = ROOT.Nodes;
            if (LoadDepartments() > 0)
            {
                btn_ResetList.Visible = false;
                CheckUnassigned();
            }
            vAcctList.SelectedIndex = -1;
        }
Exemplo n.º 12
0
 private void LoadNodes()
 {
     this.ROOT.Nodes.Clear();
     try
     {
         using (RPM_DataFile rPMDataFile = new RPM_DataFile())
         {
             Guid     accountID = this.AccountID;
             string   text      = this.txtSetID.Text;
             DateTime value     = this.FromDate.Value.Value;
             DateTime?nullable  = this.ToDate.Value;
             foreach (DataFile setList in rPMDataFile.GetSetList(accountID, text, value, nullable.Value))
             {
                 if (string.IsNullOrEmpty(setList.SetName))
                 {
                     continue;
                 }
                 NodeRecord nodeRecord = new NodeRecord()
                 {
                     Name    = setList.SetName,
                     RecType = NodeType.PARENT,
                     ImgIdx  = 1
                 };
                 vTreeNode _vTreeNode = new vTreeNode(nodeRecord.Name)
                 {
                     ImageIndex  = 1,
                     Tag         = nodeRecord,
                     TooltipText = string.Format("{0}\n{1}\n{2}", setList.FileTimestamp, setList.Classification, setList.ShortDesc)
                 };
                 this.ROOT.Nodes.Add(_vTreeNode);
             }
         }
     }
     catch
     {
     }
 }
Exemplo n.º 13
0
 private void InitTree()
 {
     try
     {
         this.vTree.Nodes.Clear();
         NodeRecord nodeRecord = new NodeRecord()
         {
             Name    = LangCtrl.GetString("node_CatSets", "Catalog Sets"),
             RecType = NodeType.ROOT_NODE,
             ImgIdx  = 0,
             RecIdx  = Guid.Empty
         };
         this.ROOT = new vTreeNode(nodeRecord.Name)
         {
             ImageIndex = 0,
             Tag        = nodeRecord
         };
         this.vTree.Nodes.Add(this.ROOT);
         this.TreeNode = this.ROOT.Nodes;
     }
     catch
     {
     }
 }
Exemplo n.º 14
0
        private void Config()
        {
            vTreeNode _vTreeNode = new vTreeNode(LangCtrl.GetString("mnode_Config", "Configuration"))
            {
                ImageIndex = 8,
                Tag        = null
            };

            this.ROOT.Nodes.Add(_vTreeNode);
            vTreeNode _vTreeNode1 = new vTreeNode(LangCtrl.GetString("mnode_DataSets", "Data Sets"))
            {
                ImageIndex = 9,
                Tag        = "Cfg_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode1);
            vTreeNode _vTreeNode2 = new vTreeNode(LangCtrl.GetString("mnode_CameraProfiles", "Camera Profiles"))
            {
                ImageIndex = 13,
                Tag        = "Camera_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode2);
            vTreeNode _vTreeNode3 = new vTreeNode(LangCtrl.GetString("mnode_CUT", "Cite Utility Tool"))
            {
                ImageIndex = 21,
                Tag        = "Cut_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode3);
            vTreeNode _vTreeNode4 = new vTreeNode(LangCtrl.GetString("mnode_VISION", "Vision Camera Tool"))
            {
                ImageIndex = 23,
                Tag        = "Plg_VisionCamera"
            };

            _vTreeNode.Nodes.Add(_vTreeNode4);
            vTreeNode _vTreeNode5 = new vTreeNode(LangCtrl.GetString("mnode_Cloud", "Cloud Storage"))
            {
                ImageIndex = 10,
                Tag        = "Cfg_Cloud"
            };

            _vTreeNode.Nodes.Add(_vTreeNode5);
            vTreeNode _vTreeNode6 = new vTreeNode(LangCtrl.GetString("mnode_System", "System"))
            {
                ImageIndex = 11,
                Tag        = null
            };

            _vTreeNode.Nodes.Add(_vTreeNode6);
            vTreeNode _vTreeNode7 = new vTreeNode(LangCtrl.GetString("mnode_Param", "Parameters"))
            {
                ImageIndex = 12,
                Tag        = "Cfg_SysParams"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode7);
            vTreeNode _vTreeNode8 = new vTreeNode(LangCtrl.GetString("mnode_FileMgr", "File Management"))
            {
                ImageIndex = 14,
                Tag        = "Cfg_FileMgr"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode8);
            vTreeNode _vTreeNode9 = new vTreeNode(LangCtrl.GetString("mnode_Restore", "Restore File"))
            {
                ImageIndex = 22,
                Tag        = "Plg_Restore"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode9);
            vTreeNode _vTreeNode10 = new vTreeNode(LangCtrl.GetString("mnode_EmailSettings", "Email Settings"))
            {
                ImageIndex = 15,
                Tag        = "Cfg_Email"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode10);
            vTreeNode _vTreeNode11 = new vTreeNode(LangCtrl.GetString("mnode_License", "Camera License"))
            {
                ImageIndex = 16,
                Tag        = "Cfg_License"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode11);
        }
Exemplo n.º 15
0
        private void vTree_NodeMouseUp(object sender, vTreeViewMouseEventArgs e)
        {
            switch (e.Node.Depth)
            {
            case 0:
                ClearDateCallback();
                break;

            case 1:
                ClearDateCallback();
                if (e.Node.Nodes.Count != 0)
                {
                    break;
                }
                using (VMContext VMContext = new VMContext())
                {
                    IQueryable <DataFile> source = VMContext.DataFiles.Where(dataFile => dataFile.AccountId == AccountID);
                    Expression <Func <DataFile, int> > selector = dataFile => dataFile.FileAddedTimestamp.Value.Year;
                    using (List <int> .Enumerator enumerator = source.Select(selector).Distinct().ToList().GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            int current = enumerator.Current;
                            e.Node.Nodes.Add(new vTreeNode(string.Format("{0}", current))
                            {
                                ImageIndex = 2,
                                Tag        = current
                            });
                        }
                        break;
                    }
                }

            case 2:
                ClearDateCallback();
                if (e.Node.Nodes.Count != 0)
                {
                    break;
                }
                AccountID = (Guid)e.Node.Parent.Tag;
                YEAR      = (int)e.Node.Tag;
                using (VMContext VMContext = new VMContext())
                {
                    IQueryable <DataFile> source = VMContext.DataFiles.Where(dataFile => dataFile.AccountId == AccountID && dataFile.FileAddedTimestamp.Value.Year == YEAR && dataFile.IsPurged == false);
                    Expression <Func <DataFile, int> > selector = dataFile => dataFile.FileAddedTimestamp.Value.Month;
                    using (List <int> .Enumerator enumerator = source.Select(selector).Distinct().ToList().GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            int current = enumerator.Current;
                            e.Node.Nodes.Add(new vTreeNode(string.Format("{0}", Months[current - 1]))
                            {
                                ImageIndex = 3,
                                Tag        = current
                            });
                        }
                        break;
                    }
                }

            case 3:
                ClearDateCallback();
                if (e.Node.Nodes.Count != 0)
                {
                    break;
                }
                vTreeNode parent1 = e.Node.Parent;
                YEAR      = (int)parent1.Tag;
                AccountID = (Guid)parent1.Parent.Tag;
                MONTH     = (int)e.Node.Tag;
                using (VMContext VMContext = new VMContext())
                {
                    IQueryable <DataFile> source = VMContext.DataFiles.Where(dataFile => dataFile.AccountId == AccountID && dataFile.FileAddedTimestamp.Value.Year == YEAR && dataFile.FileAddedTimestamp.Value.Month == MONTH && dataFile.IsPurged == false);
                    Expression <Func <DataFile, int> > selector = dataFile => dataFile.FileAddedTimestamp.Value.Day;
                    using (List <int> .Enumerator enumerator = source.Select(selector).Distinct().ToList().GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            int       current   = enumerator.Current;
                            DayOfWeek dayOfWeek = new DateTime(YEAR, MONTH, current).DayOfWeek;
                            e.Node.Nodes.Add(new vTreeNode(string.Format("{0} • {1}", current, dayOfWeek))
                            {
                                ImageIndex = 4,
                                Tag        = current
                            });
                        }
                        break;
                    }
                }

            case 4:
                vTreeNode parent2 = e.Node.Parent;
                MONTH = (int)parent2.Tag;
                vTreeNode parent3 = parent2.Parent;
                YEAR      = (int)parent3.Tag;
                AccountID = (Guid)parent3.Parent.Tag;
                int tag = (int)e.Node.Tag;
                if (tag <= 0 || tag > 31)
                {
                    break;
                }
                Callback(new DateTime(YEAR, MONTH, tag, 0, 0, 0));
                break;
            }
        }