Example #1
0
        public Models.Issue ParseReadLine(string line)
        {
            var data = line.Split(',');

            Models.Issue newIssue = new Models.Issue();

            newIssue.IssueType          = data[0];
            newIssue.Key                = data[1];
            newIssue.Sumary             = data[2];
            newIssue.Assignee           = data[3];
            newIssue.Owner              = data[4];
            newIssue.Priority           = data[5];
            newIssue.Status             = data[6];
            newIssue.Created            = data[7];
            newIssue.Updated            = data[8];
            newIssue.Remaining_Estimate = data[9];
            newIssue.TimeSpent          = data[10];
            newIssue.OriginalEstimate   = data[11];
            newIssue.WorkRatio          = data[12];
            newIssue.FixVersion         = data[13];
            newIssue.Developer          = data[14];
            newIssue.EpicName           = data[15];
            newIssue.EpicLink           = data[16];

            return(newIssue);
        }
Example #2
0
        public ActionResult Create(Models.Issue issue) //Project Id
        {
            issue.CreateDate = DateTime.Now;
            issue.Status     = 1; //Default, Waiting
            db.Issues.Add(issue);
            db.SaveChanges();

            return(RedirectToAction("View", "Project", new { id = issue.ProjectId }));
        }
Example #3
0
        public async Task <ActionResult> Edit(int id, [FromForm] Models.Issue issue)
        {
            try
            {
                await repository.SaveIssue(issue);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
Example #4
0
 public Issue GetIssueById(int id)
 {
     Models.Issue tmp = new Models.Issue();
     tmp.IssueID      = 1;
     tmp.Tracker      = "Tracker";
     tmp.Project      = new Models.Project();
     tmp.ProjectID    = 1;
     tmp.Project.Name = "ProjectName";
     tmp.Subject      = "Subject";
     tmp.Description  = "Description";
     tmp.Priority     = "Priority";
     tmp.Updated      = DateTime.Now;
     return(tmp);
 }
Example #5
0
        public ActionResult Edit(Models.Issue issue)
        {
            if (ModelState.IsValid)
            {
                issue.UpdateDate = DateTime.Now;
                if (issue.Status == 3 || issue.Status == 4) //Close yada Resolve
                {
                    issue.CloseDate = DateTime.Now;
                }
                db.Entry(issue).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("View", "Project", new { id = issue.ProjectId }));
            }

            return(RedirectToAction("Edit", new { id = issue.Id }));
        }
Example #6
0
        public async Task <ActionResult> Create([FromForm] Models.Issue issue)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }
            try
            {
                await repository.SaveIssue(issue);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                ModelState.AddModelError("", "Error while saving");
                return(View());
            }
        }
Example #7
0
        public ObservableCollection <Issue> GetIssues()
        {
            ObservableCollection <Models.Issue> list = new ObservableCollection <Models.Issue>();

            Models.Issue tmp = new Models.Issue();
            tmp.IssueID      = 1;
            tmp.Tracker      = "Tracker";
            tmp.Project      = new Models.Project();
            tmp.ProjectID    = 1;
            tmp.Project.Name = "ProjectName";
            tmp.Subject      = "Subject";
            tmp.Description  = "Description";
            tmp.Priority     = "Priority";
            tmp.Updated      = DateTime.Now;

            list.Add(tmp);

            return(list);
        }
Example #8
0
        public static MyIssues.Models.Issue Map(this Octokit.Issue issue)
        {
            var i = new Models.Issue
            {
                Assignee         = issue.Assignee?.Login,
                Author           = issue.User.Login,
                Body             = issue.Body,
                ClosedAt         = issue.ClosedAt,
                CreatedAt        = issue.CreatedAt,
                HtmlUrl          = issue.HtmlUrl,
                Id               = issue.Id,
                IsOpen           = issue.State == Octokit.ItemState.Open,
                Locked           = issue.Locked,
                Number           = issue.Number,
                Milestone        = issue.Milestone?.Title,
                MilestoneDueDate = issue.Milestone?.DueOn,
                Title            = issue.Title,
                Labels           = issue.Labels.Select(m => m.Map()).ToList()
            };

            i.FillReactions(issue.Reactions);
            return(i);
        }
Example #9
0
        public async Task <List <Models.Issue> > GetIssues()
        {
            IssueContainer container = await networkService.GetIssuesAsync();

            List <Models.Issue> list = new List <Models.Issue>();

            for (int i = 0; i < container.total_count; i++)
            {
                Models.Issue tmp = new Models.Issue();
                tmp.IssueID      = container.issues[i].id;
                tmp.Tracker      = container.issues[i].tracker.name;
                tmp.Project      = new Models.Project();
                tmp.ProjectID    = container.issues[i].project.id;
                tmp.Project.Name = container.issues[i].project.name; //removable
                tmp.Subject      = container.issues[i].subject;
                tmp.Description  = container.issues[i].description;
                tmp.Priority     = container.issues[i].priority.name;
                tmp.Updated      = container.issues[i].updated_on;

                list.Add(tmp);
            }

            return(list);
        }
 public Models.Issue updateIssue(Models.Issue issueToUpdate)
 {
     //operations
     return(issueToUpdate);
 }
Example #11
0
 public void Bind(Models.Issue item, IssueSelected listener)
 {
     _boundItem  = item;
     _boundEvent = listener;
 }