コード例 #1
0
 public TreeListNode AddTreeListNode(TreeList treelist, TreeListNode node, Type type, string propertyName, string defaultFunction, string validationFunction)
 {
     TreeListNode newNode = treelist.AppendNode(new object[] { propertyName, defaultFunction, validationFunction }, node);
     //newNode.ImageIndex = newNode.SelectImageIndex = (int)image;
     newNode.Tag = type;
     return newNode;
 }
コード例 #2
0
        private static void ApplyChangeForApiExtensions(TreeListNode node)
        {
            var tagName = (string)node.GetValue(0);
            object theirValue = node.GetValue(1);

            switch (tagName)
            {
                case "Category":
                    ((UserOption)node.ParentNode.Tag).Category = (string)theirValue;
                    break;
                case "DefaultValue":
                    ((UserOption)node.ParentNode.Tag).DefaultValueFunctionBody = (string)theirValue;
                    break;
                case "Description":
                    ((UserOption)node.ParentNode.Tag).Description = (string)theirValue;
                    break;
                case "IteratorType":
                    ((UserOption)node.ParentNode.Tag).IteratorType = (Type)theirValue;
                    break;
                case "ResetPerSession":
                    ((UserOption)node.ParentNode.Tag).ResetPerSession = (bool)theirValue;
                    break;
                case "Text":
                    ((UserOption)node.ParentNode.Tag).Text = (string)theirValue;
                    break;
                case "VariableName":
                    ((UserOption)node.ParentNode.Tag).VariableName = (string)theirValue;
                    break;
                case "VarType":
                    ((UserOption)node.ParentNode.Tag).VarType = (Type)theirValue;
                    break;
                default:
                    throw new NotImplementedException("Node not hendled yet: " + tagName);
            }
        }
コード例 #3
0
 private TreeListNode AddNodeTheirs(string name, object theirValue, object myValue, TreeListNode parentNode, object tag)
 {
     TreeListNode node = treeListTheirs.AppendNode(new object[] { name, theirValue, "", myValue }, parentNode);
     node.Tag = tag;
     node.StateImageIndex = (int)TreeNodeImages.Unchecked;
     return node;
 }
