예제 #1
2
        /// <summary>
        /// 功能菜单树节点赋值
        /// </summary>
        /// <param name="list"></param>
        /// <param name="tree"></param>
        /// <param name="expandFunctionType"></param>
        public static void FillData(List <SysFunction> list, UltraTree tree, string expandFunctionType)
        {
            UltraTreeNode       node  = null;
            TreeNodesCollection nodes = tree.Nodes;

            nodes.Clear();
            //获取根节点(代表系统)
            List <SysFunction> sysFunctions = list.FindAll(f => string.IsNullOrEmpty(f.ParentId));

            foreach (SysFunction sysFun in sysFunctions)
            {
                node      = new UltraTreeNode();
                node.Key  = sysFun.FunctionId;
                node.Text = sysFun.FunctionName;
                node.Tag  = sysFun;
                if (String.Compare(expandFunctionType, sysFun.FunctionType) > 0)
                {
                    node.Expanded = true;
                }
                if (!String.IsNullOrEmpty(sysFun.Image))
                {
                    node.LeftImages.Add(Image.FromFile("./resource/image/mainMenu/" + sysFun.Image + ".png"));
                }
                nodes.Add(node);

                FillData(list, node, expandFunctionType);
            }
        }
        private void InsertDataSet(InputDataSet ids)
        {
            UltraTreeNode dsNode = this.InputTree.Nodes.Add(ids.Key);

            dsNode.Override.ColumnSet = this.InputTree.ColumnSettings.ColumnSets["DataSet"];

            dsNode.Cells[0].Value = ids.Key;
            dsNode.Cells[1].Value = ids.Description;

            dsNode.Tag = 0;

            UltraTreeNode inputParameterNode = dsNode.Nodes.Add();

            inputParameterNode.Tag  = 1;
            inputParameterNode.Text = "Input Parameters";

            foreach (Step s in ids.InputParameters.Steps)
            {
                InsertStep(inputParameterNode, s);
            }

            UltraTreeNode expectedResultNode = dsNode.Nodes.Add();

            expectedResultNode.Tag  = 1;
            expectedResultNode.Text = "Expected Result";

            foreach (Step s in ids.ExpectedValues.Steps)
            {
                InsertStep(expectedResultNode, s);
            }
        }
예제 #3
0
        private void treeViewObjects_MouseUp(object sender, MouseEventArgs e)
        {
            // Show menu only if the right mouse button is clicked.
            if (e.Button == MouseButtons.Right)
            {
                // Point where the mouse is clicked.
                Point p = new Point(e.X, e.Y);

                // Get the node that the user has clicked.
                tNodeNewGrpClicked = treeViewObjects.GetNodeFromPoint(p);
                if (tNodeNewGrpClicked != null)
                {
                    var tagName = Convert.ToString(tNodeNewGrpClicked.Tag);
                    if (tagName == "tables" || tagName == "procs" || tagName == "views" || tagName == "functions" || tagName == "group" || tagName == "root")
                    {
                        treeViewObjects.ActiveNode = tNodeNewGrpClicked;
                        contextMenuStripTreeView.Show(treeViewObjects, p);
                        if (tagName == "group")
                        {
                            removeGroupToolStripMenuItem.Visible = true;
                        }
                        else
                        {
                            removeGroupToolStripMenuItem.Visible = false;
                        }
                    }
                    else if (tagName == "table")
                    {
                        contextMenuStripActions.Show(treeViewObjects, p);
                    }
                }
            }
        }
예제 #4
0
        protected void AddSelectedItems(UltraTreeNode parentNode)
        {
            switch (parentNode.CheckedState)
            {
            case CheckState.Checked:
            {
                if (parentNode.Key.StartsWith("Applications|"))
                {
                    if (parentNode.Key.Split('|').Length == 4)
                    {
                        parentNode.Key = parentNode.Key.Substring(0, parentNode.Key.LastIndexOf("|"));
                    }
                }

                UltraListViewItem lvi = new UltraListViewItem(parentNode.Key, null);
                //lvi.Appearance.Image = parentNode.LeftImages[0];
                lvi.Appearance.Image = GetIcon(parentNode);
                lvi.Tag = parentNode.Tag;
                lvSelectedItems.Items.Add(lvi);
            }
            break;

            case CheckState.Indeterminate:
                foreach (UltraTreeNode childNode in parentNode.Nodes)
                {
                    AddSelectedItems(childNode);
                }
                break;
            }

            return;
        }
