Beispiel #1
0
        /// <summary>
        /// Adds component types to a component group.
        /// </summary>
        /// <param name="parentGroup"></param>
        public void addTypeControlsToGroupControl(ARA_ListGroup parentGroup)
        {
            if (parentGroup.ARA_ListGroupDropDownButton.ConnectedPanel.Controls.Count != 0)
            {
                return;
            }
            foreach (DataRow datarow in this.get_TypeNames_In_GroupTableAdapter.GetData(parentGroup.DropDownButtonText).Rows)
            {
                ARA_ListGroup listType = new ARA_ListGroup();
                styleListGroupAsType(parentGroup, listType);
                listType.DropDownButtonText = datarow["TypeName"].ToString();

                //Add functions.
                listType.addFunction(delegate()
                {
                    DataRow risksInTypeDataRow = this.get_Risks_In_Project_TypeTableAdapter.GetData(this.projectID, parentGroup.DropDownButtonText, datarow["TypeName"].ToString()).Rows[0];
                    listType.LabelText         = risksInTypeDataRow["RisksInProjectGroup"] + "/" + risksInTypeDataRow["RisksInGroup"];
                });
                listType.updateControl();
                listType.addFunction(delegate() { this.addRiskControlsToTypeControl(parentGroup, listType); });

                //Add click handler for mass insert/delete risks in project on doubleclick.
                listType.DoubleClick += delegate(object o, EventArgs e)
                {
                    DataRow risksInTypeDataRow = this.get_Risks_In_Project_TypeTableAdapter.GetData(this.projectID, parentGroup.DropDownButtonText, datarow["TypeName"].ToString()).Rows[0];
                    //Execute procedure to add or remove risks from a specific type in the project.
                    this.queriesTableAdapter1.Insert_Risks_From_Type_Into_Project
                    (
                        this.projectID,
                        parentGroup.DropDownButtonText,
                        datarow["TypeName"].ToString(),
                        risksInTypeDataRow["RisksInProjectGroup"].ToString() != risksInTypeDataRow["RisksInGroup"].ToString()
                    );

                    //Let the application know we added a risk.
                    ARA_Events.triggerRiskAddedToProjectEvent(this.projectID);
                };
            }
        }
Beispiel #2
0
        private void onRiskProjectOverviewLoad()
        {
            //Set scaling.
            this.Font = new System.Drawing.Font(ARA_Globals.ARA_Font, ARA_Globals.ARA_BaseFontSize);

            foreach (DataRow datarow in this.tbl_Component_GroupTableAdapter.GetData().Rows)
            {
                ARA_ListGroup listGroup = new ARA_ListGroup();
                styleListGroupAsGroup(listGroup);
                //Set button text.
                listGroup.DropDownButtonText = datarow["GroupName"].ToString();
                //Add functions.
                listGroup.addFunction(delegate()
                {
                    DataRow risksInGroupDataRow = this.get_Risks_In_Project_GroupTableAdapter.GetData(this.projectID, datarow["GroupName"].ToString()).Rows[0];
                    listGroup.LabelText         = risksInGroupDataRow["RisksInProjectGroup"] + "/" + risksInGroupDataRow["RisksInGroup"];
                });
                listGroup.updateControl();
                listGroup.addFunction(delegate() { this.addTypeControlsToGroupControl(listGroup); });

                //Add listGroup to addRiskToProjectPanel.
                this.addRiskToProjectPanelContent.Controls.Add(listGroup);
            }
        }