コード例 #4
0
        private void BuildTree(TreeListNode aNode,int ParentId)
        {
            try
            {

                treeList1.BeginUnboundLoad();
                TreeListNode node;
                TreeListNode devicenode;
                TreeListNode camnode;
                foreach (KeyValuePair<int, GroupInfo> item in listGroup)
                {
                    if (item.Value.ParentId == ParentId)
                    {
                        node = treeList1.AppendNode(new object[] { item.Value.Name }, aNode);
                        node.Tag = item.Key.ToString() + ";G";
                        foreach (KeyValuePair<int, DeviceInfo> device in item.Value.ListDevice)
                        {
                            devicenode = treeList1.AppendNode(new object[] { device.Value.Name }, node);
                            devicenode.Tag = device.Key.ToString() + ";D";
                            foreach (KeyValuePair<int, CameraInfo> cam in device.Value.ListCamera)
                            {
                                camnode = treeList1.AppendNode(new object[] { cam.Value.Name }, devicenode);
                                camnode.Tag = cam.Key.ToString() + ";C";
                            }
                        }
                        BuildTree(node, item.Key);

                    }

                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #5
0
ファイル: UcPdreltype.cs プロジェクト: EdgarEDT/myitoppsp
        //删除结点
        public void DeleteNode(TreeListNode tln)
        {
            if (tln.HasChildren) {
                for (int i = 0; i < tln.Nodes.Count; i++) {
                    DeleteNode(tln.Nodes[i]);
                }
                DeleteNode(tln);
            } else {
                Ps_pdreltype pf = new Ps_pdreltype();
                pf.ID = tln["ID"].ToString();
                string nodestr = tln["Title"].ToString();
                try {
                    TreeListNode node = tln.TreeList.FindNodeByKeyID(pf.ID);
                    if (node != null)
                        tln.TreeList.DeleteNode(node);
                    RemoveDataTableRow(dataTable, pf.ID);
                    Ps_pdtypenode pn = new Ps_pdtypenode();
                    pn.pdreltypeid = pf.ID;
                    Itop.Client.Common.Services.BaseService.Update("DeletePs_pdtypepdreltypeid", pn);
                    Itop.Client.Common.Services.BaseService.Delete<Ps_pdreltype>(pf);

                } catch (Exception e) {

                    MessageBox.Show(e.Message + "删除结点出错!");
                }

            }
        }
コード例 #6
0
ファイル: UcPdtypenode.cs プロジェクト: EdgarEDT/myitoppsp
        //删除元件
        public void DeleteNode(TreeListNode tln)
        {
            if (tln.HasChildren)
            {
                for (int i = 0; i < tln.Nodes.Count; i++)
                {
                    DeleteNode(tln.Nodes[i]);
                }
                DeleteNode(tln);
            }
            else
            {
                Ps_pdtypenode pf = new Ps_pdtypenode();
                pf.ID = tln["ID"].ToString();
                string nodestr = tln["AreaName"].ToString();
                try
                {
                    TreeListNode node = tln.TreeList.FindNodeByKeyID(pf.ID);
                    if (node != null)
                        tln.TreeList.DeleteNode(node);
                    RemoveDataTableRow(dt, pf.ID);
                    Services.BaseService.Delete<Ps_pdtypenode>(pf);

                }
                catch (Exception e)
                {

                    MessageBox.Show(e.Message + "删除结点出错!");
                }

            }
        }
コード例 #7
0
ファイル: DMWindow.xaml.cs プロジェクト: StarOrigin/dam
 private void InitFolder(TreeListNode treeListNode)
 {
     fileTree.BeginDataUpdate();
     InitFolders(treeListNode);
     InitFiles(treeListNode);
     fileTree.EndDataUpdate();
 }
コード例 #8
0
        private void PopulateTreeFromMessageGroups(IEnumerable<IGrouping<string, MessageDto>> messageGroups)
        {
            foreach (var group in messageGroups)
            {
                var firstOrDefault = group.FirstOrDefault();
                if (firstOrDefault == null) continue;
                var parent = new TreeListNode(firstOrDefault.ApplicationName);

                foreach (var message in group)
                {
                    var child = new TreeListNode(message.ApplicationName);
                    child.SubItems.Add(message.MachineName);
                    child.SubItems.Add(message.InsertDate.ToString());
                    child.SubItems.Add(message.ExceptionType);
                    child.SubItems.Add(message.ExceptionMessage);
                    child.SubItems.Add(message.HelpText);
                    child.SubItems.Add(message.CommandLineArgs);
                    child.SubItems.Add(message.StackTrace);
                    child.SubItems.Add(message.Id.ToString());
                    parent.Nodes.Add(child);
                    TotalMessages++;
                }

                tlvMessages.Nodes.Add(parent);
            }
        }
コード例 #9
0
        public void Capnhattree()
        {
            treeView1.BeginUnboundLoad();
            //cha.Tag = "Root";
            //Lay ten menugoc
            goc = treeView1.AppendNode(new object[] { dtCompany.Rows[0]["CompanyID"],dtCompany.Rows[0]["CompanyFullName"] }, cha);
            //Load danh sach Division
            foreach (DataRow dvi in dtDivision.Rows)
            {
                cap1 = treeView1.AppendNode(new object[] { dvi["DivisionID"], dvi["DivisionName"] }, goc);
                foreach (DataRow dpe in dtDepartment.Select(string.Format("DivisionID ={0}",dvi["DivisionID"])))
                {
                    cap2 = treeView1.AppendNode(new object[] { dpe["DepartmentID"], dpe["DepartmentName"] },cap1);
                    foreach (DataRow sec in dtSection.Select(string.Format("DepartmentID ={0}", dpe["DepartmentID"])))
                    {
                        cap3 = treeView1.AppendNode(new object[] { sec["SectionID"], sec["SectionName"] }, cap2);
                        foreach (DataRow gro in dtGroup.Select(string.Format("SectionID ={0}", sec["SectionID"])))
                        {
                            cap4 = treeView1.AppendNode(new object[] { gro["GroupID"], gro["GroupName"] }, cap3);
                        }
                    }
                }

            }
            treeView1.ExpandAll();
            treeView1.FocusedNode = goc;
            treeView1.EndUnboundLoad();
        }
コード例 #10
0
        public override IEnumerable<TreeListNode> FindChildNode(TreeListNode mine, Guid id)
        {
            var result = new List<TreeListNode>();
            if (Id == id) result.Add(mine);

            return result;
        }
コード例 #11
0
        public void Execute(TreeListNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }
            if (node.Nodes.Count > 0)
            {
                return;
            }
            ChoiceActionItem choiceActionItem = node.Tag as ChoiceActionItem;
            if (choiceActionItem == null)
            {
                return;
            }
            if (!this.IsConfirmed(choiceActionItem))
            {
                return;
            }

            // workaround for xpand master-detail
            // master-detail подписывается на событие Executing ВСЕХ action главного фрейма и отменяет их, когда в интерфейсе выбран detail
            // убираем эту подписку с нашего action
            Aurum.Menu.Utils.EventHelper.RemoveEventHandler(this.action, "Executing", d => d.Method != null && d.Method.Name != null && d.Method.Name.Contains("PushExecutionToNestedFrame"));

            this.action.DoExecute(choiceActionItem);
        }
コード例 #12
0
ファイル: DMWindow.xaml.cs プロジェクト: StarOrigin/dam
        private void InitFolders(TreeListNode treeListNode)
        {
            Directory item = treeListNode.Content as Directory;
            if (item == null) return;

            try
            {
                string[] root = Helper.GetDirectories(item.Path);
                foreach (string s in root)
                {
                    TreeListNode node = new TreeListNode()
                    {
                        Content = new Directory() { Name = Helper.GetDirectoryName(s), Parent = item },
                        Image = FileSystemImages.ClosedFolderImage
                    };
                    treeListNode.Nodes.Add(node);
                    node.IsExpandButtonVisible = HasFiles(s) ?
                        DefaultBoolean.True : DefaultBoolean.False;
                }
            }
            catch
            {
                treeListNode.IsExpandButtonVisible = DefaultBoolean.False;
            }
        }
コード例 #13
0
ファイル: FormClass.cs プロジェクト: EdgarEDT/myitoppsp
        public void AddNodeDataToDataTable(DataTable dt, TreeListNode node, List<string> listColID)
        {
            DataRow newRow = dt.NewRow();
            foreach (string colID in listColID)
            {
                //���������ڶ��㼰�Ժ���ǰ��ӿո�
                if (colID == "StuffName" && node.ParentNode != null)
                {
                    newRow[colID] = "����" + node[colID];
                }
                else
                {
                    newRow[colID] = node[colID];
                }
            }

            //�����������ӿ���
            if (node.ParentNode == null && dt.Rows.Count > 0)
            {
                dt.Rows.Add(new object[] { });
            }

            dt.Rows.Add(newRow);

            foreach (TreeListNode nd in node.Nodes)
            {
                AddNodeDataToDataTable(dt, nd, listColID);
            }
        }
コード例 #14
0
ファイル: ReconView.xaml.cs プロジェクト: shukla2009/Personal
 private void SetForChildren(TreeListNode node, bool value)
 {
     foreach (TreeListNode childNode in node.Nodes)
     {
         ((ReconTrade)childNode.Content).Visible = value;
         SetForChildren(childNode, value);
     }
 }
コード例 #15
0
 private void GetSelection(List<AuthorizationCommand> list, TreeListNode node)
 {
     foreach (TreeListNode child in node.Nodes) {
         if (child.CheckState == CheckState.Checked && child.Tag != null)
             list.Add(child.Tag as AuthorizationCommand);
         if (child.Nodes.Count > 0)
             GetSelection(list, child);
     }
 }
コード例 #16
0
ファイル: GPGTreeList.cs プロジェクト: micheljung/gpgnetfix
 public override TreeListNode AppendNode(object nodeData, TreeListNode parentNode)
 {
     TreeListNode node = base.AppendNode(nodeData, parentNode);
     if (this.OnNewNode != null)
     {
         this.OnNewNode(node);
     }
     return node;
 }
コード例 #17
0
 void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) {
     if (FocusedNodeChanged != null)
     {
         focusedNode = e.Node;
         //FocusedNodeChanged(treeList1, treeList1.GetDataRecordByNode(e.Node) as mModule);
         mModule md = MainHelper.PlatformSqlMap.GetOne<mModule>(" where Modu_ID='" + e.Node["Modu_ID"] + "'");
         FocusedNodeChanged(treeList1, md);
     }
 }
コード例 #18
0
 /// <summary>
 ///     Получить Id всех предков для данной ветки
 /// </summary>
 /// <param name="node">Текущая ветка</param>
 /// <param name="idFieldName">Имя столбца с id</param>
 /// <returns>Cписок всех Id</returns>
 public static IEnumerable<int> ParentsNodesGetIds(TreeListNode node, string idFieldName)
 {
     var result = new List<int>();
     while (node != null)
     {
         result.Add(Convert.ToInt32(node.GetValue(idFieldName)));
         node = node.ParentNode;
     }
     return result;
 }
コード例 #19
0
 public static TreeListNode NodeFromItem(TreeItemDto item)
 {
     var node = new TreeListNode()
     {
         Content = item,
         IsExpandButtonVisible = item.IsContainChildren() ? DefaultBoolean.True : DefaultBoolean.False,
         Image = item.GetMyImage()
     };
     return node;
 }
コード例 #20
0
ファイル: GoodsReturnStateForm.cs プロジェクト: pvx/ShopOrder
 public override void Execute(TreeListNode node)
 {
     var fn = node.GetValue(0);
     if( fn is ReturnObj)
     {
         var ret = (ReturnObj) fn;
         if (ret.Id == _returnObj.Id)
             nodeCore = node;
     }
 }
コード例 #21
0
		protected override bool OnBeforeChangeExpanded(
			TreeListNode node,
			bool newVal)
		{
			if (newVal)
			{
				CheckExpandDynamicNodes(node);
			}

			return base.OnBeforeChangeExpanded(node, newVal);
		}
コード例 #22
0
		protected override Point GetDataBoundsLocation(TreeListNode node, int top)
		{
			var result = base.GetDataBoundsLocation(node, top);
			if (!((EmptyImageTreeList)TreeList).CanCheckNode(node))
				result.X -= RC.CheckBoxSize.Width;
			if (Size.Empty != RC.SelectImageSize && -1 == node.SelectImageIndex)
				result.X -= RC.SelectImageSize.Width;
			if (Size.Empty != RC.StateImageSize && -1 == node.StateImageIndex)
				result.X -= RC.StateImageSize.Width;
			return result;
		}
コード例 #23
0
        public override IEnumerable<TreeListNode> FindChildNode(TreeListNode mine, Guid id)
        {
            var result = new List<TreeListNode>();
            if (Id == id) result.Add(mine);

            foreach (var node in mine.Nodes
                .Where(node => node.Content is TreeItemDto))
                result.AddRange(((TreeItemDto)node.Content).FindChildNode(node, id));

            return result;
        }
コード例 #24
0
        public void InitFolder(TreeListNode treeListNode)
        {
            _treeListControl.BeginDataUpdate();

            var dto = treeListNode.Content as TreeItemDto;
            if (dto == null) throw new NotImplementedException();

            var children = dto.GetChildren();
            AddChildren(treeListNode.Nodes, children);

            _treeListControl.EndDataUpdate();
        }
コード例 #25
0
 public override void Execute(TreeListNode node)
 {
     if (node.HasAsParent(_parentNode))
         node.SetValue(_column, _state);
     else
     {
         if (_parentNode.HasAsParent(node))
             if (_state)
                 node[_column] = _state;
             else node[_column] = !_state;
     }
 }
コード例 #26
0
ファイル: FrmSite.cs プロジェクト: haiming929/LDL
        void GetCheckNode(TreeListNode node, List<CoSite> lstSelectedItem)
        {
            if (node.CheckState == CheckState.Checked)
            {
                string code = node.GetValue("Code").ToString();
                CoSite site = DataSource.Find(obj => obj.Code == code);
                lstSelectedItem.Add(site);
            }

            foreach (TreeListNode childrenNode in node.Nodes)
                GetCheckNode(childrenNode, lstSelectedItem);
        }
コード例 #27
0
ファイル: FrmDictionary.cs プロジェクト: hy1314200/HyDM
        public void Init()
        {
            tlDictionary.ClearNodes();

            m_NodeRoot = tlDictionary.AppendNode(new object[] { "所有字典项", null }, null);

            IList<DictItem> diRootList = DictHelper.GetRootTypeList();
            foreach (DictItem di in diRootList)
            {
                BoundDictItem(di, m_NodeRoot);
            }
            m_NodeRoot.Expanded = true;
        }
コード例 #28
0
		private void updateNodeInfo(
			TreeListNode node)
		{
			if (node != null && node.TreeList != null && node.Tag != null)
			{
				LogCentral.Current.LogInfo(
					string.Format(
					@"Updating node info of node '{0}'.",
					node[0]));

				updateNodeStateImage(node, AsynchronousMode.Asynchronous);
			}
		}
コード例 #29
0
ファイル: ucMailTree.cs プロジェクト: treejames/MESDemo
 void CreateMessagesForNode(TreeListNode node)
 {
     List<Message> messages = new List<Message>();
     MailType mailType = (MailType)node.GetValue(colType);
     MailFolder mailFolder = (MailFolder)node.GetValue(colFolder);
     foreach(Message message in DataHelper.Messages) {
         if(message.MailType == mailType &&
             (message.MailFolder == mailFolder || mailFolder == MailFolder.All) &&
             !message.Deleted)
                 messages.Add(message);
     }
     node.SetValue(colData, messages);
 }
コード例 #30
0
 private static string GetPath(TreeListNode focusNode, string field)
 {
     if (focusNode == null) return "";
     if (focusNode.ParentNode == null)
     {
         if (focusNode["ID"].Equals(focusNode["ID_ROOT"])) return "";
         return focusNode["NAME"].ToString();
     }
     string parentRoot = GetPath(focusNode.ParentNode, field);
     if (parentRoot != "")
         return parentRoot + "\\" + focusNode["NAME"];
     else return focusNode["NAME"].ToString();
 }
コード例 #31
0
        /// <summary>
        /// 新增大分类
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddParent_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TreeListNode focusNode = treeListDiagRep.FocusedNode;

            if (this.treeListDiagRep.FocusedNode != null)
            {
                string        DiagID    = lookUpEditType.EditValue.ToString();
                AddParentNode addParent = new AddParentNode(m_App, DiagID);
                addParent.StartPosition = FormStartPosition.CenterParent;//弹出窗体在父窗体中间
                if (addParent.ShowDialog() == DialogResult.OK)
                {
                    string m_returnTitle = string.Empty; //返回标题
                    string m_returnNode  = string.Empty; //返回节点
                    string m_returnPNode = string.Empty; //返回父节点
                    addParent.SetTitleContent(out m_returnTitle);
                    //TreeListNode leafnd = treeListDiagRep.AppendNode(new object[] { leftrow["TITLE"], leftrow["CONTENT"], leftrow["PARENT_NODE"], leftrow["NODE"], leftrow["ID"] }, nd);
                    TreeListNode leafnode = treeListDiagRep.AppendNode(new object[] { m_returnTitle, "", addParent.RPNode, addParent.RNode, addParent.RNode }, null);

                    DataRow m_row = ReturnRow(m_returnTitle, "", addParent.RPNode, addParent.RNode, nID);
                    leafnode.Tag = m_row;
                    treeListDiagRep.FocusedNode = leafnode;
                }
            }
        }
