예제 #1
0
 public ExpressionsManagement()
 {
     BExpression      = new BConceptExpression();
     StringBuilder    = new StringGenerator();
     LangProv         = new BLanguage();
     ExceptionHandler = new ExceptionHandler();
 }
예제 #2
0
 public NodeValueExpressions()
 {
     if (BConceptExpression == null)
     {
         BConceptExpression = new BConceptExpression();
     }
 }
 private void SetVariableItemCodeInExpression()
 {
     if (BConceptExpression.GetByParentId(null).FirstOrDefault() == null)
     {
         return;
     }
     VariableItemCodeInExpression.Value =
         BConceptExpression.GetByParentId(null).FirstOrDefault().ID.ToString();
 }
예제 #4
0
 public ConceptRuleEditor()
 {
     if (BConceptExpression == null)
     {
         BConceptExpression = new BConceptExpression();
     }
     if (StringBuilder == null)
     {
         StringBuilder = new StringGenerator();
     }
     if (ExceptionHandler == null)
     {
         ExceptionHandler = new ExceptionHandler();
     }
     if (LangProv == null)
     {
         LangProv = new BLanguage();
     }
 }
        private void Fill_trvConceptExpression_ConceptRuleEditor()
        {
            #region image and initialization
            string[] retMessage = new string[4];
            this.InitializeCulture();
            #endregion

            try
            {
                var rootExprsnCncpt = BConceptExpression.GetRoot();
                if (rootExprsnCncpt == null)
                {
                    return;
                }

                #region Create root node and details

                var NodeValueExpressions_Object = new NodeValueExpressions();

                #endregion

                List <ConceptExpression> organizationUnitChlidList = this.BConceptExpression.GetByParentId(rootExprsnCncpt.ID);

                NodeValueExpressions_Object.MakeJsonObjectListString(organizationUnitChlidList, this.trvConceptExpression_ConceptRuleEditor, this.LangProv.GetCurrentLanguage(), false);
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                this.ErrorHiddenField_trvConceptExpression_ConceptRuleEditor.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                this.ErrorHiddenField_trvConceptExpression_ConceptRuleEditor.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                this.ErrorHiddenField_trvConceptExpression_ConceptRuleEditor.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
        }
        private string NodeToSource(TreeViewNodeCollection treeViewNodeCollection)
        {
            var startSourceCode  = string.Empty;
            var ChildsSourceCode = string.Empty;
            var finishSourceCode = string.Empty;

            foreach (TreeViewNode treeViewNode in treeViewNodeCollection)
            {
                var curCncptExprsn =
                    BConceptExpression.GetByID(Convert.ToDecimal(treeViewNode.Value));

                startSourceCode = curCncptExprsn.ScriptBeginEn;
                if (treeViewNode.Nodes != null &&
                    treeViewNode.Nodes.Count > 1)
                {
                    ChildsSourceCode = NodeToSource(treeViewNode.Nodes);
                }
                finishSourceCode = curCncptExprsn.ScriptEndEn;
            }

            return(string.Format("{0}{2}{3}", startSourceCode, ChildsSourceCode, finishSourceCode));
        }