Exemple #1
0
        /// <summary>
        /// Lookup for the opposite type of a connection.
        /// </summary>
        public static EConnection OppositeConnection(EConnection connectionType)
        {
            switch (connectionType)
            {
            case EConnection.InputValue: return(EConnection.OutputValue);

            case EConnection.OutputValue: return(EConnection.InputValue);

            case EConnection.NextStatement: return(EConnection.PrevStatement);

            case EConnection.PrevStatement: return(EConnection.NextStatement);
            }
            return(EConnection.None);
        }
Exemple #2
0
        public IConnection Initialize(EConnection con)
        {
            switch (con)
            {
            case EConnection.Oracle:
                return(new Oracle());

            case EConnection.SQL:
                return(new SQL());

            default:
                throw new Exception("Connection not found");
            }
        }
Exemple #3
0
 public void GetStateMemento(ConnectionMemento connectionMemento)
 {
     econnection = connectionMemento.GetState();
 }
Exemple #4
0
 public void SetState(EConnection econnection)
 {
     this.econnection = econnection;
 }
Exemple #5
0
 public ConnectionMemento(EConnection econnection)
 {
     this.econnection = econnection;
 }
Exemple #6
0
        private static string BuildFilterStringItem(EFilterType FilterItemType, string Name, EConnection Connection, EFunction Function, EOperator Operator, string ValueType, string Value, string Value1Type, string Value1, string Value2Type, string Value2)
        {
            StringBuilder current = new StringBuilder();

            current.Append("{");
            current.Append("" + Name + ":{");
            current.Append($"{ Operator.ToString().ToLower()}" + ":{");
            if (FilterItemType == EFilterType.MultiValue)
            {
                current.AppendFormat("Value1Type:\"{0}\",", Value1Type);
                current.AppendFormat("Value1:\"{0}\",", Value1);
                current.AppendFormat("Value2Type:\"{0}\",", Value2Type);
                current.AppendFormat("Value2:\"{0}\"", Value2);
            }
            else
            {
                current.AppendFormat("ValueType:\"{0}\",", ValueType);
                current.AppendFormat("Value:\"{0}\"", Value);
            }
            current.Append("}");
            current.Append("}");
            current.Append("}");
            return(current.ToString());
        }