コード例 #32
0
        public void Fill_TrlRoute_PlantWise()
        {
            try
            {
                DataTable dt  = new DataTable();
                DataTable dtt = new DataTable();

                dtt = RouteConn.getdata(CommandType.Text, "select distinct a.Id ,a.Route_Name from route_data a left join route_data1 b on a.id=b.ID where Route_Level='" + CmbLevel.Text.Trim().ToString() + "' and databasename='" + PublicClass.User_DataBase + "' ");
                dt  = RouteConn.getdata(CommandType.Text, "select distinct a.Id,a.Route_Name,a.Route_Level,b.Type_ID  from route_data a left join route_data1 b on a.id=b.ID where Route_Level='" + CmbLevel.Text.Trim().ToString() + "' and databasename='" + PublicClass.User_DataBase + "' ");


                foreach (DataRow drr in dtt.Rows)
                {
                    TreeListNode node = null;
                    node = trlRoute11.AppendNode(new object[] { Convert.ToString(drr["Id"]), Convert.ToString(drr["Route_Name"]), "Route" }, node);
                    trlRoute11.SetFocusedNode(node);
                    foreach (DataRow dr in dt.Select("Id ='" + Convert.ToString(drr["Id"]).Trim() + "' "))
                    {
                        Insert_Plant(PublicClass.DefVal(Convert.ToString(dr["Type_ID"]), "0"));
                    }
                }
            }
            catch { }
        }
