Click here to Skip to main content
15,898,010 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
C#
public Hashtable TopologischeSorte(Hashtable arbeitPacket)
        {
            List<Task> sortierte = new List<Task>();

            int ohne = 0;
            foreach (Object key in keys)
            {
                Task task = (Task)ArbeitPacketReverse[key];

                if (task.Vorgang.Count == 0)
                {
                    sortierte.Insert(0, task);
                    ohne++;
                }
                else
                {
                    int i = 0;
                    int count = task.Vorgang.Count;
                    while (count > 0 && i < sortierte.Count)
                    {
                        if (task.Vorgang.Contains(sortierte[i]))
                        {
                            count--;
                        }
                        i++;
                    }
                    if (count != 0)
                        sortierte.Insert(ohne, task);
                    else
                        sortierte.Insert(i, task);

                }
            }
            textBox1.Text += "************************";


            Hashtable reverse = new Hashtable();
            
foreach (Task t in sortierte.Reverse<Task>())
            {

                if (reverse.Count == 0)
                {
                    t.SE = t.FE;
                    t.SA = t.SE - t.Dauer;
                    textBox1.Text += "REVERSE: ..." + t + "- ";
                    reverse.Add(t.Name, t);

                }
                else
                {
                    t.computeTermin2();
                    textBox1.Text += "REVERSE: ..." + t + "- ";
                    reverse.Add(t.Name, t); 


                //}
            }
            return reverse;


        }
Posted
Updated 27-May-12 5:47am
v5
Comments
RDBurmon 25-May-12 8:13am    
Hello Member 88********** ,
This is great to add all information while posting your question but this should be adequate to understand and short enough to read your question. As you see your question contain bulky code and some hard to read table structure.I am sure whenever someone would see your question He first read first line and then gently and hardly scroll down the mouse to see length of your question. some one would think "Ohh sh*t man , how can I analyze this!" or some one would say "Its very hard to read one cs code and this question has two." . My suggestion to you is try to explain your question in short words something like "Hey all , I want to write query which will give me this output. Could some one help me ? and I have tried this but not meeting with my expectation . " Or just say "I have this data and structure and I need this output.Also Here is the business logic / formula to generate the output . Please suggest with some code."

Agreed ?
Nelek 25-May-12 16:17pm    
Good advice :)
El_Codero 25-May-12 16:39pm    
Agree, too much code for a question. By the way, why you're signed in as a member from USA and using German concepts in code? Is this yours?Very funny...;)
Sergey Alexandrovich Kryukov 27-May-12 22:26pm    
The default is USA, which is wrong thing and many members leave it like this. This is wrong. I suggested in Bugs & Suggestions that the default should be something like "unspecified country"; but registration with such selection may or may not be allowed.
--SA
RDBurmon 28-May-12 2:54am    
Agreed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900