public bool CodeRuleDefinifionCreatingNumberData_PreTransitionCRUD(string transition) { switch (transition) { case "Save": { try { ArtifactCodeRuleEditingForm artifactCodeRuleEditingForm = (ArtifactCodeRuleEditingForm)Parent; //Get CodeRuleDataType Guid codeRuleDataTypeId = Guid.Parse(cbCodeRuleDataType.SelectedItem.Value.ToString()); //Get CodeRuleDataFormat Guid codeRuleDataFormatId = Guid.Parse(cbCodeRuleDataFormat.SelectedItem.Value.ToString()); Guid ruleRepeaterTypeId = Guid.Parse(cbRuleRepeaterType.SelectedItem.Value.ToString()); CodeRuleDefinition codeRuleDefinition = codeRuleDefinitionBO.Insert(session, artifactCodeRuleEditingForm.ArtifactCodeRuleId, codeRuleDataTypeId, ParentCodeRuleDefinitionId); int beginNum = (int)spinBeginNumberValue.Number; int step = (int)spinStep.Number; int endNum = (int)spinEndNumberValue.Number; CodeRuleData codeRuleData = codeRuleNumberDataBO.Insert(session, codeRuleDefinition.CodeRuleDefinitionId, codeRuleDataFormatId, beginNum, step, endNum, ruleRepeaterTypeId); CodeRuleDefinitionId = codeRuleDefinition.CodeRuleDefinitionId; CodeRuleDataId = codeRuleData.CodeRuleDataId; return(true); } catch (Exception) { return(false); } } default: break; } return(true); }
public bool CodeRuleDefinifionCreatingStringData_PreTransitionCRUD(string transition) { switch (transition) { case "Save": { try { ArtifactCodeRuleEditingForm artifactCodeRuleEditingForm = (ArtifactCodeRuleEditingForm)Parent; //Get CodeRuleDataType Guid codeRuleDataTypeId = Guid.Parse(cbCodeRuleDataType.SelectedItem.Value.ToString()); //Get CodeRuleDataFormat Guid codeRuleDataFormatId = Guid.Parse(cbCodeRuleDataFormat.SelectedItem.Value.ToString()); CodeRuleDefinition codeRuleDefinition = codeRuleDefinitionBO.Insert(session, artifactCodeRuleEditingForm.ArtifactCodeRuleId, codeRuleDataTypeId, ParentCodeRuleDefinitionId); CodeRuleData codeRuleData = codeRuleStringDataBO.Insert(session, codeRuleDefinition.CodeRuleDefinitionId, codeRuleDataFormatId, txtStringValue.Text); CodeRuleDefinitionId = codeRuleDefinition.CodeRuleDefinitionId; CodeRuleDataId = codeRuleData.CodeRuleDataId; return(true); } catch (Exception) { return(false); } } default: break; } return(true); }