コード例 #33
0
        private void AddPluToTree(string pluText, string pluPrice)
        {
            string[] temp = lblQty.Text.ToString().Split(':');

            int Qty = int.Parse(temp[1].Trim());

            pluText = Qty + " x " + pluText;

            decimal price = decimal.Parse(pluPrice.ToString());

            price *= Qty;

            NodePlu = mgr.CreatePLUNode(pluText, price);

            treeList1.EndUnboundLoad();

            treeList1.ExpandAll();

            panelPlu.Visible = false;

            panelColor.Visible = true;

            lblQty.Text = "Qty: 1";
        }
コード例 #34
0
        private bool Edit_Node(TreeListNode n)
        {
            bool flag = false;

            using (MySqlConnection mycon = new MySqlConnection(CommonSetting.Default.ConStr_Inspection))
            {
                mycon.Open();
                MySqlCommand mcmd = new MySqlCommand("UPDATE t_station set PID='" + n["PID"]
                                                     + "',TelCode='" + n["TelCode"]
                                                     + "',StationName='" + n["StationName"]
                                                     + "',IP='" + n["IP"]
                                                     + "' WHERE ID='" + n["ID"] + "';", mycon);
                if (mcmd.ExecuteNonQuery() > 0)
                {
                    flag = true;
                }
                else
                {
                    flag = false;
                }
                mycon.Close();
            }
            return(flag);
        }
コード例 #35
0
 /// <summary>
 /// 同步的展开树节点,选中节点信息
 /// </summary>
 /// <param name="targetTree">TreeList</param>
 public void LoadState(TreeList targetTree)
 {
     targetTree.BeginUpdate();
     try
     {
         targetTree.CollapseAll();
         TreeListNode node;
         foreach (object key in expanded)
         {
             node = targetTree.FindNodeByKeyID(key);
             if (node != null)
             {
                 node.Expanded = true;
             }
         }
         foreach (object key in selected)
         {
             node = targetTree.FindNodeByKeyID(key);
             if (node != null)
             {
                 targetTree.Selection.Add(node);
             }
         }
         targetTree.FocusedNode = targetTree.FindNodeByKeyID(focused);
     }
     finally
     {
         targetTree.EndUpdate();
         TreeListNode _tagFocusedNode = targetTree.FocusedNode;
         if (_tagFocusedNode != null)
         {
             targetTree.TopVisibleNodeIndex = targetTree.GetVisibleIndexByNode(_tagFocusedNode);
             targetTree.MakeNodeVisible(_tagFocusedNode);
         }
     }
 }
コード例 #36
0
ファイル: CachedForm.cs プロジェクト: 1059444127/Dicom-4
        private void LoadList()
        {
            foreach (var receivedDicomElements in dicomServiceWorker.ListCachedElements.Where(x => x.ImageStatus == ImageMemoryStatus.CachedInMemory))
            {
                var cachedDicomElements = dicomServiceWorker.CreateCachedFromReceived(receivedDicomElements);

                var node = new TreeListNode
                {
                    Text           = cachedDicomElements.ReceivedDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff"),
                    AdditionalData = receivedDicomElements
                };


                node.SubItems.Add(cachedDicomElements.CallingAeTitle);
                node.SubItems.Add(cachedDicomElements.IpAddress);
                node.SubItems.Add(cachedDicomElements.ImageSource.ToString());
                node.SubItems.Add(cachedDicomElements.PatientName);
                node.SubItems.Add(cachedDicomElements.PatientId);
                node.SubItems.Add(cachedDicomElements.Modality);
                node.SubItems.Add(cachedDicomElements.AccessionNumber);

                tlvCache.Nodes.Add(node);
            }
        }
コード例 #37
0
        private void AddNodeDataToDataTable(DataTable dt, TreeListNode node, List <string> listColID)
        {
            DataRow newRow = dt.NewRow();

            foreach (string colID in listColID)
            {
                //分类名,第二层及以后在前面加空格
                if (colID == "Title" && node.ParentNode != null)
                {
                    newRow[colID] = "  " + node[colID];
                }
                else
                {
                    newRow[colID] = node[colID];
                }
            }

            dt.Rows.Add(newRow);

            foreach (TreeListNode nd in node.Nodes)
            {
                AddNodeDataToDataTable(dt, nd, listColID);
            }
        }
コード例 #38
0
        /// <summary>
        /// CheckNode
        /// </summary>
        /// <param name="node"></param>
        internal void CheckNode(TreeListNode node)
        {
            EntityFunction vo = Viewer.tvFunction.GetDataRecordByNode(node) as EntityFunction;

            vo.imageIndex = (node.CheckState == CheckState.Checked ? 1 : 0);
            if (Viewer.gvRole.FocusedRowHandle >= 0)
            {
                if (Function.Int(GetFieldValueStr(Viewer.gvRole, Viewer.gvRole.FocusedRowHandle, EntityCodeRole.Columns.isEdit)) > 0)
                {
                    EntityRoleFunction voFunc = new weCare.Core.Entity.EntityRoleFunction();
                    voFunc.Rolecode = GetFieldValueStr(Viewer.gvRole, Viewer.gvRole.FocusedRowHandle, EntityCodeRole.Columns.roleCode);
                    voFunc.Funcid   = vo.Funcid;
                    using (ProxyDictionary proxy = new ProxyDictionary())
                    {
                        int ret = proxy.Service.SaveRoleFunc(voFunc, vo.imageIndex);
                        if (ret < 0)
                        {
                            DialogBox.Msg("权限分配失败。");
                        }
                    }
                }
            }
            Viewer.tvFunction.RefreshNode(node);
        }
