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 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;
        }
        /// <summary>
        /// Handles the Click event of the OkButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void OkButton_Click(object sender, EventArgs e)
        {
            string featureName = this.Form.NameTextBox.Text;
            string featureDescription = this.Form.DescriptionRichTextBox.Text;

            if (string.IsNullOrEmpty(featureName) || string.IsNullOrEmpty(featureDescription))
            {
                MessageBox.Show(
                    "Podane wartości nie są prawidłowe lub pozostawiono niewypełnione pola.",
                    "Błąd",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation,
                    MessageBoxDefaultButton.Button1);

                return;
            }

            if (this.IsEditForm)
            {
                var feature = DataAccess.Instance.Features.Single(f => f.Id == this.ItemToEditID);
                feature.Name = featureName;
                feature.Description = featureDescription;
            }
            else
            {
                var feature = new Feature
                {
                    Name = featureName,
                    Description = featureDescription
                };

                DataAccess.Instance.Features.Add(feature);
            }

            DataAccess.Instance.UnitOfWork.Commit();

            this.Form.Dispose();
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Features EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToFeatures(Feature feature)
 {
     base.AddObject("Features", feature);
 }
 /// <summary>
 /// Create a new Feature object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static Feature CreateFeature(global::System.Int32 id, global::System.String name)
 {
     Feature feature = new Feature();
     feature.Id = id;
     feature.Name = name;
     return feature;
 }
Example #7
0
 private static Point3D CalculatePoint(Feature feature, int i, int count)
 {
     return(feature.Center + feature.Direction * (feature.Size * i / count));
 }
 public Ticket(TicketInformation ticketInfo, Customer contactInfo, Feature feature)
 {
     this.TicketInfo = ticketInfo;
     this.FeatureToFix = feature;
     this.ContactInfo = contactInfo;
 }