예제 #1
0
        public Node <Job> Startup(string projectName)
        {
            StreamReader srStory = rw.openTextToRead(rw.getPath(projectName + @"\StoryList"));

            string str;
            string str2;

            //make all stories children of the project
            while ((str = srStory.ReadLine()) != null)
            {
                Story tempStory = new Story(
                    rw.ReadSection(str, "Title"),
                    rw.ReadSection(str, "Developer"),
                    rw.ReadSection(str, "Description"),
                    Convert.ToUInt16(rw.ReadSection(str, "Sprint")));

                Node <Job>   tempChild = project.addChild(tempStory);
                StreamReader srTask    = rw.openTextToRead(rw.getPath(projectName + @"\" + rw.ReadSection(str, "Title") + @"\TaskList"));
                //make all Tasks children of the corresponding story
                while ((str2 = srTask.ReadLine()) != null)
                {
                    sTask temp2 = new sTask(
                        rw.ReadSection(str, "Title"),
                        rw.ReadSection(str, "Developer"),
                        rw.ReadSection(str, "Description"),
                        tempStory,
                        DateTime.Parse(rw.ReadSection(str, "DateTime")));

                    tempChild.addChild(temp2);
                }
            }

            return(project);
        }
예제 #2
0
        //Create Task
        public void writeJob(sTask task, string path)
        {
            StreamWriter sw = openTextToWrite(path);

            addSection(sw, "Title", task.getTitle());
            addSection(sw, "Developer", task.getDeveloper());
            addSection(sw, "Description", task.getDescription());
            sw.Close();
        }
예제 #3
0
        public async Task CreateTask([Remainder] string param)
        {
            string[] args = param.Split('~');
            sTask    task = new sTask();

            if (Context.User.IsBot)
            {
                await ReplyAsync("TESTING .CreateTask");
            }

            var eb = new EmbedBuilder();

            eb.WithColor(Color.Orange);
            eb.WithAuthor("ScrumBot");
            eb.WithFooter("Thank you!");

            if (args.Length < 5)
            {
                eb.WithTitle("CreateTask");
                eb.WithDescription("Creates a task within a given story, which has a particular due date.");
                eb.AddField(".CreateTask", "Command name");
                eb.AddField("<title>", "Title of the task");
                eb.AddField("<developer>", "Developer assigned to task");
                eb.AddField("<description>", "Description of the task");
                eb.AddField("<story>", "The story, of which, the task is a part.");
                eb.AddField("<dueDate>", "The date that this particular task is due.");

                await Context.Channel.SendMessageAsync("", false, eb.Build());
            }
            else
            {
                task.setTitle(args[0]);
                Console.WriteLine("Task title set");
                task.setDeveloper(args[1]);
                Console.WriteLine("Task dev set");
                task.SetDescription(args[2]);
                Console.WriteLine("Task desc set");
                task.setStory(args[3]);
                Console.WriteLine("Task story set");
                task.setDueDate(DateTime.Parse(args[4]));
                Console.WriteLine("Task due date set");

                eb.WithTitle("Task created successfully!");
                eb.WithDescription("Task: '" + args[0] + "' created and saved successfully.");
                eb.AddField("Title:", args[0]);
                eb.AddField("Developer:", args[1]);
                eb.AddField("Description:", args[2]);
                eb.AddField("Story:", args[3]);
                eb.AddField("Due Date:", args[4]);

                await Context.Channel.SendMessageAsync("", false, eb.Build());
            }
        }