public void Update(int id, WebLocation location, DeveloperTeam team, bool broken, string name)
 {
     this.Id = id;
     this.IsBroken = broken;
     this.Team = team;
     this.Location = location;
     this.Name = name;
 }
 public Feature(WebLocation location, DeveloperTeam team, bool broken, string name)
 {
     this.Id = ++IdNumber;
     this.IsBroken = broken;
     this.Team = team;
     this.Location = location;
     this.Name = name;
 }
        public static Dto.Feature PostFeature(string url, string website, string webpage, int id, List<Dto.Developer> devs, string teamName, bool isBroken, string featureName)
        {
            List<Dmn.Developer> dmnDevs = new List<Domain.Developer>();

            foreach (Dto.Developer dev in devs)
            {
                dmnDevs.Add(new Dmn.Developer(dev.Name, dev.PhoneNumber, dev.Email));
            }

            Dmn.WebLocation location = new Dmn.WebLocation(url, website, webpage);
            Dmn.DeveloperTeam team = new Dmn.DeveloperTeam(id, dmnDevs, teamName);
            Dmn.Feature feature = new Dmn.Feature(location, team, isBroken, featureName);
            Dmn.DummyDatabase.Features.Add(feature);
            return FeatureConverter.ToDto(feature);
        }
        public static bool PutFeature(int fid, string url, string website, string webpage, int did, List<Dto.Developer> devs, string teamName, bool isBroken, string featureName)
        {
            Dmn.Feature feature = Dmn.DummyDatabase.Features.FirstOrDefault(i => i.Id == fid);
            if (feature == null)
            {
                return false;
            }

            List<Dmn.Developer> dmnDevs = new List<Domain.Developer>();

            foreach (Dto.Developer dev in devs)
            {
                dmnDevs.Add(new Dmn.Developer(dev.Name, dev.PhoneNumber, dev.Email));
            }

            Dmn.WebLocation location = new Dmn.WebLocation(url, website, webpage);
            Dmn.DeveloperTeam team = new Dmn.DeveloperTeam(did, dmnDevs, teamName);
            feature.Update(fid, location, team, isBroken, featureName);
            return true;
        }
        public static Dto.Ticket PostTicket(
            Dmn.Priority prio,
            string devnotes,
            string name,
            string email,
            string phoneNumber,
            string message,
            string twitterHandle,
            string facebookName,
            string contactMethod,
            string url,
            string website,
            string webpage,
            List<Dto.Developer> devs,
            string teamName,
            int teamId, 
            bool isBroken, 
            string featureName)
        {
            List<Dmn.Developer> dmnDevs = new List<Domain.Developer>();

            foreach (Dto.Developer dev in devs)
            {
                dmnDevs.Add(new Dmn.Developer(dev.Name, dev.PhoneNumber, dev.Email));
            }
            Dmn.WebLocation location = new Dmn.WebLocation(url, website, webpage);
            Dmn.DeveloperTeam team = new Dmn.DeveloperTeam(teamId, dmnDevs, teamName);
            Dmn.TicketInformation info = new Dmn.TicketInformation(prio, devnotes);
            Dmn.Customer customer = new Dmn.Customer(name, email, phoneNumber, message, twitterHandle, facebookName, contactMethod);
            Dmn.Feature feature = new Dmn.Feature(location, team, isBroken, featureName);

            Dmn.Ticket ticket = new Dmn.Ticket(info, customer, feature);
            Dmn.DummyDatabase.Tickets.Add(ticket);
            return TicketConverter.ToDto(ticket);
        }
        public static bool PutTicket(
            int tid,
            Dmn.Priority prio,
            string devnotes,
            string name,
            string email,
            string phoneNumber,
            string message,
            string twitterHandle,
            string facebookName,
            string contactMethod,
            string url,
            string website,
            string webpage,
            List<Dto.Developer> devs,
            string teamName,
            int teamId,
            bool isBroken,
            string featureName)
        {
            Dmn.Ticket ticket = Dmn.DummyDatabase.Tickets.FirstOrDefault(i => i.TicketInfo.Id == tid);
            if (ticket == null)
            {
                return false;
            }

            List<Dmn.Developer> dmnDevs = new List<Domain.Developer>();

            foreach (Dto.Developer dev in devs)
            {
                dmnDevs.Add(new Dmn.Developer(dev.Name, dev.PhoneNumber, dev.Email));
            }

            Dmn.WebLocation location = new Dmn.WebLocation(url, website, webpage);
            Dmn.DeveloperTeam team = new Dmn.DeveloperTeam(teamId, dmnDevs, teamName);
            Dmn.TicketInformation info = new Dmn.TicketInformation(tid, prio, devnotes);
            Dmn.Customer customer = new Dmn.Customer(name, email, phoneNumber, message, twitterHandle, facebookName, contactMethod);
            Dmn.Feature feature = new Dmn.Feature(location, team, isBroken, featureName);

            ticket.Update(info, customer, feature);
            return true;
        }
 public static Dto.WebLocation PostWebLocation(string url, string website, string webpage)
 {
     Dmn.WebLocation location = new Dmn.WebLocation(url, website, webpage);
     Dmn.DummyDatabase.WebLocations.Add(location);
     return WebLocationConverter.ToDto(location);
 }