コード例 #39
0
ファイル: Form1_FT.cs プロジェクト: github188/myitoppsp
        //读取数据
        private void LoadValues(Hashtable hashtable)
        {
            PSP_P_Values PSP_P_Values = new PSP_P_Values();

            PSP_P_Values.ID = typeFlag2;//用ID字段存放Flag2的值

            IList <PSP_P_Values> listValues = Common.Services.BaseService.GetList <PSP_P_Values>("SelectPSP_P_ValuesListByFlag2", PSP_P_Values);

            foreach (PSP_P_Values value in listValues)
            {
                TreeListNode node = treeList1.FindNodeByFieldValue("ID", value.TypeID);
                if (node != null)
                {
                    try
                    {
                        if (hashtable.ContainsValue(value.Year))
                        {
                            node.SetValue(value.Year + "年", value.Value);
                        }
                    }
                    catch { }
                }
            }
        }
コード例 #40
0
        /// <summary>
        /// 小模板列表 - 加载树
        /// </summary>
        /// <param name="id"></param>
        /// <param name="row"></param>
        /// <param name="node"></param>
        /// <param name="catalog"></param>
        private void LoadTree(string id, DataRow row, TreeListNode node, string catalog)
        {

            try
            {
                TreeListNode nd = treeListPersonTemplate.AppendNode(new object[] { id, row["NAME"], "Folder", row["ISPERSON"], row["CREATEUSERS"] }, node);
                nd.Tag = row;

                //查找叶子节点
                DataRow[] leafRows = m_MyLeafs.Select("PARENTID='" + id + "' ");
                if (leafRows.Length > 0)
                {
                    foreach (DataRow leaf in leafRows)
                    {
                        TreeListNode leafnd = treeListPersonTemplate.AppendNode(new object[] { leaf["Code"], leaf["NAME"], "Leaf", leaf["ISPERSON"], leaf["CREATEUSERS"] }, nd);
                        TempletItem item = new TempletItem(leaf);
                        if (item.Content.Contains("||chr(10)||chr(13)||"))//存在换行,替代插入数据库中 edit by ywk
                        {
                            item.Content = item.Content.Replace("'||chr(10)||chr(13)||'", "\r\n");
                        }
                        item.CatalogName = row["NAME"].ToString();
                        leafnd.Tag = item;
                    }
                }

                DataRow[] rows = m_MyTreeFolders.Select("Previd='" + id + "' ");
                foreach (DataRow dr in rows)
                {
                    LoadTree(dr["ID"].ToString(), dr, nd, catalog);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #41
0
        /// <summary>
        /// 计算子分类的线损电量
        /// </summary>
        /// <param name="year"></param>
        /// <param name="node0">用电量</param>
        /// <param name="node1">供电量</param>
        /// <param name="node2">线损电量</param>
        /// <param name="column">要计算的列</param>
        public void ComputeXianSun1(int year, TreeListNode node0, TreeListNode node1, TreeListNode node2)
        {
            if (node0.HasChildren == false || node1.HasChildren == false || node2.HasChildren == false)
            {
                return;
            }
            for (int i = 0; i < node2.Nodes.Count; i++)
            {
                try
                {
                    if (node0.Nodes[i][year + "年"].ToString() != "" && node1.Nodes[i][year + "年"].ToString() != "")
                    {
                        ComputeXianSun1(year, node0.Nodes[i], node1.Nodes[i], node2.Nodes[i]);
                        node2.Nodes[i].SetValue(year + "年", Math.Round(Convert.ToDouble(node0.Nodes[i][year + "年"].ToString()) - Convert.ToDouble(node1.Nodes[i][year + "年"].ToString()), 1));
                    }
                }
                catch { }
            }
            ////TreeListNode childNode0 = node0.Nodes.FirstNode;

            ////if (parentNode == null)
            ////{
            ////    return;
            ////}


            ////try
            ////{

            ////    if (treeList1.Nodes[0][year + "年"].ToString() != "" && treeList1.Nodes[1][year + "年"].ToString() != "")
            ////    {
            ////        treeList1.Nodes[2].SetValue(year + "年", Math.Round(Convert.ToDouble(treeList1.Nodes[0][year + "年"].ToString())-Convert.ToDouble(treeList1.Nodes[1][year + "年"].ToString()) , 1));
            ////    }
            ////}
            ////catch { }
        }
コード例 #42
0
        void GreyState(TreeListNode senderNode)
        {
            if (senderNode == null)
            {
                return;
            }
            bool singlePolicyView = (_mainForm != null && _mainForm.GetTreeListBuilder() != null && _mainForm.GetTreeListBuilder().SinglePolicyView);

            mniMovePolicyDown.Enabled       = senderNode.NextNode != null && !singlePolicyView;
            mniMovePolicyUp.Enabled         = senderNode.PrevNode != null && !singlePolicyView;
            mniPastePolicyAfter.Enabled     = mniPastePolicyBefore.Enabled = EM_AppContext.Instance.GetPastePolicyAction() != null && !singlePolicyView;
            mniPasteReferenceBefore.Enabled = mniPasteReferenceAfter.Enabled = !_mainForm._isAddOn &&
                                                                               EM_AppContext.Instance.GetPastePolicyAction() != null &&
                                                                               EM_AppContext.Instance.GetPastePolicyAction().GetCopyCountryShortName() == _mainForm.GetCountryShortName() &&
                                                                               !singlePolicyView;
            mniPasteFunction.Enabled      = EM_AppContext.Instance.GetPasteFunctionAction() != null && !PolicyTreeListTag.IsReferencePolicy(senderNode);
            mniCopyPolicy.Enabled         = !PolicyTreeListTag.IsReferencePolicy(senderNode);
            mniRenamePolicy.Enabled       = !PolicyTreeListTag.IsReferencePolicy(senderNode);
            mniChangePolicyType.Enabled   = !PolicyTreeListTag.IsReferencePolicy(senderNode);
            mniPrivate.Enabled            = !_mainForm._isAddOn;
            mniGoToReferredPolicy.Enabled = PolicyTreeListTag.IsReferencePolicy(senderNode);
            mniAddPolicyAfter.Enabled     = !singlePolicyView;
            mniAddPolicyBefore.Enabled    = !singlePolicyView;
            mniDeletePolicy.Enabled       = !singlePolicyView;
            //the following is in fact not really correct (a reasonable copy of the selection is only possible if the policy-name-cell lies within the selection and the selection contains editable cells)
            //it's aim is just to indicate that it is not possible to copy the values of the policy with this menu (unless they are selected)
            mniCopyValues.Enabled  = _mainForm.GetMultiCellSelector().HasSelection();
            mniPasteValues.Enabled = !MultiCellSelector.IsClipboardEmpty();
            if (_mniAddFunction == null)
            {
                return;
            }
            _mniAddFunction.Enabled = !PolicyTreeListTag.IsReferencePolicy(senderNode);
            mniGroups.Enabled       = !_mainForm._isAddOn;
            mniExtensions.Enabled   = !_mainForm._isAddOn;
        }
コード例 #43
0
        /// <summary>
        /// 获取筛选节点到根节点的所有信息
        /// </summary>
        /// <param name="focusedNode">TreeListNode</param>
        /// <param name="columnID">列名称</param>
        /// <param name="compareNodeRule">规则委托</param>
        /// <param name="buildPathRule">规则委托</param>
        /// <returns>路径信息</returns>
        public static string FilterPathInfo(this TreeListNode focusedNode, string columnID, CompareNodeRule compareNodeRule, BuildPathRule buildPathRule)
        {
            if (focusedNode == null)
            {
                throw new ArgumentNullException("focusedNode");
            }
            if (string.IsNullOrEmpty("columnID"))
            {
                throw new ArgumentNullException("columnID");
            }
            string _fullPathInfo = string.Empty;

            _fullPathInfo = focusedNode.GetDisplayText(columnID);
            while (focusedNode.ParentNode != null)
            {
                focusedNode = focusedNode.ParentNode;
                if (compareNodeRule(focusedNode))
                {
                    string _nodeText = focusedNode.GetDisplayText(columnID).Trim();
                    _fullPathInfo = buildPathRule(_nodeText, _fullPathInfo);
                }
            }
            return(_fullPathInfo);
        }
コード例 #44
0
        //当子分类数据改变时,计算其父分类的值
        private void CalculateSum(TreeListNode node, TreeListColumn column)
        {
            TreeListNode parentNode = node.ParentNode;

            if (parentNode == null)
            {
                return;
            }

            double sum = 0;

            foreach (TreeListNode nd in parentNode.Nodes)
            {
                object value = nd.GetValue(column.FieldName);
                if (value != null && value != DBNull.Value)
                {
                    sum += Convert.ToDouble(value);
                }
            }

            parentNode.SetValue(column.FieldName, sum);

            CalculateSum(parentNode, column);
        }
コード例 #45
0
        private void InitFiles(TreeListNode treeListNode)
        {
            FileSystemItem item = treeListNode.Content as FileSystemItem;

            if (item == null)
            {
                return;
            }
            TreeListNode node;

            try {
                string[] root = Helper.GetFiles(item.FullName);
                foreach (string s in root)
                {
                    node = new TreeListNode()
                    {
                        Content = new FileSystemItem(Helper.GetFileName(s), "File", Helper.GetFileSize(s).ToString(), s), Image = FileSystemImages.FileImage
                    };
                    node.IsExpandButtonVisible = DefaultBoolean.False;
                    treeListNode.Nodes.Add(node);
                }
            }
            catch { }
        }
コード例 #46
0
 private void treeList1_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         if (!_hasTotalRight)
         {
             return;
         }
         Point clickPoint = new Point(e.X, e.Y);
         DevExpress.XtraTreeList.TreeListHitInfo hInfo = treeList1.CalcHitInfo(new Point(e.X, e.Y));
         if (hInfo.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell) //在单元格上右击了
         {
             TreeListNode node = hInfo.Node;
             treeList1.FocusedNode = node;
             if (!_isApply && hInfo.Node != null)
             {
                 toolStripMenuItemAdd.Visible    = false;;
                 toolStripMenuItemDelete.Visible = false;
                 toolStripMenuItemRename.Visible = false;
                 if (hInfo.Node.ParentNode != null && hInfo.Node.ParentNode.ParentNode != null && !hInfo.Node.HasChildren)
                 {
                     toolStripMenuItemAdd.Visible    = false;
                     toolStripMenuItemDelete.Visible = true;
                     toolStripMenuItemRename.Visible = true;
                 }
                 else if (hInfo.Node.HasChildren || hInfo.Node.ParentNode == null || hInfo.Node.ParentNode.ParentNode == null)
                 {
                     toolStripMenuItemAdd.Visible    = true;
                     toolStripMenuItemDelete.Visible = false;
                     toolStripMenuItemRename.Visible = false;
                 }
                 contextMenuStrip1.Show(treeList1, e.X, e.Y);
             }
         }
     }
 }
コード例 #47
0
ファイル: frmNodeManager.cs プロジェクト: aehyok/ServerMeta
        private void InitConceptGroup(TreeListNode _fnode)
        {
            using (MetaDataServiceClient _mdc = new MetaDataServiceClient())
            {
                IList <MD_ConceptGroup> _groups = _mdc.GetConceptGroups();
                foreach (MD_ConceptGroup _group in _groups)
                {
                    TreeListNode _node = treeList1.AppendNode(null, _fnode);
                    _node.ImageIndex       = 1;
                    _node.SelectImageIndex = 0;

                    _node.SetValue(this.treeListColumn1, _group);
                    _node.HasChildren = true;
                    foreach (MD_ConceptItem _item in _group.Items)
                    {
                        TreeListNode _cnode = treeList1.AppendNode(null, _node);
                        _cnode.ImageIndex       = 1;
                        _cnode.SelectImageIndex = 0;
                        _cnode.SetValue(this.treeListColumn1, _item);
                        _cnode.HasChildren = false;
                    }
                }
            }
        }
コード例 #48
0
        /// <summary>
        /// treelist初始化
        /// </summary>
        private void InitTreeList()
        {
            _qiXieTempletMaster = CommonService.ClientInstance.GetQiXieTempletMaster();
            _deptDict           = ApplicationModel.Instance.AllDictList.DeptDictList;// ExtendAppContext.Current.CommDict.DeptDict;
            foreach (MED_DEPT_DICT row in _deptDict)
            {
                deptNames.Add(row.DEPT_NAME);
            }
            treeList1.Nodes.Clear();
            TreeListNode nodeZhuBao = treeList1.AppendNode(new object[] { "主包" }, null);

            nodeZhuBao.Tag = 0;
            TreeListNode nodeFuBao = treeList1.AppendNode(new object[] { "副包" }, null);

            nodeFuBao.Tag = 1;
            if (_qiXieTempletMaster != null && _qiXieTempletMaster.Count > 0)
            {
                foreach (MED_QIXIE_TEMPLET_MASTER prow in _qiXieTempletMaster)
                {
                    AppendNode(prow);
                }
            }
            treeList1.ExpandAll();
        }
コード例 #49
0
        internal void HandleEnterKey(KeyEventArgs keyEventArgs)
        {
            if (keyEventArgs.KeyCode == Keys.Enter && !keyEventArgs.Control && !keyEventArgs.Shift && !keyEventArgs.Alt)
            {
                keyEventArgs.Handled          = false;
                keyEventArgs.SuppressKeyPress = false;

                TreeListNode node = _treeAcronyms.FocusedNode;
                if (node == null)
                {
                    return;
                }

                if (node.Nodes.Count > 0 && node.Expanded) //node has visible child-nodes: select first child
                {
                    _treeAcronyms.FocusedNode = node.Nodes.FirstNode;
                    return;
                }
                while (true)
                {
                    if (node.NextNode != null) //node is not the last on its level: select next
                    {
                        _treeAcronyms.FocusedNode = node.NextNode;
                        return;
                    }
                    if (node.ParentNode != null)
                    {
                        node = node.ParentNode; //node is last on its level, but not the very last: move one level up and try again
                    }
                    else
                    {
                        return; //node is the very last
                    }
                }
            }
        }
コード例 #50
0
        /// <summary>
        /// 递归程序的子程序
        /// </summary>
        /// <param name="tv"></param>
        /// <param name="parent"></param>
        /// <param name="parentNode"></param>
        private void CreateGroupTreeViewChild(TreeList tv, ToolStripMenuItem parent, TreeListNode parentNode)
        {
            foreach (ToolStripItem item in parent.DropDownItems)
            {
                if (item is ToolStripSeparator)
                {
                    continue;
                }
                if (item.Enabled == false)
                {
                    continue;
                }

                TreeListNode node = tv.AppendNode(new object[] { item.Text }, parentNode);
                node.StateImageIndex = 1;

                node.Tag = item;

                if (item is ToolStripMenuItem && (item as ToolStripMenuItem).DropDownItems.Count > 0)
                {
                    CreateGroupTreeViewChild(tv, item as ToolStripMenuItem, node);
                }
            }
        }
コード例 #51
0
 /// <summary>
 /// 新增大分类
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barButtonItemNewRoot_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     //新增大分类的时候清空上次的值  ywk
     m_ItemCatalog = new ItemCatalog(m_app);
     m_ItemCatalog.BigOrSmallItem = "big";
     m_ItemCatalog.CreateUser     = m_app.User.Id;
     m_ItemCatalog.CanChangeFlag  = true;
     m_ItemCatalog.SetContainerCodeEditFlag(true);
     m_ItemCatalog.SetIsPersonEditFlag(true);
     if (m_ItemCatalog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         try
         {
             string id = Guid.NewGuid().ToString();
             //string createuser = "";
             //if (m_ItemCatalog.IsPerson == "1")无论新增的是科室小模板还是个人小模板,都往数据库插入创建人
             string createuser = m_app.User.Id;
             sqlHelper.ExecuteNoneQuery(string.Format(sql_insertCatalog, id, DS_Common.FilterSpecialCharacter(m_ItemCatalog.ITEMNAME), string.Empty, 1, DS_Common.FilterSpecialCharacter(m_ItemCatalog.Memo),
                                                      m_app.User.CurrentDeptId, m_ItemCatalog.ContainerCode, m_ItemCatalog.IsPerson, DS_Common.FilterSpecialCharacter(createuser)));
             TreeListNode leafnode = treeList1.AppendNode(new object[] { id, m_ItemCatalog.ITEMNAME, "Folder", m_ItemCatalog.IsPerson, m_ItemCatalog.CreateUser, m_ItemCatalog.Memo, m_ItemCatalog.ContainerCode }, null);
             DataTable    dt       = sqlHelper.ExecuteDataTable("select * from emrtemplet_item_person_catalog where ID='" + id + "'");
             if (null != dt && dt.Rows.Count > 0)
             {
                 leafnode.Tag = dt.Rows[0];
             }
             //if (treeList1.FocusedNode != null)
             //    treeList1.FocusedNode.ExpandAll();
             m_app.CustomMessageBox.MessageShow("新增成功");
             treeList1.FocusedNode = leafnode;
         }
         catch (Exception EX)
         {
             m_app.CustomMessageBox.MessageShow(EX.Message);
         }
     }
 }