예제 #5
0
        private void Delete()
        {
            if (ultraTree1.ActiveNode != null)
            {
                string functionId = ultraTree1.ActiveNode.Key;
                if (ultraTree1.ActiveNode.Nodes.Count > 0)
                {
                    MetroMessageBox.Show(this, "请先删除下级菜单!");
                    return;
                }

                if (MetroMessageBox.Show(this, "是否确认删除" + ultraTree1.ActiveNode.Text + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    this.Update(Globals.FUNCTION_SERVICE_NAME, "delete", new object[] { functionId });
                    UltraTreeNode pNode = ultraTree1.ActiveNode.Parent;
                    Refresh();
                    if (pNode != null)
                    {
                        Refresh();
                        UltraTreeNode node = this.ultraTree1.GetNodeByKey(pNode.Key);
                        ultraTree1.ActiveNode = node;
                        ExpandParents(node);
                    }
                }
            }
        }
예제 #6
0
        private string AppendTreeText(UltraTreeNode node, NodeTextAppendType type)
        {
            List <string> list    = new List <string>();
            UltraTreeNode tmpNode = null;

            switch (type)
            {
            case NodeTextAppendType.Parent:
                if (node.Parent != null)
                {
                    tmpNode = node.Parent.Parent;
                }
                break;

            case NodeTextAppendType.Current:
                tmpNode = node.Parent;
                break;

            case NodeTextAppendType.Child:
                tmpNode = node;
                break;
            }
            if (tmpNode != null)
            {
                do
                {
                    list.Insert(0, tmpNode.Text);
                }while ((tmpNode = tmpNode.Parent) != null);
            }

            return(string.Join("→", list.ToArray()));
        }
예제 #7
0
        /// <summary>
        /// Initializes a new <see cref="ExplorerBarItemOwnerUIAdapter"/>
        /// </summary>
        /// <param name="node">Node whose owning collection will be updated with any added elements.</param>
        public TreeNodeOwnerUIAdapter(UltraTreeNode node)
            : base(node.ParentNodesCollection)
        {
            Guard.ArgumentNotNull(node, "node");

            this.node = node;
        }
예제 #8
0
        public static UltraTreeNode CreateKeyedTreeNode(UltraTreeNode parentNode, Asset forAsset)
        {
            string key = String.Format("{0}|{1}|{2}", forAsset.AssetID, parentNode.Key, forAsset.AssetIdentifier);

            //string key = String.Format("{0}|{1}", parentNode.Key, forAsset.AssetIdentifier);
            return(new UltraTreeNode(key, forAsset.Name));
        }
예제 #9
0
 private void createFolder()
 {
     if (_view.tvwProject.SelectedNodes != null && _view.tvwProject.SelectedNodes.Count > 0)
     {
         UltraTreeNode node = _view.tvwProject.SelectedNodes[0];
         if (node is ProjectNode)
         {
             var           pNode  = node as ProjectNode;
             DirectoryInfo dir    = pNode.FolderObject;
             DirectoryInfo newdir = dir.CreateSubdirectory("New Folder");
             var           foNode = new FolderNode(newdir);
             node.Nodes.Add(foNode);
             //_view.tvwProject.Nodes.
             foNode.BeginEdit();
             Novel8rProjectHandler.Instance.AddFolder(newdir.FullName);
         }
         else if (node is FolderNode)
         {
             ProjectNode   pn         = getProjectNode(node);
             var           foNode     = node as FolderNode;
             string        dirName    = foNode.FullPath;
             var           sb         = new StringBuilder(dirName);
             string        newdirname = pn.FolderObject + sb.Replace(pn.Name, "", 0, pn.Name.Length).ToString();
             var           dir        = new DirectoryInfo(newdirname);
             DirectoryInfo newdir     = dir.CreateSubdirectory("New Folder");
             var           fNode      = new FolderNode(newdir);
             node.Nodes.Add(fNode);
             fNode.BeginEdit();
             Novel8rProjectHandler.Instance.AddFolder(newdir.FullName);
         }
     }
 }
예제 #10
0
        private void tvwProject_ValidateLabelEdit(object sender, ValidateLabelEditEventArgs e)
        {
            if (e.LabelEditText.Equals(e.OriginalText))
            {
                e.Cancel = true;
            }
            else
            {
                UltraTreeNode node    = e.Node;
                string        newName = e.LabelEditText;
                string        oldName = e.OriginalText;

                if (node is ProjectNode)
                {
                    var pn = node as ProjectNode;
                    pn.Name = newName;
                }
                else if (node is FolderNode)
                {
                    ProjectNode pn     = getProjectNode(node);
                    var         foNode = node as FolderNode;
                    //string newFileName = foNode.FullPath + @"\" + newName;
                    string dirName     = foNode.Parent.FullPath;
                    var    sb          = new StringBuilder(dirName);
                    string newdirname  = pn.FolderObject + sb.Replace(pn.Name, "", 0, pn.Name.Length).ToString();
                    string oldFileName = newdirname + @"\" + oldName;
                    string newFileName = newdirname + @"\" + newName;
                    //                    string newFileName = fn.FolderObject.Parent.FullName + @"\" + newName;
                    // string newFileName2 = fn.FolderObject.Parent + @"\" + newName;
                    //           fn.FolderObject.MoveTo(newFileName);
                    var fi = new DirectoryInfo(oldFileName);
                    fi.MoveTo(newFileName);

                    Novel8rProjectHandler.Instance.RenameFolder(oldFileName, newFileName);

                    // TODO funkar inte, alla filer måste döpas om
                    //  ProjectHandler.Instance.RemoveFile(oldName);
                    //   ProjectHandler.Instance.AddFile(newName);
                }
                else if (node is FileNode)
                {
                    ProjectNode pn            = getProjectNode(node);
                    var         fiNode        = node as FileNode;
                    string      dirName       = fiNode.Parent.FullPath;
                    var         sb            = new StringBuilder(dirName);
                    string      newReldirname = sb.Replace(pn.Name, "", 0, pn.Name.Length).ToString();
                    string      newdirname    = pn.FolderObject + newReldirname;
                    //   string newRelFilename = newReldirname + @"\" + newName;
                    //   string oldRelFilename = newReldirname + @"\" + oldName;
                    string oldFileName = newdirname + @"\" + oldName;
                    var    fi          = new FileInfo(oldFileName);
                    string newFileName = newdirname + @"\" + newName;
                    fi.MoveTo(newFileName);

                    Novel8rProjectHandler.Instance.RenameFile(oldFileName, newFileName);
                }

                handleProjectModifiedStatus();
            }
        }
예제 #11
0
        /// <summary>
        /// Initialize the 'All Operating Systems' node of the applications tree
        /// </summary>
        private void InitializeAllOperatingSystems()
        {
            // Add the entries to the tree
            try
            {
                DataTable       dt = new ApplicationsDAO().GetOperatingSystems();
                UltraTreeNode   osNode;
                UltraTreeNode[] nodes = new UltraTreeNode[dt.Rows.Count];
                InstalledOS     theOS;

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    theOS = new InstalledOS(dt.Rows[i]);

                    osNode     = new UltraTreeNode(theOS.Name + "|" + theOS.Version, theOS.Name);
                    osNode.Tag = theOS;
                    osNode.Override.ShowExpansionIndicator = ShowExpansionIndicator.CheckOnExpand;
                    nodes[i] = osNode;
                }

                // Add the OS node (and it's sub-nodes to the tree
                explorerView.AllOperatingSystemsNode.Nodes.AddRange(nodes);
            }

            catch (Exception ex)
            {
                //MessageBox.Show("An exception occurred while populating the list of Operating Systems [InitializeAllOperatingSystems], the exception text was " + ex.Message);
                logger.Error(ex.Message);
            }
        }
예제 #12
0
        private static void FillData(List <SysFunction> list, UltraTreeNode node, String expandFunctionType)
        {
            UltraTreeNode      subNode = null;
            List <SysFunction> funs    = list.FindAll(f => f.ParentId != null && f.ParentId.Equals(node.Key));

            foreach (SysFunction fun in funs)
            {
                subNode      = new UltraTreeNode();
                subNode.Key  = fun.FunctionId;
                subNode.Text = fun.FunctionName;
                subNode.Tag  = fun;
                if (String.Compare(expandFunctionType, fun.FunctionType) > 0)
                {
                    subNode.Expanded = true;
                }
                if (!String.IsNullOrEmpty(fun.Image))
                {
                    subNode.LeftImages.Add(Image.FromFile("./resource/image/" + (fun.FunctionType.Equals("1015") ? "button" : "mainMenu") + "/" + fun.Image + ".png"));
                    //subNode.LeftImages.Add(Image.FromFile("./resource/image/mainMenu/" + fun.Image + ".png"));
                }
                node.Nodes.Add(subNode);

                FillData(list, subNode, expandFunctionType);
            }
        }
        /// <summary>
        /// Display the data for this tab where we have selected an 'All Assets' node or child node thereof
        /// </summary>
        /// <param name="displayedNode"></param>
        protected void DisplayForAllAssets(UltraTreeNode displayedNode, TreeSelectionEventArgs.ITEMTYPE itemType)
        {
            // Ok we are displaying data for a node beneath 'All Assets' however this still means that we could
            // be displaying one of
            //
            //	All Publishers
            //	Applications for a Publisher
            //	Assets for an Application
            //	Operating System Family
            //
            if (itemType == TreeSelectionEventArgs.ITEMTYPE.asset_applications)
            {
                DisplayAllAssets_Applications(displayedNode);
            }

            else if (itemType == TreeSelectionEventArgs.ITEMTYPE.asset_publisher)
            {
                DisplayAllAssets_Publisher(displayedNode);
            }

            else if (itemType == TreeSelectionEventArgs.ITEMTYPE.asset_application)
            {
                DisplayAllAssets_Application(displayedNode);
            }

            else if (itemType == TreeSelectionEventArgs.ITEMTYPE.asset_os)
            {
                DisplayAllAssets_OS(displayedNode);
            }
        }
