Пример #1
0
        public Project()
        {
            myId        = -1;
            deadline    = DateTime.Today;
            description = "I don't know how this got here.";
            //Generate the task trees for the project.
            Random          rand      = new Random();
            int             taskLimit = rand.Next(5, 20);
            WordListManager words     = new WordListManager();

            for (int i = 0; i < taskLimit; i++)
            {
                this.tasks.Add(new TaskTree(words, DateTime.Today, words.getRandomWords(rand.Next(250, 500)), this.getPK()));
            }
        }
Пример #2
0
        //A project minimally requires a deadline and a description.
        public Project(DateTime deadline, string description)
        {
            myId             = id++;
            this.deadline    = deadline;
            this.description = description;
            //Generate the task trees for the project.
            this.tasks = new List <TaskTree>();
            Random          rand      = new Random();
            int             taskLimit = rand.Next(5, 20);
            WordListManager words     = new WordListManager();

            for (int i = 0; i < taskLimit; i++)
            {
                this.tasks.Add(new TaskTree(words, DateTime.Today, words.getRandomWords(rand.Next(250, 500)), this.getPK()));
            }
        }
Пример #3
0
        //Time to make a new Task Tree!
        public TaskTree(WordListManager words, DateTime deadline, string description, string projectPK)
        {
            this.projectPK = projectPK;
            this.words     = words;
            this.task      = new Task(description, deadline);
            subTasks       = new List <TaskTree>();
            //Decide if this is the end of the tree.
            int  decider      = rand.Next(100);
            bool needSubTasks = decider % 10 == 3 || decider % 5 == 2;

            if (needSubTasks)
            {
                //If it's not for whatever reason, time to add 1 to 3 more children.
                int howMany = rand.Next(1, 5);
                for (int i = 0; i < howMany; i++)
                {
                    //Every child is another tree.
                    this.subTasks.Add(new TaskTree(this.words, deadline.AddDays(rand.Next(7, 365)), words.getRandomWords(rand.Next(250, 500)), this.projectPK));
                }
            }
        }
Пример #4
0
 public SQLInterface()
 {
     //Establish connection path to the database.
     conn       = new MySqlConnection(connStr);
     this.words = new WordListManager();
 }
Пример #5
0
 public CreatesGenerator(WordListManager words)
 {
     this.words = words;
     this.rand  = new Random();
 }
Пример #6
0
 public CreatesGenerator()
 {
     this.words = new WordListManager();
     this.rand  = new Random();
 }
Пример #7
0
 //If we do get a WordListManager, then we can use that instead.
 public ProjectGenerator(WordListManager words)
 {
     this.words = words;
 }
Пример #8
0
 //If we don't get a WordListManager, we need to make one.
 public ProjectGenerator()
 {
     words = new WordListManager();
 }
Пример #9
0
 //If we get a WordListManager, we can use it instead.
 public OrganizationGenerator(WordListManager words)
 {
     this.words = words;
 }
Пример #10
0
 //If we don't get a WordListManager, we need to make one.
 public OrganizationGenerator()
 {
     this.words = new WordListManager();
 }
Пример #11
0
 //If we do get a WordListManager instance, we're happy to save the resources.
 public AccountGenerator(WordListManager words)
 {
     this.words = words;
 }
Пример #12
0
 //If we don't get a WordListManager instance, we need to make one.
 public AccountGenerator()
 {
     words = new WordListManager();
 }