Esempio n. 1
0
        /// <summary>
        /// Create a new BusinessObjective object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        public static BusinessObjective CreateBusinessObjective(global::System.Int32 id)
        {
            BusinessObjective businessObjective = new BusinessObjective();

            businessObjective.Id = id;
            return(businessObjective);
        }
Esempio n. 2
0
        private void objective_Click(object sender, EventArgs e)
        {
            BusinessObjective obj = (BusinessObjective)sender;

            Console.WriteLine(obj.Name);
            lastClicked = obj;
            owner.LastClickedCategory = obj.Owner;
        }
Esempio n. 3
0
        //public this Category

        public BusinessObjective AddObjective(string name)
        {
            BusinessObjective objective = new BusinessObjective(this, name);

            objectivesCount++;
            objectives.Add(objective);
            objective.Click += new EventHandler(objective_Click);
            return(objective);
        }
Esempio n. 4
0
        public Initiative(BusinessObjective owner,string name)
        {
            this.owner = owner;
            this.name = name;
            this.Text = name;
            owner.Controls.Add(this);
            this.Location = FindLocation();
            this.BackColor = Color.SeaGreen;
            this.Width = owner.Width;
            this.Height = 20;

            owner.UpdateHeight();
               // owner.UpdateLocation();
        }
Esempio n. 5
0
        public Initiative(BusinessObjective owner, string name)
        {
            this.owner = owner;
            this.name  = name;
            this.Text  = name;
            owner.Controls.Add(this);
            this.Location  = FindLocation();
            this.BackColor = Color.SeaGreen;
            this.Width     = owner.Width;
            this.Height    = 20;

            owner.UpdateHeight();
            // owner.UpdateLocation();
        }
Esempio n. 6
0
        //public this Category
        public void AddObjective(string name)
        {
            BusinessObjective objective = new BusinessObjective(this, name);

            objectivesCount++;

            objective.BackColor = Color.Wheat;
            objective.Text = name;
               // objective.Name = name;
            objective.Width = 70;
            objective.Height = 50;
            this.Controls.Add(objective);
            objective.Location = new Point(0, 0);
            objectives.Add(objective);
            objective.Click +=new EventHandler(objective_Click);
        }
Esempio n. 7
0
        //public this Category

        public void AddObjective(string name)
        {
            BusinessObjective objective = new BusinessObjective(this, name);

            objectivesCount++;


            objective.BackColor = Color.Wheat;
            objective.Text      = name;
            // objective.Name = name;
            objective.Width  = 70;
            objective.Height = 50;
            this.Controls.Add(objective);
            objective.Location = new Point(0, 0);
            objectives.Add(objective);
            objective.Click += new EventHandler(objective_Click);
        }
Esempio n. 8
0
        private void initiativeAddButton_Click(object sender, EventArgs e)
        {
            string     catName;
            string     busName;
            string     iniName = initiativeNames.Text.Trim();
            INITIATIVE initiative;

            if (!db.GetInitiative(iniName, out initiative))
            {
                initiative      = new INITIATIVE();
                initiative.NAME = iniName;
                BUSINESSOBJECTIVE objective;
                busName = objectiveNames.Text.Trim();
                if (!db.GetObjective(busName, out objective))
                {
                    objective      = new BUSINESSOBJECTIVE();
                    objective.NAME = objectiveNames.Text.Trim();
                    CATEGORY category;
                    catName = categoryNames.Text.Trim();
                    if (!db.GetCategory(catName, out category))
                    {
                        category      = new CATEGORY();
                        category.NAME = catName;
                        if (!db.AddCategory(category))
                        {
                            MessageBox.Show("Failed to add Category to Database", "Error");
                            return;
                        }
                    }

                    objective.CATEGORY = category;
                    if (!db.AddObjective(objective))
                    {
                        MessageBox.Show("Failed to add Objective to Database", "Error");
                        return;
                    }
                }

                initiative.BUSINESSOBJECTIVE = objective;
                if (!db.AddInitiative(initiative))
                {
                    MessageBox.Show("Failed to add Initiative to Database", "Error");
                    return;
                }
            }

            BOM bom = new BOM();

            bom.INITIATIVE = initiative;
            if (!db.AddBOM(bom, client))
            {
                MessageBox.Show("Failed to add Initiative to BOM", "Error");
                return;
            }
            if (!db.SaveChanges())
            {
                MessageBox.Show("Failed to save changes to database", "Error");
                return;
            }

            else
            {
                //Successfully added to database, update GUI
                catName = bom.INITIATIVE.BUSINESSOBJECTIVE.CATEGORY.NAME.TrimEnd();
                Category category = categories.Find(delegate(Category cat)
                {
                    return(cat.Name == catName);
                });
                if (category == null)
                {
                    category = new Category(this, catName);
                    categories.Add(category);
                    categoryCount++;
                    category.Click += new EventHandler(category_Click);
                }

                busName = bom.INITIATIVE.BUSINESSOBJECTIVE.NAME.TrimEnd();
                BusinessObjective objective = category.Objectives.Find(delegate(BusinessObjective bus)
                {
                    return(bus.Name == busName);
                });
                if (objective == null)
                {
                    objective = category.AddObjective(busName);
                }

                iniName = bom.INITIATIVE.NAME.TrimEnd();
                Initiative initiativeObj = objective.Initiatives.Find(delegate(Initiative ini)
                {
                    return(ini.Name == iniName);
                });
                if (initiativeObj == null)
                {
                    initiativeObj = objective.AddInitiative(iniName);
                }
                else
                {
                    MessageBox.Show("Initiative already exists in BOM", "Error");
                }
            }
        }
Esempio n. 9
0
 private void objective_Click(object sender, EventArgs e)
 {
     BusinessObjective obj = (BusinessObjective)sender;
     Console.WriteLine(obj.Name);
     lastClicked = obj;
     owner.LastClickedCategory = obj.Owner;
 }
Esempio n. 10
0
 //public this Category
 public BusinessObjective AddObjective(string name)
 {
     BusinessObjective objective = new BusinessObjective(this, name);
     objectivesCount++;
     objectives.Add(objective);
     objective.Click +=new EventHandler(objective_Click);
     return objective;
 }
Esempio n. 11
0
 /// <summary>
 /// Create a new BusinessObjective object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static BusinessObjective CreateBusinessObjective(global::System.Int32 id)
 {
     BusinessObjective businessObjective = new BusinessObjective();
     businessObjective.Id = id;
     return businessObjective;
 }
Esempio n. 12
0
 /// <summary>
 /// Deprecated Method for adding a new object to the BusinessObjective EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBusinessObjective(BusinessObjective businessObjective)
 {
     base.AddObject("BusinessObjective", businessObjective);
 }
Esempio n. 13
0
 /// <summary>
 /// Deprecated Method for adding a new object to the BusinessObjective EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBusinessObjective(BusinessObjective businessObjective)
 {
     base.AddObject("BusinessObjective", businessObjective);
 }
Esempio n. 14
0
 public Initiative(BusinessObjective owner, string name)
 {
     this.owner = owner;
     this.name  = name;
 }
Esempio n. 15
0
 public Initiative(BusinessObjective owner,string name)
 {
     this.owner = owner;
     this.name = name;
 }