예제 #14
0
        /// <summary>
        /// 创建节点
        /// </summary>
        /// <param name="paramNode"></param>
        /// <param name="paramAutoPartsTypeList"></param>
        /// <param name="paramLevel"></param>
        private void BuildNode(UltraTreeNode paramNode, List <MDLBS_AutoPartsType> paramAutoPartsTypeList, int paramLevel)
        {
            //根节点列表
            var rootList = paramAutoPartsTypeList.FindAll(r => r.APT_ParentID == paramNode.Key);

            for (int i = 0; i < rootList.Count; i++)
            {
                UltraTreeNode node = new UltraTreeNode()
                {
                    //Key
                    Key = rootList[i].APT_ID,
                    //显示值
                    Text = rootList[i].APT_Name,
                    //操作
                    DataKey = string.Empty,
                    //版本号
                    Tag = rootList[i].APT_VersionNo
                };
                node.Override.NodeAppearance.ForeColor = Color.Black;
                if (paramLevel <= 9)
                {
                    //node.Override.NodeAppearance.Image = ((object)(resources.GetObject("n" + paramLevel)));
                    //node.Override.NodeAppearance.Image = ((object)(resources.GetObject("Query")));
                }
                else
                {
                    //node.Override.NodeAppearance.Image = ((object)(resources.GetObject("Query")));
                }
                BuildNode(node, paramAutoPartsTypeList, paramLevel + 1);
                paramNode.Nodes.Insert(i, node);
            }
        }
예제 #15
0
 public FrmMant210_1(YR.ERP.Shared.UserInfo pUserInfo, DataSet pDsMaster, UltraTreeNode pUtn)
 {
     InitializeComponent();
     //this._srcFormState = pYREditType;
     this._DsMaster = pDsMaster;
     this.LoginInfo = pUserInfo;
 }
예제 #16
0
        /// <summary>
        /// Initialize the 'All Publishers' node of the applications tree
        /// </summary>
        private void InitializeAllPublishers()
        {
            Infragistics.Win.Appearance ignoredAppearance = new Infragistics.Win.Appearance();
            ignoredAppearance.ForeColor = System.Drawing.Color.Gray;

            // Add the publishers to the tree
            try
            {
                ApplicationsWorkItemController wiController = explorerView.WorkItem.Controller as ApplicationsWorkItemController;
                bool showIncluded = wiController.ShowIncludedApplications;
                bool showIgnored  = wiController.ShowIgnoredApplications;

                ApplicationsDAO lApplicationsDAO = new ApplicationsDAO();

                DataTable       dt             = lApplicationsDAO.GetAllPublisherNamesAsDataTable(wiController.PublisherFilter, showIncluded, showIgnored);
                UltraTreeNode[] publisherNodes = new UltraTreeNode[dt.Rows.Count];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string lPublisher = dt.Rows[i][0].ToString();

                    UltraTreeNode publisherNode = new UltraTreeNode(lPublisher, lPublisher);
                    publisherNode.Tag = "PUBLISHER";
                    publisherNode.Override.ShowExpansionIndicator = ShowExpansionIndicator.CheckOnExpand;
                    publisherNodes[i] = publisherNode;
                }

                explorerView.AllPublishersNode.Nodes.AddRange(publisherNodes);
            }

            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
        }
