Example #1
0
        public NewCategory AddCategory(string name)
        {
            catWorkspace.TabPages.Add(name, name);
            catWorkspace.SelectedIndex = catWorkspace.TabCount - 1;
            NewCategory category = new NewCategory(this, catWorkspace.TabPages.Count - 1, name);
            categories.Add(category);

            //catWorkspace.TabPages[name].Controls.Add(category.);
            //catWorkspace.TabPages[name].BackColor = Color.DimGray; ;

            return category;
        }
Example #2
0
        public NewCategory AddCategory(string name)
        {
            catWorkspace.TabPages.Add(name, name);
            catWorkspace.SelectedIndex = catWorkspace.TabCount - 1;
            NewCategory category = new NewCategory(this, catWorkspace.TabPages.Count - 1, name);

            categories.Add(category);

            //catWorkspace.TabPages[name].Controls.Add(category.);
            //catWorkspace.TabPages[name].BackColor = Color.DimGray; ;

            return(category);
        }
Example #3
0
 public NewObjective(NewCategory owner, string name)
 {
     this.owner    = owner;
     this.Location = FindLocation();
     this.name     = name;
     owner.Owner.Controls.Add(this);
     MakeLabel();
     this.Click      += new EventHandler(NewObjective_Click);
     this.BackColor   = Color.LightBlue;
     this.Height      = baseHeight;
     this.Width       = baseWidth;
     this.BorderStyle = BorderStyle.FixedSingle;
     //this.Paint +=new PaintEventHandler(NewObjective_Paint);
 }
Example #4
0
 public NewObjective(NewCategory owner, string name)
 {
     this.owner = owner;
     this.Location = FindLocation();
     this.name = name;
     owner.Owner.Controls.Add(this);
     MakeLabel();
     this.Click += new EventHandler(NewObjective_Click);
     this.BackColor = Color.LightBlue;
     this.Height = baseHeight;
     this.Width = baseWidth;
     this.BorderStyle = BorderStyle.FixedSingle;
     //this.Paint +=new PaintEventHandler(NewObjective_Paint);
 }
Example #5
0
        public void RemoveObjective(NewObjective obj)
        {
            foreach (NewImperative imp in obj.Imperatives)
            {
                ClientDataControl.db.RemoveBOM(imp.Name, ClientDataControl.Client.EntityObject);
            }
            obj.Controls.Clear();
            Controls.RemoveByKey(obj.ObjName);
            NewCategory cat = obj.owner;

            cat.objectives.Remove(obj);
            if (cat.Objectives.Count == 0)
            {
                Controls.Remove(cat);
                categories.Remove(cat);
                catWorkspace.TabPages.RemoveByKey(cat.name);
            }
            obj.Visible = false;
            ClientDataControl.db.SaveChanges();
        }
Example #6
0
        public void RemoveImperative(NewImperative imp)
        {
            Controls.RemoveByKey(imp.Name);
            NewObjective obj = imp.owner;

            obj.Imperatives.Remove(imp);
            if (obj.Imperatives.Count == 0)
            {
                Controls.RemoveByKey(obj.ObjName);
                NewCategory cat = obj.owner;
                if (cat.Objectives.Count == 0)
                {
                    Controls.Remove(cat);
                    categories.Remove(cat);
                    catWorkspace.TabPages.RemoveByKey(cat.name);
                }
                obj.Visible = false;
            }

            ClientDataControl.db.RemoveBOM(imp.Name, ClientDataControl.Client.EntityObject);
            ClientDataControl.db.SaveChanges();
            Refresh();
        }
Example #7
0
 public static bool AddCategory(NewCategory cat)
 {
     bomCategories.Add(cat);
     return(true);
 }
Example #8
0
 public static bool AddCategory(NewCategory cat)
 {
     bomCategories.Add(cat);
     return true;
 }