コード例 #52
0
        public TreeListNode FindNode(string KeyField)
        {
            string[]      KeyFields = KeyField.Split('.');
            TreeListNode  nd        = null;
            TreeListNodes nds;
            string        CurrField = string.Empty;

            foreach (string KField in KeyFields)
            {
                if (CurrField.Length == 0)
                {
                    CurrField = KField;
                }
                else
                {
                    CurrField = string.Concat(CurrField, ".", KField);
                }
                nds = nd == null ? TreeList.Nodes : nd.Nodes;

                bool NodeFound = false;
                foreach (TreeListNode n in nds)
                {
                    if (((object[])n.Tag)[0].Equals(CurrField))
                    {
                        nd        = n;
                        NodeFound = true;
                        break;
                    }
                }
                if (!NodeFound)
                {
                    return(null);
                }
            }
            return(nd);
        }
コード例 #53
0
        private void Save()
        {
            //保存

            foreach (DataRow dataRow in dataTable.Rows)
            {
                TreeListNode row = treeList1.FindNodeByKeyID(dataRow["ID"]);


                Ps_Forecast_Math v = DataConverter.RowToObject <Ps_Forecast_Math>(dataRow);
                v.ID = row["ID"].ToString();
                foreach (TreeListColumn col in this.treeList1.Columns)
                {
                    if (col.FieldName.IndexOf("y") > -1)
                    {
                        object obj = row[col.FieldName];
                        if (obj != DBNull.Value)
                        {
                            v.GetType().GetProperty(col.FieldName).SetValue(v, obj, null);
                        }
                    }
                }
                v.Col1 = MIS.ProgUID;
                v.Col2 = row["Col2"].ToString();
                if (v.ParentID == "")
                {
                    v.Col4 = "yes";
                }
                try
                {
                    Services.BaseService.Update("UpdatePs_Forecast_MathByID", v);
                }
                catch { }
            }
            MsgBox.Show("保存成功!");
        }
