• 排序


      案件登记-000001→受理初审-000002→受理审查-000003→受理审核-000004→受理审定-000005→受理意见书-000006→批办拟单-000008→拟办审核-000009→审办-000010→批办-000011→批办意见书-000012→案件报结-000015→下级报审-000016→完结案件-000017  
        /// <summary>
        /// 排序
        /// </summary>
        /// <param name="flow"></param>
        /// <returns></returns>
        private string LetterNodeSort(string flow)
        {
            string[] ArrayFlow = flow.Split('→');
            string[] LetterNodes = ArrayFlow;
            string[] LetterNode2 =new string[ArrayFlow.Length-1];
            string[] NewNodes = new string[ArrayFlow.Length];
            string[] Nodes = new string[2];        
            string TempFlow = string.Empty;        
            int nowNode = 0;
            int tempNode = 0;
            int nextNode = 0;
            int p = 0;

            for (int i = 0; i < ArrayFlow.Length ; i++)
            {
                p = 0;
                for (int j = 0; j < LetterNodes.Length - 1; j++)
                {  
                    nextNode = getNodeCode(LetterNodes, j+1);               
                    tempNode = getNodeCode(LetterNodes, p);
                    if ( nextNode < tempNode)
                    {
                        p = j+1;
                    }
                }

                LetterNode2 = new string[LetterNodes.Length - 1];
                int m = 0;
                for (int j = 0; j < LetterNodes.Length; j++)
                {
                    if (j != p)
                    {
                        LetterNode2[m] = LetterNodes[j];
                        m = m + 1;
                    }
                }          

                NewNodes[i] = LetterNodes[p];
                LetterNodes = LetterNode2;
            }


            string Msg = string.Empty;
            for (int i = 0; i < NewNodes.Length ; i++)
            {
                Msg += NewNodes[i] + "→";
            }
            return Msg.Substring(0, Msg.Length - 1);
        }

       private int getNodeCode(string[] ArrayFlow,int i)
        {
            string[] Nodes = new string[2];
            Nodes = ArrayFlow[i].Split('-');
            return  getInt(Nodes[1]);
        }

        private int getInt(string Value)
        {
            return Convert.ToInt32(Value);
        }

  • 相关阅读:
    Visual Studio 2010使用Visual Assist X的方法
    SQL Server 2000 评估版 升级到 SQL Server 2000 零售版
    双网卡多网络单主机同时访问
    开发即过程!立此纪念一个IT新名词的诞生
    delphi dxBarManager1 目录遍历 转为RzCheckTree2树
    5320 软件集合
    delphi tree 从一个表复制到另一个表
    DELPHI 排课系统课表
    长沙金思维 出现在GOOGLE的 金思维 相关搜索里啦!!
    如何在DBGrid的每一行前加一个单选框?
  • 原文地址:https://www.cnblogs.com/meiproject/p/994810.html
Copyright © 2020-2023  润新知