public BugTracker FindBugById(int id)
 {
     foreach (BugTracker bug in this.BugTrackers)
         if (bug.id == id)
             return bug;
     BugTracker rtn = new BugTracker();
     rtn.id = -1;
     rtn.BugID = "Error";
     rtn.Reporter = "";
     rtn.Customer = "";
     rtn.BugResolution = "";
     rtn.Component = "";
     rtn.Priority = "";
     rtn.Description = "NA";
     rtn.Status = "";
     return rtn;
 }
 public bool Remove(BugTracker gone)
 {
     int count = 0;
     foreach (BugTracker bug in this.BugTrackers)
     {
         if (gone.id == bug.id)
         {
             this.BugTrackers.RemoveAt(count);
             break;
         }
         ++count;
     }
     if (count < BugTrackers.Count + 1)
     {
         this.Save(this.Path());
         return true;
     }
     return false;
 }
            public bool Edit(BugTracker bugvalue)
            {
                foreach (BugTracker bug in this.BugTrackers)
                {
                    if (bugvalue.id == bug.id)
                    {

                        bug.BugID = bugvalue.BugID;
                        bug.Reporter = bugvalue.Reporter;
                        bug.Customer = bugvalue.Customer;
                        bug.BugResolution = bugvalue.BugResolution;
                        bug.Component = bugvalue.Component;
                        bug.Priority = bugvalue.Priority;
                        bug.Description = bugvalue.Description;
                        bug.Status = bugvalue.Status;
                        this.Save(this.Path());
                        return true;
                    }
                }
                return false;
            }
 public bool Fill(string path)
 {
     try
     {
         XDocument doc = XDocument.Load(path);
         var q = from bugtrack in doc.Elements("bugtrackers").Elements("bugtracker") select bugtrack;
         foreach (var elem in q)
         {
             BugTracker bug = new BugTracker();
             bug.BugID = elem.Element("bugID").Value;
             int bugint = Convert.ToInt32(bug.BugID);
             bug.Reporter = elem.Element("reporter").Value;
             bug.Customer = elem.Element("customer").Value;
             bug.BugResolution = elem.Element("bugresolution").Value;
             bug.Component = elem.Element("component").Value;
             bug.Priority = elem.Element("priority").Value;
             bug.Description = elem.Element("description").Value;
             bug.Status = elem.Element("status").Value;
             BugTrackers.Add(bug);
         }
     }
     catch { return false; }
     return true;
 }
 public ActionResult Edit(BugTracker bugtracker)
 {
     BugTrackerModel btm = new BugTrackerModel();
     btm.Edit(bugtracker);
     return RedirectToAction("BugsList");
 }
 public ActionResult Delete(BugTracker bugtracker)
 {
     BugTrackerModel btm = new BugTrackerModel();
     btm.Remove(bugtracker);
     return RedirectToAction("BugsList");
 }
 public ActionResult Create(BugTracker bugtracker)
 {
     BugTrackerModel btm = new BugTrackerModel();
     btm.Add(bugtracker);
     return RedirectToAction("BugsList");
 }
 public void Add(BugTracker bug)
 {
     BugTrackers.Add(bug);
     Save(Path());
 }
 public void Add(BugTracker bug)
 {
     BugTrackers.Add(bug);
         Save(Path());
 }
 public bool Remove(BugTracker gone)
 {
     int count = 0;
         foreach (BugTracker bug in this.BugTrackers)
         {
             if (gone.id == bug.id)
             {
                 this.BugTrackers.RemoveAt(count);
                 break;
             }
             ++count;
         }
         if (count < BugTrackers.Count + 1)
         {
             this.Save(this.Path());
             return true;
         }
         return false;
 }
 public BugTracker FindBugById(int id)
 {
     foreach (BugTracker bug in this.BugTrackers)
             if (bug.id == id)
                 return bug;
         BugTracker rtn = new BugTracker();
         rtn.id = -1;
         rtn.BugID = "Error";
         rtn.Reporter = "";
         rtn.Customer = "";
         rtn.BugResolution = "";
         rtn.Component = "";
         rtn.Priority = "";
         rtn.Description = "NA";
         rtn.Status = "";
         return rtn;
 }
 public bool Fill(string path)
 {
     try
         {
             XDocument doc = XDocument.Load(path);
             var q = from bugtrack in doc.Elements("bugtrackers").Elements("bugtracker") select bugtrack;
             foreach (var elem in q)
             {
                 BugTracker bug = new BugTracker();
                 bug.BugID = elem.Element("bugID").Value;
                 int bugint = Convert.ToInt32(bug.BugID);
                 bug.Reporter = elem.Element("reporter").Value;
                 bug.Customer = elem.Element("customer").Value;
                 bug.BugResolution = elem.Element("bugresolution").Value;
                 bug.Component = elem.Element("component").Value;
                 bug.Priority = elem.Element("priority").Value;
                 bug.Description = elem.Element("description").Value;
                 bug.Status = elem.Element("status").Value;
                 BugTrackers.Add(bug);
             }
         }
         catch { return false; }
         return true;
 }
        public bool Edit(BugTracker bugvalue)
        {
            foreach (BugTracker bug in this.BugTrackers)
                {
                    if (bugvalue.id == bug.id)
                    {

                        bug.BugID = bugvalue.BugID;
                        bug.Reporter = bugvalue.Reporter;
                        bug.Customer = bugvalue.Customer;
                        bug.BugResolution = bugvalue.BugResolution;
                        bug.Component = bugvalue.Component;
                        bug.Priority = bugvalue.Priority;
                        bug.Description = bugvalue.Description;
                        bug.Status = bugvalue.Status;
                        this.Save(this.Path());
                        return true;
                    }
                }
                return false;
        }