コード例 #54
0
        public void UpdateNode(TreeListNode Node, BusinessEntity Entity)
        {
            if (Node == null)
            {
                return;
            }
            TreeList.BeginUnboundLoad();
            try
            {
                for (int i = 1; i < Columns.Length; i++)
                {
                    Node.SetValue(Columns[i],
                                  Td.GetFieldDef(Columns[i]).GetValue(Entity));
                }
                bool IsUpdate;
                if (Node.Tag != null)
                {
                    IsUpdate = (bool)((object[])Node.Tag)[1];
                }
                else
                {
                    IsUpdate = false;
                }

                Node.Tag = new object[] { Td.GetFieldDef(Columns[0])
                                          .GetValue(Entity), IsUpdate };
                if (onAfterUpdateNode != null)
                {
                    onAfterUpdateNode(Node, Entity);
                }
            }
            finally
            {
                TreeList.EndUnboundLoad();
            }
        }
コード例 #55
0
        /// <summary>
        /// 添加部门
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddDept_Click(object sender, EventArgs e)
        {
            TreeListNode trnsel = this.treeUser.FocusedNode;

            if (trnsel == null)
            {
                return;
            }
            string    pid   = basefun.valtag(Convert.ToString(trnsel.Tag), "ID");
            DataTable tab   = this.ds.Tables["用户信息"];
            DataRow   drnew = tab.NewRow();

            drnew["ID"]  = Guid.NewGuid().ToString();
            drnew["名称"]  = "匿名部门";
            drnew["代码"]  = BindManager.getCodeSn("");
            drnew["PID"] = pid;
            tab.Rows.Add(drnew);
            TreeListNode node;

            node                      = this.treeUser.AppendNode(new object[] { drnew["名称"].ToString(), drnew["ID"].ToString() }, this.treeUser.FocusedNode);
            node.Tag                  = "@ID=" + drnew["ID"].ToString() + ",@PID='',@编号=" + drnew["名称"].ToString() + "";
            node.ImageIndex           = 1;
            this.treeUser.FocusedNode = node;
        }