예제 #17
0
        internal static void LoadFunctionalAreas(string strBuilding)
        {
            if (mdUtility.fMainForm.tvFunctionality.GetNodeByKey(strBuilding + "1") != null)
            {
                mdUtility.fMainForm.tvFunctionality.Nodes[strBuilding].Nodes.Remove(mdUtility.fMainForm.tvFunctionality.GetNodeByKey(strBuilding + "1"));
            }
            DataTable dataTable = mdUtility.DB.GetDataTable("SELECT [Name], [Area_ID] FROM Functional_Area WHERE BLDG_ID={" + strBuilding + "} AND (bred_status <> 'D' OR bred_status IS NULL)");

            try
            {
                foreach (DataRow row in dataTable.Rows)
                {
                    UltraTreeNode ultraTreeNode = mdUtility.fMainForm.tvFunctionality.Nodes[strBuilding].Nodes.Add(row["Name"].ToString());
                    ultraTreeNode.Tag = (object)"FuncArea";
                    ultraTreeNode.Key = row["Area_ID"].ToString();
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
        }
예제 #18
0
        /// <summary>
        /// 组织结构树节点赋值
        /// </summary>
        /// <param name="list"></param>
        /// <param name="tree"></param>
        /// <param name="expandFunctionType"></param>
        public static void FillData(List <SysOrganization> list, TreeNodesCollection nodes, string expandOrgType, bool showIcon)
        {
            UltraTreeNode node = null;

            nodes.Clear();

            //获取最高组织节点
            List <SysOrganization> orgList = list.FindAll(o => string.IsNullOrEmpty(o.ParentId));

            foreach (SysOrganization org in orgList)
            {
                node      = new UltraTreeNode();
                node.Key  = org.OrganizationId;
                node.Text = GetOrgTreeNodeText(org);
                node.Tag  = org;
                if (String.Compare(expandOrgType, org.OrganizationType) > 0)
                {
                    node.Expanded = true;
                }
                if (showIcon)
                {
                    node.LeftImages.Add(GetImage(org.OrganizationType));
                }
                nodes.Add(node);

                FillData(list, node, expandOrgType, showIcon);
            }
        }
예제 #19
0
        private void treeViewExamples_DoubleClick(object sender, EventArgs e)
        {
            UltraTree tree    = (UltraTree)sender;
            UIElement element = tree.UIElement.LastElementEntered;

            if (element == null)
            {
                return;
            }

            UltraTreeNode node = element.GetContext(typeof(UltraTreeNode)) as UltraTreeNode;

            if (node == null)
            {
                return;
            }
            Form form = null;

            switch (node.Key)
            {
            case "GridHybridColumnsLayout":
                form = new InfragisticsDev.Win.GridControl.GroupsLayout.Form3();
                break;

            default:
                break;
            }
            if (form != null)
            {
                form.ShowDialog();
            }
        }
예제 #20
0
        public static string OznaceneOJ(UltraTree ultratree1)
        {
            StringBuilder builder = new StringBuilder();

            Infragistics.Win.UltraWinTree.NodeEnumerator enumerator = ultratree1.Nodes.GetEnumerator();
            while (enumerator.MoveNext())
            {
                UltraTreeNode current = enumerator.Current;
                if (current.Key == "ORGJED")
                {
                    Infragistics.Win.UltraWinTree.NodeEnumerator enumerator2 = current.Nodes.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                        UltraTreeNode node2 = enumerator2.Current;
                        if (node2.CheckedState == CheckState.Checked)
                        {
                            if (builder.Length > 0)
                            {
                                builder.Append(",");
                            }
                            DataRow tag = (DataRow)node2.Tag;
                            builder.Append(RuntimeHelpers.GetObjectValue(tag["idorgjed"]));
                        }
                    }
                }
            }
            return(builder.ToString());
        }
예제 #21
0
        public void Remove(ThreadedListViewItem lvi)
        {
            UltraTreeNodeExtended node = GetFromLVI(lvi);

            if (node == null)
            {
                return;
            }
            //
            UltraTreeNode parent = null;

            if (node.Level == 1)
            {
                parent = node.Parent;
            }
            _lviItems.Remove(lvi);
            node.Parent.Nodes.Remove(node);
            if (parent != null)
            {
                if (parent.Nodes.Count == 0)
                {
                    this.Nodes.Remove(parent);
                }
            }
        }
예제 #22
0
        internal static void LoadFunctionalityTree()
        {
            mdUtility.fMainForm.tvFunctionality.Nodes.Clear();
            mdUtility.fMainForm.tvFunctionality.Refresh();
            DataTable dataTable = mdUtility.DB.GetDataTable("SELECT [Facility_ID], [Number], [Name] FROM Facility WHERE bred_status <> 'D' OR bred_status IS NULL ORDER BY Number, Name");

            try
            {
                foreach (DataRow row in dataTable.Rows)
                {
                    UltraTreeNode ultraTreeNode = mdUtility.fMainForm.tvFunctionality.Nodes.Add(row["Facility_ID"].ToString(), Building.Label(RuntimeHelpers.GetObjectValue(row["Number"]), RuntimeHelpers.GetObjectValue(row["Name"])));
                    ultraTreeNode.Tag = (object)"Building";
                    ultraTreeNode.Nodes.Add(ultraTreeNode.Key + "1", "Temp");
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            mdUtility.fMainForm.Refresh();
        }
        /// <summary>
        /// This function is called to (re)initialize the network explorer view
        /// this is a tree control defined within NetworkExplorerView
        /// </summary>
        private void InitializeNetworkView()
        {
            // clear the existing view
            explorerView.Clear();

            // Are we displaying the computers grouped into domains or user locations - this is held as a flag
            // in the work item controller
            NetworkWorkItemController wiController = explorerView.WorkItem.Controller as NetworkWorkItemController;
            bool showByDomain = wiController.DomainViewStyle;

            // First of all we need to create the root group (domain or location)
            LocationsDAO lwDataAccess = new LocationsDAO();

            AssetGroup.GROUPTYPE displayType = (showByDomain) ? AssetGroup.GROUPTYPE.domain : AssetGroup.GROUPTYPE.userlocation;
            DataTable            table       = lwDataAccess.GetGroups(new AssetGroup(displayType));

            _rootAssetGroup = new AssetGroup(table.Rows[0], displayType);

            // Add the root node to the tree first
            UltraTreeNode rootNode  = new UltraTreeNode("root|" + _rootAssetGroup.FullName, _rootAssetGroup.Name);
            Bitmap        rootImage = (showByDomain) ? Properties.Resources.domain16 : Properties.Resources.location_16;

            rootNode.Override.NodeAppearance.Image         = rootImage;
            rootNode.Override.ExpandedNodeAppearance.Image = rootImage;
            rootNode.Tag = _rootAssetGroup;

            // Set the root node in the Explorer view - note that this will automatically expand the node which will
            // cause it to be populated
            explorerView.RootNode = rootNode;
        }
        /// <summary>
        /// This function is called when we have selected a specific 'Operating System Family' node below 'All Assets'
        /// In this case we need to display a list of assets for which this Operating System has been installed
        /// </summary>
        /// <param name="displayedNode"></param>
        protected void DisplayAllAssets_OS(UltraTreeNode displayedNode)
        {
            // Ensure that the tree view is already populated for this branch
            NetworkExplorerView explorerView = workItem.ExplorerView as NetworkExplorerView;

            explorerView.ExpandNode(displayedNode);

            // We are displaying ALL publishers - add in columns for
            // Application Object and Publisher
            DataColumn column1 = new DataColumn("ApplicationObject", typeof(object));
            DataColumn column2 = new DataColumn("Asset", typeof(string));
            DataColumn column3 = new DataColumn("Version", typeof(string));
            DataColumn column4 = new DataColumn("Serial Number", typeof(string));
            DataColumn column5 = new DataColumn("CD Key", typeof(string));

            // Add these columns to the DataSet
            applicationsDataSet.Tables[0].Columns.AddRange(new System.Data.DataColumn[] { column1, column2, column3, column4, column5 });

            // Get a list of assets for which this application has
            AllAssets   allAssets = displayedNode.Tag as AllAssets;
            InstalledOS thisOS    = allAssets.Tag as InstalledOS;

            // This will give us (any) instances
            foreach (OSInstance instance in thisOS.Instances)
            {
                // Note we save the UltraTreeNode tag with this row as this should relate to the application
                Asset asset = new Asset();
                asset.Name    = instance.InstalledOnComputer;
                asset.AssetID = instance.InstalledOnComputerID;
                asset.Icon    = instance.InstalledOnComputerIcon;
                applicationsDataSet.Tables[0].Rows.Add(new object[] { asset, asset.Name, instance.Version, instance.Serial.ProductId, instance.Serial.CdKey });
            }
        }
예제 #25
0
        internal static void LoadInspectionSystems(string Node, string Tag)
        {
            if (mdUtility.fMainForm.tvInspection.GetNodeByKey(Node + "1") != null)
            {
                mdUtility.fMainForm.tvInspection.GetNodeByKey(Node).Nodes.Remove(mdUtility.fMainForm.tvInspection.GetNodeByKey(Node + "1"));
            }
            DataTable dataTable = mdUtility.DB.GetDataTable("SELECT [bldg_sys_id], sys_desc FROM Systems WHERE [bldg_sys_bldg_id]={" + mdUtility.fMainForm.tvInspection.GetNodeByKey(Node).Parent.Key + "} AND (bred_status <> 'D' OR bred_status IS NULL) ORDER BY sys_desc");

            try
            {
                foreach (DataRow row in dataTable.Rows)
                {
                    UltraTreeNode ultraTreeNode = mdUtility.fMainForm.tvInspection.GetNodeByKey(Node).Nodes.Add(row["bldg_sys_id"].ToString(), Conversions.ToString(row["sys_desc"]));
                    ultraTreeNode.Tag = (object)"System";
                    ultraTreeNode.Nodes.Add(ultraTreeNode.Key + "1", "Temp");
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
        }
        /// <summary>
        /// Display the data for this tab where we have selected an asset or child node thereof
        /// </summary>
        /// <param name="displayedNode"></param>
        protected void DisplayForAsset(UltraTreeNode displayedNode)
        {
            // We are displaying ALL publishers and ALL applications for this asset - add in columns for
            // Application Object, Publisher, Name, Version, Serial Number and CD Key
            DataColumn column1 = new DataColumn("ApplicationObject", typeof(object));
            DataColumn column2 = new DataColumn("Publisher", typeof(string));
            DataColumn column3 = new DataColumn("Name", typeof(string));
            DataColumn column4 = new DataColumn("Version", typeof(string));
            DataColumn column5 = new DataColumn("Serial Number", typeof(string));
            DataColumn column6 = new DataColumn("CD Key", typeof(string));

            // Add these columns to the DataSet
            applicationsDataSet.Tables[0].Columns.AddRange(new System.Data.DataColumn[] { column1, column2, column3, column4, column5, column6 });

            // Get the work item controller
            NetworkWorkItemController wiController = WorkItem.Controller as NetworkWorkItemController;
            Asset theAsset = displayedNode.Tag as Asset;

            // ...and from there settings which alter what we display in this view
            bool   showIncluded    = wiController.ShowIncludedApplications;
            bool   showIgnored     = wiController.ShowIgnoredApplications;
            String publisherFilter = wiController.PublisherFilter;

            // Call database function to return list of applications (for the specified publisher)
            ApplicationsDAO lwDataAccess      = new ApplicationsDAO();
            DataTable       applicationsTable = lwDataAccess.GetInstalledApplications(theAsset, publisherFilter, showIncluded, showIgnored);

            foreach (DataRow row in applicationsTable.Rows)
            {
                ApplicationInstance newApplication = new ApplicationInstance(row);
                AddApplication(newApplication);
            }
        }
예제 #27
0
        internal static void LoadInventoryComponents(string strSystem)
        {
            if (mdUtility.fMainForm.tvInventory.GetNodeByKey(strSystem + "1") != null)
            {
                mdUtility.fMainForm.tvInventory.GetNodeByKey(strSystem).Nodes.Remove(mdUtility.fMainForm.tvInventory.GetNodeByKey(strSystem + "1"));
            }
            DataTable dataTable = mdUtility.DB.GetDataTable("SELECT [sys_comp_id], comp_desc FROM components_by_system WHERE [sys_comp_bldg_sys_id]={" + strSystem + "} AND (bred_status <> 'D' OR bred_status IS NULL) ORDER BY comp_desc");

            try
            {
                foreach (DataRow row in dataTable.Rows)
                {
                    UltraTreeNode ultraTreeNode = mdUtility.fMainForm.tvInventory.GetNodeByKey(strSystem).Nodes.Add(row["sys_comp_id"].ToString(), Conversions.ToString(row["comp_desc"]));
                    ultraTreeNode.Tag = (object)"Component";
                    ultraTreeNode.Nodes.Add(ultraTreeNode.Key + "1", "Temp");
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
        }
예제 #28
0
        /// <summary>
        /// Display
        /// =======
        ///
        /// Displays the audit history for this asset within this tab view.
        ///
        /// </summary>
        /// <param name="displayNode">UltraTreeNode holding the asset for which history is to be displayed</param>
        public void Display(UltraTreeNode displayedNode)
        {
            _displayedNode = displayedNode;
            Asset displayedAsset = _displayedNode.Tag as Asset;

            //	Call BeginUpdate to prevent drawing while we are populating the control
            this.historyGridView.BeginUpdate();
            this.Cursor = Cursors.WaitCursor;

            // Delete all entries from the current data set being displayed
            historyDataSet.Tables[0].Rows.Clear();

            // Recover the asset audit history records for this asset
            AuditTrailDAO lwDataAccess = new AuditTrailDAO();
            DataTable     historyTable = lwDataAccess.GetAssetAuditHistory(displayedAsset, new DateTime(0), new DateTime(0));

            // Add the entries in the data table as ATE records to our DataSet
            foreach (DataRow row in historyTable.Rows)
            {
                AuditTrailEntry ate = new AuditTrailEntry(row);
                historyDataSet.Tables[0].Rows.Add(new object[] { ate, ate.Date, ate.GetTypeDescription(), ate.Username });
            }

            //	Restore the cursor
            this.Cursor = Cursors.Default;

            //	Call EndUpdate to resume drawing operations
            this.historyGridView.EndUpdate(true);
        }
예제 #29
0
        /// <summary>
        /// Recursive routine to traverse the locations tree and build up a list of the Asset Groups and Assets
        /// which are checked
        /// </summary>
        /// <param name="parentNode"></param>
        /// <param name="listSelectedGroups"></param>
        /// <param name="listSelectedAssets"></param>
        protected void GetSelectedGroups(UltraTreeNode parentNode)
        {
            AssetGroup assetGroup = parentNode.Tag as AssetGroup;

            // If this node is unchecked then all children are also unchecked
            if (parentNode.CheckedState == CheckState.Unchecked)
            {
                return;
            }


            // Indeterminate means that some children will be checked and some won't - iterate through the
            // groups first by calling ourselves recursively for each child group
            else if (parentNode.Tag is AssetGroup)
            {
                // This is an asset group - we only add if it is CHECKED (not if indeterminate)
                if (parentNode.CheckedState == CheckState.Checked)
                {
                    AssetGroup group = parentNode.Tag as AssetGroup;
                    selectedItems.Append(group.GroupID + ";");
                }

                // But in all cases (CHECKED OR INDETERMINATE) we add child groups
                foreach (UltraTreeNode childNode in parentNode.Nodes)
                {
                    // recurse if this child is a n Asset Group
                    if (childNode.Tag is AssetGroup)
                    {
                        GetSelectedGroups(childNode);
                    }
                }
            }
        }
예제 #30
0
        /// <summary>
        /// Verify the check state of the parent9s) of the specified child node
        /// </summary>
        /// <param name="childNode"></param>
        private void VerifyParentNodeCheckState(UltraTreeNode childNode)
        {
            // get the parent node and return if it is null (top of tree)
            UltraTreeNode parentNode = childNode.Parent;

            if (parentNode == null)
            {
                return;
            }

            // Save the parent's current state
            CheckState currentState  = parentNode.CheckedState;
            CheckState childNewState = childNode.CheckedState;
            bool       notifyParent  = false;

            // Get the parent state based on the current state of its children
            CheckState newState = GetOverallChildState(parentNode);

            // We must notify our parent if our status is going to change
            notifyParent = (newState != currentState);

            // should we notify the parent? ( has our state changed? )
            if (notifyParent)
            {
                // change state
                parentNode.CheckedState = newState;
                if (parentNode.Parent != null)
                {
                    VerifyParentNodeCheckState(parentNode);
                }
            }
        }
예제 #31
0
    private static UltraTreeNode findOrCreateNode(UltraTreeNode parent_, string text_, SeriesConfig config=null)
    {
      UltraTreeNode ret = parent_.Nodes.Cast<UltraTreeNode>().FirstOrDefault(node => node.Text.Equals(text_));

      if (ret == null)
      {

        ret = config != null ? (UltraTreeNode)new TreeNode_Leaf(text_, config) : new TreeNode_Folder(text_);
        parent_.Nodes.Add(ret);
      }

      return ret;
    }
예제 #32
0
 public void MostrarItems()
 {
     foreach (ItemPlantilla Item in Plantilla.Items)
     {
         UltraTreeNode Node = new UltraTreeNode();
         Node.Tag = Item;
         Node.Text = Item.Nombre;
         Node.LeftImages.Add(utPlantilla.Nodes[0].LeftImages[0]);
         utPlantilla.Nodes[0].Nodes.Add(Node);
         MostrarItem(Node);
     }
     utPlantilla.ExpandAll();
 }
예제 #33
0
 public void MostrarItems()
 {
     utSolicitudCotizacion.Nodes.Clear();
     foreach (ItemSolicitudCotizacion Item in SolicitudCotizacion.Items)
     {
         UltraTreeNode Node = new UltraTreeNode();
         Node.Tag = Item;
         Node.Text = Item.Nombre;
         utSolicitudCotizacion.Nodes.Add(Node);
         //MostrarItem(Item);
     }
     if (utSolicitudCotizacion.Nodes.Count > 0)
     {
         utSolicitudCotizacion.ActiveNode = utSolicitudCotizacion.Nodes[0];
         utSolicitudCotizacion.Nodes[0].Selected = true;
     }
     utSolicitudCotizacion.ExpandAll();
 }
    private void collectedSelectedDefinitions(UltraTreeNode node_, IList<BondStructureDefinition> addToThis_)
    {
      if (node_ is StructureNode)
      {
        var structure = ((StructureNode) node_).WrappedDefinition;

        if (!addToThis_.Contains(structure))
          addToThis_.Add(structure);
      }
      else if (node_ is BondStructureFolderNode)
      {
        var folder = ((BondStructureFolderNode) node_).WrappedFolder;
        collectDefinitionsFromFolder(folder, addToThis_);
      }

    }
예제 #35
0
        public void MostrarItems()
        {
            utOrdenProduccion.Nodes.Clear();

            foreach (ItemOrdenProduccion Item in OrdenProduccion.Items)
            {
                UltraTreeNode Node = new UltraTreeNode();
                Node.Tag = Item;
                Node.Text = Item.Nombre;
                utOrdenProduccion.Nodes.Add(Node);
            }
            if (utOrdenProduccion.Nodes.Count > 0)
            {
                utOrdenProduccion.ActiveNode = utOrdenProduccion.Nodes[0];
                utOrdenProduccion.Nodes[0].Selected = true;
            }
            utOrdenProduccion.ExpandAll();
        }
    private void disposeNode(UltraTreeNode node_)
    {
      if (node_ == null) return;

      // call on all children, so go to end of tree and then back up
      foreach (var innnerNode in node_.Nodes)
        disposeNode(innnerNode);

      // clear out all children (will have been disposed already)
      node_.Nodes.Clear();

      // dispose yourself
      node_.Dispose();
    }
예제 #37
0
        public void MostrarItem(UltraTreeNode Node)
        {
            ActualizandoIU = true;
            ItemOrdenProduccion Item = (ItemOrdenProduccion)Node.Tag;
            ItemOrdenProduccion = Item;
            GrupoMedidaAbierta.Visible = Item.TieneMedidaAbierta;
            GrupoMedidaCerrada.Visible = Item.TieneMedidaCerrada;
            GruposTiras.Visible = Item.TieneTiraRetira;
            ssMaquina.Text = (Item.Maquina != null) ? Item.Maquina.Nombre : "";
            ssMaterial.Text = (Item.Material != null) ? Item.Material.Descripcion : "";
            lblTipoUnidad.Text = Item.TipoUnidad;
            txtObservacionItem.Text = Item.Observacion;
            txtCantidadItem.Value = Item.CantidadUnidad;
            txtCantidadProduccion.Value = Item.CantidadElemento;
            txtMedidaAbiertoLargo.Value = Item.MedidaAbiertaLargo;
            txtMedidaAbiertoAlto.Value = Item.MedidaAbiertaAlto;
            txtMedidaCerradaLargo.Value = Item.MedidaCerradaLargo;
            txtMedidaCerradaAlto.Value = Item.MedidaCerradaAlto;
            txtImpresoTiraColor.Value = Item.ImpresoTiraColor;
            txtImpresoRetiraColor.Value = Item.ImpresoRetiraColor;

            txtMedidaAnchoCaja.Value = Item.MedidaAnchoCaja;

            //uneCostoMaquina.Value = Item.CostoMaquina;
            //uneCostoMaterial.Value = Item.CostoMaterial;
            //uneCosto.Value = Item.Costo;
            uneSeparacionX.Value = Item.SeparacionX;
            uneSeparacionY.Value = Item.SeparacionY;
            txtFormatoImpresionAlto.Value = Item.FormatoImpresionAlto;
            txtFormatoImpresionLargo.Value = Item.FormatoImpresionLargo;
            txtNroPiezasPrecorte.Value = Item.NroPiezasPrecorte;
            txtNroPiezasImpresion.Value = Item.NroPiezasImpresion;
            txtImpresionAlto.Value = Item.MedidaAbiertaAlto;
            txtImpresionLargo.Value = Item.MedidaAbiertaLargo;
            ssMaquina.Visible = Item.TieneMaquina;
            lblMaquina.Visible = Item.TieneMaquina;
            ssMaterial.Visible = Item.TieneMaterial;
            lblMaterial.Visible = Item.TieneMaterial;
            //txtCostoServicio.Value = Item.CostoServicio;
            //lblCostoMaquina.Visible = Item.TieneMaquina;
            //uneCostoMaquina.Visible = Item.TieneMaquina;
            //lblCostoMaterial.Visible = Item.TieneMaterial;
            //uneCostoMaterial.Visible = Item.TieneMaterial;


            comboMedida.Text = Item.UnidadMedidaAbierta;
            lblTipoUnidad.Visible = Item.TieneTipoUnidad;
            txtCantidadItem.Visible = Item.TieneTipoUnidad;
            if (Item.TieneTipoUnidad == false)
            {
                txtCantidadItem.Value = 0;
            }


            txtDemasia.Value = Item.CantidadDemasia;
            txtPases.Value = Item.NumerodePases;
            txtHojasMaquina.Value = (Item.CantidadMaterial) * Item.NroPiezasPrecorte;
            txtTiraje.Value = Item.CantidadProduccion;

            LabelMateriaPrima.Text = "";
            if (Item.NumeroPliegos > 0)
            {
                LabelMateriaPrima.Text = Item.NumeroPliegos + " pliegos de : ";
            }
            LabelMateriaPrima.Text += Math.Round(Item.CantidadMaterial, 0).ToString() + " + " + Math.Round(Item.CantidadDemasiaMaterial, 0).ToString() + " = " + Math.Round((Item.CantidadMaterial + Item.CantidadDemasiaMaterial), 0).ToString() + " Hjs/Resma";
            LabelProduccion.Text = "";
            if (Item.NumeroPliegos > 0)
            {
                LabelProduccion.Text = Item.NumeroPliegos + " pliegos de : ";
            }
            LabelProduccion.Text += Math.Round(((Item.CantidadMaterial + Item.CantidadDemasiaMaterial) * Item.NroPiezasPrecorte), 0).ToString() + " Hjs/Maquina";
            txtPliegos.Value = Item.NumeroPliegos;


            // if (Item.MetodoImpresion != null) {
            ubeMetodo.Text = Item.MetodoImpresion;
            //}


            checkGraficoImpresionManual.Checked = Item.GraficoImpresionManual;

            utcItemCotizacion.Tabs["Graficos"].Visible = Item.TieneGraficos;
            txtDemasia.Value = Item.CantidadDemasia;

            if (Item.TieneGraficos)
            {
                try
                {
                    upbImpresion.Visible = true;
                    txtNroPiezasImpresion.ReadOnly = true;
                    if (Item.GraficoImpresionManual)
                    {
                        upbImpresion.Visible = false;
                        txtNroPiezasImpresion.ReadOnly = false;
                    }
                    else if (Item.GraficoImpresionGirado)
                    {
                        GenerarGraficoImpresionRotado();
                    }
                    else
                    {
                        GenerarGraficoImpresionNormal();
                    }



                    if (Item.GraficoPrecorteGirado)
                    {

                        GenerarGraficoPrecorteRotado();

                    }
                    else { GenerarGraficoPrecorteNormal(); }
                }
                catch (Exception)
                {

                }
            }


            MostrarServicios(Item);
            ActualizandoIU = false;
        }
예제 #38
0
        public void MostrarItem(UltraTreeNode Node)
        {
            ItemPlantilla Item = (ItemPlantilla)Node.Tag;
            txtNombreItem.Text = Item.Nombre;
            chkTieneMedidaAbierta.Checked = Item.TieneMedidaAbierta;
            chkTieneMedidadCerrada.Checked = Item.TieneMedidaCerrada;
            chkTieneTiraRetira.Checked = Item.TieneTiraRetira;
            chkTieneGraficos.Checked = Item.TieneGraficos;
            chkTieneMaquina.Checked = Item.TieneMaquina;
            chkTieneMaterial.Checked = Item.TieneMaterial;
            ssOperacion.Text = (Item.Operacion != null) ? Item.Operacion.Nombre : "";
            ssMaterial.Text = (Item.Material != null) ? Item.Material.Nombre : "";
            ssTipoUnidad.Text = (Item.TipoUnidad!= null) ? Item.TipoUnidad.Nombre : "";
            ssRelacionMedidas.Text = (Item.RelacionMedidas != null) ? Item.RelacionMedidas.Nombre : "";
            CheckTieneFondo.Checked = Item.TieneFondo;

            //comboMedida.Text = "";
            comboMedida.Text=Item.UnidadMedidaAbierta;
            chkTieneTipoUnidad.Checked = Item.TieneTipoUnidad;

            MostrarServicios(Item);
        }
예제 #39
0
        public void MostrarItem(UltraTreeNode Node)
        {
            ActualizandoIU = true;
            ItemCotizacion Item = null;

            Node.Text = ItemCotizacion.Nombre;
            Item = (ItemCotizacion)Node.Tag;


            txtNombre.Text = ItemCotizacion.Nombre;
            labelSobranPaginas.Text = "";
            ItemCotizacion = Item;
            GrupoMedidaAbierta.Visible = Item.TieneMedidaAbierta;
            GrupoMedidaCerrada.Visible = Item.TieneMedidaCerrada;
            GruposTiras.Visible = Item.TieneTiraRetira;
            ssMaquina.Text = (Item.Maquina != null) ? Item.Maquina.Nombre : "";
            ssMaterial.Text = (Item.Material != null) ? Item.Material.Nombre : "";


            txtMedidaAnchoCaja.Value = Item.MedidaAnchoCaja;

            if (Item.TieneTipoUnidad)
            {
                GrupoMedidaAbierta.Text = "MEDIDA DE " + Item.TipoUnidad;
            }
            else
            {
                GrupoMedidaAbierta.Text = "MEDIDA ABIERTA";
            }


            busMetodoImpresion.Text = (Item.MetodoImpresionOffset != null) ? Item.MetodoImpresionOffset.Codigo : "";

            txtNumeroCambios.Value = Item.NumeroCambios;

            lblTipoUnidad.Text = Item.TipoUnidad;
            txtObservacionItem.Text = Item.Observacion;
            txtCantidadItem.Value = Item.CantidadUnidad;
            txtCantidadProduccion.Value = Item.CantidadElemento;
            txtMedidaAbiertoLargo.Value = Item.MedidaAbiertaLargo;
            txtMedidaAbiertoAlto.Value = Item.MedidaAbiertaAlto;
            txtMedidaCerradaLargo.Value = Item.MedidaCerradaLargo;
            txtMedidaCerradaAlto.Value = Item.MedidaCerradaAlto;
            txtImpresoTiraColor.Value = Item.ImpresoTiraColor;
            txtImpresoRetiraColor.Value = Item.ImpresoRetiraColor;
            uneCostoMaquina.Value = Item.CostoMaquina;
            uneCostoMaterial.Value = Item.CostoMaterial;
            uneCosto.Value = Item.Costo;
            uneSeparacionX.Value = Item.SeparacionX;
            uneSeparacionY.Value = Item.SeparacionY;
            txtFormatoImpresionAlto.Value = Item.FormatoImpresionAlto;
            txtFormatoImpresionLargo.Value = Item.FormatoImpresionLargo;
            txtNroPiezasPrecorte.Value = Item.NroPiezasPrecorte;
            txtNroPiezasImpresion.Value = Item.NroPiezasImpresion;
            txtImpresionAlto.Value = Item.MedidaAbiertaAlto;
            txtImpresionLargo.Value = Item.MedidaAbiertaLargo;
            ssMaquina.Visible = Item.TieneMaquina;
            lblMaquina.Visible = Item.TieneMaquina;
            ssMaterial.Visible = Item.TieneMaterial;
            lblMaterial.Visible = Item.TieneMaterial;
            txtCostoServicio.Value = Item.CostoServicio;
            //lblCostoMaquina.Visible = Item.TieneMaquina;
            uneCostoMaquina.Visible = Item.TieneMaquina;
            //lblCostoMaterial.Visible = Item.TieneMaterial;
            uneCostoMaterial.Visible = Item.TieneMaterial;
            txtMedidaAnchoCaja.Visible = Item.TieneFondo;
            labelFondoCaja.Visible = Item.TieneFondo;

            comboMedida.Text = Item.UnidadMedidaAbierta;
            lblTipoUnidad.Visible = Item.TieneTipoUnidad;
            txtCantidadItem.Visible = Item.TieneTipoUnidad;
            checkMuestraPrecioEnPresupuesto.Checked = Item.MuestraPrecioEnPresupuesto;



            if (Item.TieneTipoUnidad == false)
            {
                txtCantidadItem.Value = 0;
            }


            txtDemasia.Value = Item.CantidadDemasia;
            txtPases.Value = Item.NumerodePases;
            txtHojasMaquina.Value = (Item.CantidadMaterial) * Item.NroPiezasPrecorte;
            txtTiraje.Value = Item.CantidadProduccion;

            LabelMateriaPrima.Text = "";
            if (Item.NumeroPliegos > 0)
            {
                LabelMateriaPrima.Text = Item.NumeroPliegos + " pliegos de : ";
            }

            LabelMateriaPrima.Text += Math.Round(Item.CantidadMaterial, 0).ToString() + " + " + Math.Round(Item.CantidadDemasiaMaterial, 0).ToString() + " = " + Math.Round((Item.CantidadMaterial + Item.CantidadDemasiaMaterial), 0).ToString() + " Hjs/Resma";
            Item.LabelMaterial = LabelMateriaPrima.Text;



            LabelMaterialAlmancen.Text = "";
            if (Item.NumeroPliegos > 0)
            {
                LabelMaterialAlmancen.Text = " Total Material : ";
            }

            LabelMaterialAlmancen.Text += " = " + Math.Round((Item.CantidadMaterial + Item.CantidadDemasiaMaterial), 0).ToString() + " Hjs/Resma";
            Item.LabelMaterial = LabelMaterialAlmancen.Text;




            LabelProduccion.Text = "";
            if (Item.NumeroPliegos > 0)
            {
                LabelProduccion.Text = Item.NumeroPliegos + " pliegos de : ";
            }
            LabelProduccion.Text += Math.Round(((Item.CantidadMaterial + Item.CantidadDemasiaMaterial) * Item.NroPiezasPrecorte), 0).ToString() + " Hjs/Maquina";

            Item.LabelProduccion = LabelProduccion.Text;
            txtPliegos.Value = Item.NumeroPliegos;


            // if (Item.MetodoImpresion != null) {

            //}


            checkGraficoImpresionManual.Checked = Item.GraficoImpresionManual;

            utcItemCotizacion.Tabs["Graficos"].Visible = Item.TieneGraficos;
            txtDemasia.Value = Item.CantidadDemasia;

            if (Item.TieneGraficos)
            {
                try
                {
                    upbImpresion.Visible = true;
                    txtNroPiezasImpresion.ReadOnly = true;
                    if (Item.GraficoImpresionManual)
                    {
                        upbImpresion.Visible = false;
                        txtNroPiezasImpresion.ReadOnly = false;
                    }
                    else if (Item.GraficoImpresionGirado)
                    {
                        GenerarGraficoImpresionRotado();
                    }
                    else
                    {
                        GenerarGraficoImpresionNormal();
                    }



                    if (Item.GraficoPrecorteGirado)
                    {

                        GenerarGraficoPrecorteRotado();

                    }
                    else { GenerarGraficoPrecorteNormal(); }
                }
                catch (Exception)
                {

                }
            }

            labelSobranPaginas.Text="";
            if(Item.PaginasSobrantes >0){
                labelSobranPaginas.Text = "Sobran " + Item.PaginasSobrantes + " paginas";
            }

            uceIncluirEnPresupuesto.Checked = Item.IncluirEnPrespuesto;

            MostrarAMMS(Item);
            ActualizandoIU = false;
        }
예제 #40
0
 public void AddNode() {
     UltraTreeNode Node = new UltraTreeNode();
     ItemPlantilla Item = Plantilla.CrearItem();
     Node.LeftImages.Add(utPlantilla.Nodes[0].LeftImages[0]);
     Node.Tag = Item;
     utPlantilla.Nodes[0].Nodes.Add(Node);
     utPlantilla.ExpandAll();
     utPlantilla.ActiveNode = Node;
     Node.Selected = true;
     txtNombreItem.Focus();
 }
예제 #41
0
        private void folderTree_AfterActivate(object sender, NodeEventArgs e)
        {
            StartTimer();

            string path = e.TreeNode.FullPath.Replace(e.TreeNode.RootNode.FullPath + "\\", "");

            if (!e.TreeNode.HasNodes)
            {
                if(Directory.Exists(path))
                {
                    try
                    {
                        foreach (string dir in Directory.GetDirectories(path))
                        {
                            UltraTreeNode node = new UltraTreeNode();
                            node.Text = dir.Substring(dir.LastIndexOf(@"\") + 1);
                            e.TreeNode.Nodes.Add(node);
                        }
                    }
                    catch (UnauthorizedAccessException) { }
                }
            }
            try
            {
                fileList.Items.Clear();
                string[] files = Directory.GetFiles(path);    //search does not allow multiple patterns

                foreach (string file in files)
                {
                    string ext = Path.GetExtension(file);

                    object[] subItemsValues = new string[] { };
                    UltraListViewItem item = new UltraListViewItem();

                    switch (ext)
                    {
                        case ".mp3":
                            subItemsValues = new string[] { "MP3" };
                            item = new UltraListViewItem(Path.GetFileName(file), subItemsValues);

                            item.Key = file;
                            fileList.Items.Add(item);
                            break;
                        case ".ogg":
                            subItemsValues = new string[] { "OGG" };
                            item = new UltraListViewItem(Path.GetFileName(file), subItemsValues);

                            item.Key = file;
                            fileList.Items.Add(item);
                            break;
                        case ".flac":
                            subItemsValues = new string[] { "FLAC" };
                            item = new UltraListViewItem(Path.GetFileName(file), subItemsValues);

                            item.Key = file;
                            fileList.Items.Add(item);
                            break;
                        case ".ape":
                            subItemsValues = new string[] { "APE" };
                            item = new UltraListViewItem(Path.GetFileName(file), subItemsValues);

                            item.Key = file;
                            fileList.Items.Add(item);
                            break;
                    }
                }
            }
            catch (Exception) {}

            StopTimer();
        }
예제 #42
0
        private void ultraTree1_AfterSelect(object sender, SelectEventArgs e)
        {
            try
            {
                curSelectedNode = e.NewSelections[0];
            }
            catch (ArgumentOutOfRangeException ex)
            {

            }
        }
예제 #43
0
        private void RefreshFoldersList()
        {
            StartTimer();
            //StartMarqueeProgressBar();

            folderTree.Nodes.Clear();

            string[] drives = Directory.GetLogicalDrives();

            UltraTreeNode rootNode = new UltraTreeNode();
            rootNode.Text = System.Environment.MachineName.ToString();

            foreach (string drive in drives)
            {
                UltraTreeNode nodeDrive = new UltraTreeNode();
                nodeDrive.Text = drive;

                try
                {
                    if (Directory.Exists(drive))
                    {
                        foreach (string dir in Directory.GetDirectories(drive))
                        {
                            UltraTreeNode node = new UltraTreeNode();
                            node.Text = dir.Substring(dir.LastIndexOf(@"\") + 1);
                            nodeDrive.Nodes.Add(node);
                        }
                    }
                }
                catch (Exception) { }

                rootNode.Nodes.Add(nodeDrive);
            }

            folderTree.Nodes.Add(rootNode);
            folderTree.Refresh();

            StopTimer();
            //StopMarqueeProgressBar();
        }
        private bool InsertParameter(UltraTreeNode parentNode, Parameter para)
        {
            if (Convert.ToInt32(parentNode.Tag) == 2)
            {
                UltraTreeNode paraNode = parentNode.Nodes.Add();
                paraNode.Tag = 3;

                paraNode.Override.ColumnSet = this.InputTree.ColumnSettings.ColumnSets["Parameter"];

                paraNode.Cells[0].Value = para.Key;
                paraNode.Cells[1].Value = para.Value;

                return true;
            }
            else
                return false;
        }
        private bool InsertStep(UltraTreeNode parentNode, Step step)
        {
            if (Convert.ToInt32(parentNode.Tag) == 1)
            {
                UltraTreeNode stepNode = parentNode.Nodes.Add();
                stepNode.Tag = 2;
                stepNode.Override.ColumnSet = this.InputTree.ColumnSettings.ColumnSets["Step"];

                stepNode.Cells[0].Value = step.Name;

                foreach (Parameter p in step.Parameters)
                {
                    this.InsertParameter(stepNode, p);
                }

                return true;
            }
            else
                return false;
        }
예제 #46
0
 private void OpenTreeNodeVisiable(UltraTreeNode currentNode)
 {
     UltraTreeNode parent = currentNode.Parent;
     if (parent != null)
     {
         parent.Visible = true;
         this.OpenTreeNodeVisiable(parent);
     }
 }
예제 #47
0
 public void AddNodesToTree(TreeNodesCollection Nodes,ItemContenedor ItemPadre) {
     foreach (ItemContenedor Item in Contenedor.GetItemsByItemParent(ItemPadre.ID)){
         UltraTreeNode Node = new UltraTreeNode(Item.ID, Item.Nombre);
         Image Imagen = ilMain.Images[Item.Imagen];
         Node.Tag = Item;
         if (Imagen != null) { Node.LeftImages.Add(Imagen); };
         Nodes.Add(Node);
         AddNodesToTree(Node.Nodes, Item);
     }
 }