private void comboBox_SelecProject_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox_SelecProject.Text != "Select an project") { var idProject = Models.Search_Model(comboBox_SelecProject.Text); Model_information.Id = idProject.id; businessRules.Clear(); businessRules = new List <string> { "Select an business rule" }; var businessRules_name = Business_Rules.GetAll(Model_information.Id); foreach (var item in businessRules_name) { businessRules.Add(item.rules_name); } comboBox_SelectBusinessRule.DataSource = businessRules; } else { businessRules.Clear(); businessRules = new List <string> { "Select an business rule" }; comboBox_SelectBusinessRule.DataSource = businessRules; } }
private void Btn_Save_Rule_Click(object sender, EventArgs e) { var business_rule = Business_Rules.Create_Rule(Txt_RuleName.Text, Model_information.Id); if (business_rule.Equals(true)) { if (Txt_RuleName.Text != null) { var idRuleName = Business_Rules.Search_Rule(Txt_RuleName.Text); Business_Rules.Create_Rule_Information(Txt_Statement.Text, Txt_Constraint.Text, Txt_Field_Names.Text, Txt_Table_Names.Text, Txt_Action_Taken.Text, idRuleName.Id); Business_Rules.Create_logical_elements(checkBox_Key_Type.Checked, checkBox_Key_Structure.Checked, checkBox_Uniqueness.Checked, checkBox_NullSupport.Checked, checkBox_Values_Entered_By.Checked, checkBox_Required_Value.Checked, checkBox_Default_Value.Checked, checkBox_Ranges_Values.Checked, checkBox_Comparisons_Allowed.Checked, checkBox_Operations_Allowed.Checked, checkBox_Edit_Rule.Checked, idRuleName.Id); Business_Rules.Create_relationship_characteristics_affected(checkBox_Deletion_Rule.Checked, checkBox_Type_Participation.Checked, checkBox_Degree_Participation.Checked, idRuleName.Id); Business_Rules.Create_physical_elements(checkBox_Data_Type.Checked, checkBox_Length.Checked, checkBox_Decimal_Places.Checked, checkBox_Character_Support.Checked, checkBox_Input_Mask.Checked, checkBox_Display_Format.Checked, idRuleName.Id); Business_Rules.Create_type(checkBox_Database_Oriented.Checked, checkBox_Application_Oriented.Checked, idRuleName.Id); var idType = Business_Rules.Search_Type(idRuleName.Id); Business_Rules.Create_categories(checkBox_Field_Specific.Checked, checkBox_Relationship_Specific.Checked, idType.Id); Business_Rules.Create_test_on(checkBox_Insert.Checked, checkBox_Update.Checked, checkBox_Delete.Checked, idType.Id); MessageBox.Show("The business rule was created."); Form_profil form_Profil = new Form_profil(); this.Hide(); form_Profil.Show(); } else { MessageBox.Show("The business rule was not created without the name of the rule."); } } else { MessageBox.Show("The business rule was not created."); } }
private void Update_Rule() { Business_Rules.Update_RulesName(Rule_information.Id, Txt_RuleName.Text); var textBox = Business_Rules.Search_Rule_Information_Text_Boxs(Rule_information.Id); Business_Rules.Update_Rule_Information_Text_Boxs(textBox.Id, Txt_Statement.Text, Txt_Constraint.Text, Txt_Field_Names.Text, Txt_Table_Names.Text, Txt_Action_Taken.Text); var logical_elements = Business_Rules.Search_Logical_Elements(Rule_information.Id); Business_Rules.Update_Logical_Elements(checkBox_Key_Type.Checked, checkBox_Key_Structure.Checked, checkBox_Uniqueness.Checked, checkBox_NullSupport.Checked, checkBox_Values_Entered_By.Checked, checkBox_Required_Value.Checked, checkBox_Default_Value.Checked, checkBox_Ranges_Values.Checked, checkBox_Comparisons_Allowed.Checked, checkBox_Operations_Allowed.Checked, checkBox_Edit_Rule.Checked, logical_elements.Id); var physical_elements = Business_Rules.Search_Physical_Elements(Rule_information.Id); Business_Rules.Update_Physical_Elements(checkBox_Data_Type.Checked, checkBox_Length.Checked, checkBox_Decimal_Places.Checked, checkBox_Character_Support.Checked, checkBox_Input_Mask.Checked, checkBox_Display_Format.Checked, physical_elements.Id); var relationship_characteristics_affected = Business_Rules.Search_Relationship_Characteristics_Affected(Rule_information.Id); Business_Rules.Update_Relationship_Characteristics_Affected(checkBox_Deletion_Rule.Checked, checkBox_Type_Participation.Checked, checkBox_Degree_Participation.Checked, relationship_characteristics_affected.Id); var type = Business_Rules.Search_Type(Rule_information.Id); Business_Rules.Update_Type(checkBox_Database_Oriented.Checked, checkBox_Application_Oriented.Checked, type.Id); var categories = Business_Rules.Search_Categories(type.Id); Business_Rules.Update_Categories(checkBox_Field_Specific.Checked, checkBox_Relationship_Specific.Checked, categories.Id); var test_on = Business_Rules.Search_Test_On(type.Id); Business_Rules.Update_Test_On(checkBox_Insert.Checked, checkBox_Update.Checked, checkBox_Delete.Checked, test_on.Id); }
private void comboBox_SelectBusinessRule_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox_SelectBusinessRule.Text != "Select an business rule") { var businessRuleName = Business_Rules.Search_Rule(comboBox_SelectBusinessRule.Text); Rule_information.Id = businessRuleName.Id; } }
private void Relationship_Characteristics_Affected() { var relationship_characteristics_affected = Business_Rules.Search_Relationship_Characteristics_Affected(Rule_information.Id); checkBox_Deletion_Rule.Checked = Convert.ToBoolean(relationship_characteristics_affected.Deletion_rule); checkBox_Type_Participation.Checked = Convert.ToBoolean(relationship_characteristics_affected.Type_of_participation); checkBox_Degree_Participation.Checked = Convert.ToBoolean(relationship_characteristics_affected.Degree_of_participati); }
private void Btn_Delete_Click(object sender, EventArgs e) { Business_Rules.Delete_Rule(Rule_information.Id); MessageBox.Show("Delete Rule"); Form_profil form_Profil = new Form_profil(); this.Hide(); form_Profil.Show(); }
private void Rule_Information_Text_Boxs() { var rule_information_text_boxs = Business_Rules.Search_Rule_Information_Text_Boxs(Rule_information.Id); Txt_Statement.Text = rule_information_text_boxs.Statement; Txt_Constraint.Text = rule_information_text_boxs.Constraints; Txt_Field_Names.Text = rule_information_text_boxs.Field_names; Txt_Table_Names.Text = rule_information_text_boxs.Table_names; Txt_Action_Taken.Text = rule_information_text_boxs.Action_taken; }
/// <summary> /// Purpose: to load the data into the form /// returns: void /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form_Employee_Load(object sender, EventArgs e) { frank = Business_Rules.Rules; txt_empName.Text = blank._EmpName; txt_empID.Text = Convert.ToString(blank._EmpID); dbox_empType.Text = Convert.ToString(blank._EmpType); txt_info1.Text = Convert.ToString(blank._HourlyRate); txt_info2.Text = Convert.ToString(blank._HoursWorked); txt_info3.Text = Convert.ToString(blank._MonthlySalary); }
private void Physical_Elements() { var physical_elements = Business_Rules.Search_Physical_Elements(Rule_information.Id); checkBox_Data_Type.Checked = Convert.ToBoolean(physical_elements.Data_type); checkBox_Length.Checked = Convert.ToBoolean(physical_elements.Length); checkBox_Decimal_Places.Checked = Convert.ToBoolean(physical_elements.Decimal_places); checkBox_Character_Support.Checked = Convert.ToBoolean(physical_elements.Character_support); checkBox_Input_Mask.Checked = Convert.ToBoolean(physical_elements.Input_mask); checkBox_Display_Format.Checked = Convert.ToBoolean(physical_elements.Display_format); }
/// <summary> /// Purpose: to load the data into the form /// returns: void /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form_Employee_Load(object sender, EventArgs e) { MessageBox.Show(_OpenAFile); busRule = Business_Rules.Rules; busRule.openFile(); txt_empFName.Text = blank._FirstName; txt_empLName.Text = blank._LastName; txt_empID.Text = Convert.ToString(blank._EmpID); dbox_empType.Text = Convert.ToString(blank._EmpType); txt_info1.Text = Convert.ToString(blank._HourlyRate); txt_info2.Text = Convert.ToString(blank._HoursWorked); txt_info3.Text = Convert.ToString(blank._MonthlySalary); busRule.startup(); }
private void Logical_Elements() { var businessRuleLogicalElements = Business_Rules.Search_Logical_Elements(Rule_information.Id); checkBox_Key_Type.Checked = Convert.ToBoolean(businessRuleLogicalElements.Key_type); checkBox_Key_Structure.Checked = Convert.ToBoolean(businessRuleLogicalElements.Key_structure); checkBox_Uniqueness.Checked = Convert.ToBoolean(businessRuleLogicalElements.Uniqueness); checkBox_NullSupport.Checked = Convert.ToBoolean(businessRuleLogicalElements.Null_support); checkBox_Values_Entered_By.Checked = Convert.ToBoolean(businessRuleLogicalElements.Values_entered_by); checkBox_Required_Value.Checked = Convert.ToBoolean(businessRuleLogicalElements.Required_value); checkBox_Default_Value.Checked = Convert.ToBoolean(businessRuleLogicalElements.Default_value); checkBox_Ranges_Values.Checked = Convert.ToBoolean(businessRuleLogicalElements.Ranges_of_values); checkBox_Comparisons_Allowed.Checked = Convert.ToBoolean(businessRuleLogicalElements.Comparisons_allowed); checkBox_Operations_Allowed.Checked = Convert.ToBoolean(businessRuleLogicalElements.Operations_allowed); checkBox_Edit_Rule.Checked = Convert.ToBoolean(businessRuleLogicalElements.Edit_rule); }
private void Type() { var type = Business_Rules.Search_Type(Rule_information.Id); checkBox_Database_Oriented.Checked = Convert.ToBoolean(type.data_base_oriented); checkBox_Application_Oriented.Checked = Convert.ToBoolean(type.application_oriented); var categories = Business_Rules.Search_Categories(type.Id); checkBox_Field_Specific.Checked = Convert.ToBoolean(categories.Field_specfic); checkBox_Relationship_Specific.Checked = Convert.ToBoolean(categories.Relationship_specific); var test_on = Business_Rules.Search_Test_On(type.Id); checkBox_Insert.Checked = Convert.ToBoolean(test_on.Inserts); checkBox_Update.Checked = Convert.ToBoolean(test_on.Updates); checkBox_Delete.Checked = Convert.ToBoolean(test_on.Deletes); }
private void Rules_All() { var idProject = Models.Search_Model(comboBox_SelecProject.Text); Model_information.Id = idProject.id; businessRules.Clear(); businessRules = new List <string> { "Select an business rule" }; var businessRules_name = Business_Rules.GetAll(Model_information.Id); foreach (var item in businessRules_name) { businessRules.Add(item.rules_name); } comboBox_SelectBusinessRule.DataSource = businessRules; }
private void comboBox_SelectBusinessRule_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox_SelectBusinessRule.Text != "Select an business rule") { var businessRuleName = Business_Rules.Search_Rule(comboBox_SelectBusinessRule.Text); Rule_information.Id = businessRuleName.Id; Lbl_RuleName.Text = businessRuleName.rules_name; Logical_Elements(); Physical_Elements(); Relationship_Characteristics_Affected(); Rule_Information_Text_Boxs(); Type(); panel_Vista.Visible = true; } else { panel_Vista.Visible = false; } }
private void comboBox_SelectBusinessRule_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox_SelectBusinessRule.Text != "Select an business rule") { var businessRuleName = Business_Rules.Search_Rule(comboBox_SelectBusinessRule.Text); Rule_information.Id = businessRuleName.Id; Txt_RuleName.Text = businessRuleName.rules_name; Logical_Elements(); Physical_Elements(); Relationship_Characteristics_Affected(); Rule_Information_Text_Boxs(); Type(); } else { Txt_RuleName.Clear(); Logical_Elements_Reset(); Physical_Elements_Reset(); Relationship_Characteristics_Affected_Reset(); Rule_Information_Text_Boxs_Reset(); Type_Reset(); } }
private void Data_Bases_Oriented() { var idProject = Models.Search_Model(comboBox_SelecProject.Text); Model_information.Id = idProject.id; businessRules.Clear(); businessRules = new List <string> { "Select an business rule" }; var idDataBasesOriented = Business_Rules.Filtre_Data_Bases_Oriented(1); foreach (var item in idDataBasesOriented) { var foreKey = Business_Rules.Search_Rule_Id(item.business_rules_idbusiness_rules); var NameRule = Business_Rules.Search_RuleName_IdModel(foreKey.rules_name, Model_information.Id); if (NameRule != null) { businessRules.Add(NameRule.rules_name); } } comboBox_SelectBusinessRule.DataSource = businessRules; }