コード例 #56
0
ファイル: uBuyingMaterial.ascx.cs プロジェクト: ewin66/dev
        protected void treelstMaterialUnits_CellEditorInitialize(object sender, TreeListColumnEditorEventArgs e)
        {
            ASPxTreeList tree = sender as ASPxTreeList;

            if (e.Column.FieldName == "NumRequired" && e.NodeKey != null)
            {
                TreeListNode node = tree.FindNodeByKeyValue(e.NodeKey);
                //ViewMaterialUnitConstruction dataItem = (ViewMaterialUnitConstruction)node.DataItem;
                //ViewMaterialUnitConstruction fhjfj = (ViewMaterialUnitConstruction)grdMaterialOnCategory.GetRow(1);
                //if (dataItem.ParentMaterialMaterialUnitId.GetHashCode() == 0)
                //{
                //    e.Editor.ClientEnabled = false;
                //    e.Editor.Value = 1;
                //}
            }
            //else
            //{
            //    if (tree.NewNodeParentKey.GetHashCode() == 0)
            //    {
            //        e.Editor.ClientEnabled = false;
            //        e.Editor.Value = 1;
            //    }
            //}
        }
コード例 #57
0
ファイル: Form14.cs プロジェクト: github188/myitoppsp
        private void DeleteNode(TreeListNode node, int typeID)
        {
            if ((int)node["TypeID"] != typeID)
            {
                //删除时,从后面开始删除
                for (int i = node.Nodes.Count - 1; i > -1; i--)
                {
                    DeleteNode(node.Nodes[i], typeID);
                }
            }
            else
            {
                TreeListNode brotherNode = null;
                if (node.ParentNode.Nodes.Count > 1)
                {
                    brotherNode = node.PrevNode;
                    if (brotherNode == null)
                    {
                        brotherNode = node.NextNode;
                    }
                }
                treeList1.DeleteNode(node);

                //删除后,如果同级还有其它分类,则重新计算此类的所有年份数据
                if (brotherNode != null)
                {
                    foreach (TreeListColumn column in treeList1.Columns)
                    {
                        if (column.FieldName.IndexOf("Col") == 0)
                        {
                            CalculateSum(brotherNode, column);
                        }
                    }
                }
            }
        }
コード例 #58
0
        /// <summary>
        /// backtrack through hierarchy of parent nodes toggling the state of any that do not match the passed-in state
        /// </summary>
        /// <param name="node"></param>
        private void ToggleParentNodes(TreeListNode node, bool isChecked)
        {
            // a child node under this node (which is a parent node) was checked so now we need to see if all the other
            // child nodes under this node are checked. if they are we need to check this node
            if (isChecked == true)
            {
                // check all children of this node to see if all other children are checked - in which case we should check the parent
                bool allChildrenChecked = true;

                foreach (TreeListNode childNode in node.Nodes)
                {
                    if (childNode.Checked == false)
                    {
                        allChildrenChecked = false;
                    }
                }

                if (allChildrenChecked)
                {
                    ToggleTreeListNode(node, isChecked);
                }
            }
            // if any child node under this node was unchecked, uncheck this node (parent)
            else
            {
                ToggleTreeListNode(node, isChecked);
            }

            // keep going up the tree to all parents to toggle them accordingly
            TreeListNode parentNode = node.ParentNode;

            if (parentNode != null)
            {
                ToggleParentNodes(parentNode, isChecked);
            }
        }
コード例 #59
0
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            this.progressBarControl1.Position = 100;
            int _relationCount = 0;

            foreach (MDQuery_ChildTableRowCount _obj in this._childRowCountList)
            {
                if (_obj.RowCount > 0)
                {
                    _relationCount += _obj.RowCount;
                    MDModel_Table _ctable = this.QueryModel.ChildTableDict[_obj.TableName];
                    TreeListNode  _node   = this.treeList1.AppendNode(0, 0);
                    _node.SetValue("COLUMN1", _ctable.TableDefine.DisplayTitle);
                    _node.SetValue("COLUMN2", _obj.RowCount);
                    _node.SetValue("State", 0);
                    _node.Tag        = _ctable;
                    _node.ImageIndex = 0;
                }
            }
            this.labelState.Text             = string.Format("共检索到{0}条关联记录!", _relationCount);
            this.progressBarControl1.Visible = false;
            this.treeList1.ExpandAll();
            this.timer2.Enabled = false;
        }
コード例 #60
0
ファイル: PriceProductSales.aspx.cs プロジェクト: ewin66/dev
        protected void Page_Init(object sender, EventArgs e)
        {
            session             = XpoHelper.GetNewSession();
            dsInventory.Session = session;
            dsItemUnit.Session  = session;
            treeInventory.DataBind();
            if (!IsPostBack)
            {
                Session["InventorySelected"] = "FA31071D-6010-4788-83B9-9F0CE0C90C5F"; //Khoa mặc định
                string       defaultKey = Guid.Parse(Session["InventorySelected"].ToString()).ToString().Replace("-", string.Empty);
                TreeListNode node       = treeInventory.FindNodeByKeyValue(defaultKey);
                if (node != null)
                {
                    node.Focus();
                }
                ItemUnits = InventoryTransactionBO.getItemUnitsInInventory(session, Guid.Parse(Session["InventorySelected"].ToString()));
            }
            System.Diagnostics.Debug.WriteLine(String.Format("Pageload InventoryId: {0}", Session["InventorySelected"].ToString()));
            this.grdataproduct.DataSource = ItemUnits;
            this.grdataproduct.DataBind();

            grdBalanceOfItems.DataSource = COGSData;
            grdBalanceOfItems.DataBind();
        }