Ejemplo n.º 1
0
        private static string TransformProxyToken(DBCondition condition)
        {
            string tentative = "";

            if ('\0' == condition.TableChar)
            {
                tentative = "@" + condition.ColumnKey;
            }
            else
            {
                tentative = "@" + condition.TableChar + condition.ColumnKey;
            }
            tentative = tentative.Replace("_", "");
            switch (condition.Comparator)
            {
            case DBComparator.EQUAL_TO:
                tentative += "EQ";
                break;

            case DBComparator.GREATER_THAN:
                tentative += "GT";
                break;

            case DBComparator.LESS_THAN:
                tentative += "LT";
                break;
            }
            return(tentative);
        }
Ejemplo n.º 2
0
        private void UpdateFilter()
        {
            this.value.Clear();

            #region Old
//			foreach(DataRow row in this.conditionTable.Rows)
//			{
//				DBCondition condition = new DBCondition();
//
//				condition.ColumnName = row[0].ToString();
//				condition.FilterType = (Webb.Data.FilterTypes)row[1];
//				condition.Value = row[2];
//				condition.FollowedOperand = (Webb.Data.FilterOperands)row[3];
//				condition.Bracket = (Webb.Data.Bracket)row[4];
//
//				this.value.Add(condition);
//			}
            #endregion

            DataSet ds = Webb.Reports.DataProvider.VideoPlayBackManager.DataSource;

            foreach (DataRowView row in this.conditionTable.DefaultView)
            {
                DBCondition condition = new DBCondition();

                condition.ColumnName = row[0].ToString();
                condition.FilterType = (Webb.Data.FilterTypes)row[1];
                bool isDateTimeData = false;
                if (ds != null && ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Columns.Contains(condition.ColumnName) && ds.Tables[0].Columns[condition.ColumnName].DataType == typeof(DateTime))
                    {
                        isDateTimeData = true;
                    }
                }
                if (isDateTimeData)
                {
                    try
                    {
                        condition.Value = Convert.ToDateTime(row[2]);
                    }
                    catch
                    {
                        condition.Value = row[2];
                    }
                }
                else
                {
                    condition.Value = row[2];
                }
                condition.FollowedOperand = (Webb.Data.FilterOperands)row[3];
                condition.Bracket         = (Webb.Data.Bracket)row[4];

                this.value.Add(condition);
            }

            this.value.PlayAfter = this.C_CheckPlayAfter.Checked;
        }
Ejemplo n.º 3
0
        public static void DeleteSimpleMode(string operateUserCode, string key)
        {
            CheckoutValid.HasPermission(operateUserCode, "DeleteSimpleMode", PermissionCode.SysConfigure, Utilities.ECS3_Module.ConfigsModule);

            using (ISys_Configure_LXUO table = Global.CreateTable <ISys_Configure_LXUO>())
            {
                DBCondition condition = table.Key_LXUF.EqualTo(key);
                table.Delete(condition);
            }
        }
Ejemplo n.º 4
0
    private bool CheckParameterByCondition(string paramName, DBCondition condition)
    {
        var currParam = GetParam(paramName);

        if (currParam == null)
        {
            Debug.LogError("[DBStateMachine] Parameter is not found: " + paramName);
            return(false);
        }

        switch (condition.CheckParamType)
        {
        case EDBParamType.Scalar:
            var scalarCond  = condition as DBConditionScalar;
            var scalarParam = currParam as ScalarParam;
            if (scalarParam != null)
            {
                return(CompareFloat(scalarCond.CompMode, scalarParam.ParamValue, scalarCond.CompareValue));
            }
            break;

        case EDBParamType.Integer:
            var intCond  = condition as DBConditionInteger;
            var intParam = currParam as IntParam;
            if (intParam != null)
            {
                return(CompareInt(intCond.CompMode, intParam.ParamValue, intCond.CompareValue));
            }
            break;

        case EDBParamType.Bool:
            var boolCond  = condition as DBConditionBool;
            var boolParam = currParam as BoolParam;
            if (boolParam != null)
            {
                return(boolCond.RequiredValue == boolParam.ParamValue);
            }
            break;

        default:
            break;
        }

        Debug.LogError("[DBStateMachine] Parameter check failure: parameter type is not matching!\t----\t" + paramName);
        return(false);
    }
Ejemplo n.º 5
0
        private void UpdateFilter()
        {
            this.value.Clear();



            DataSet ds = Webb.Reports.DataProvider.VideoPlayBackManager.DataSource;

            foreach (DataRowView row in this.conditionTable.DefaultView)
            {
                DBCondition condition = new DBCondition();

                condition.ColumnName = row["Field"].ToString();
                condition.FilterType = (Webb.Data.FilterTypes)row["Operator"];

                #region Date Time
                bool isDateTimeData = false;

                if (ds != null && ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Columns.Contains(condition.ColumnName) && ds.Tables[0].Columns[condition.ColumnName].DataType == typeof(DateTime))
                    {
                        isDateTimeData = true;
                    }
                }
                if (isDateTimeData)
                {
                    try
                    {
                        condition.Value = Convert.ToDateTime(row["Value"]);
                    }
                    catch
                    {
                        condition.Value = row["Value"];
                    }
                }
                else
                {
                    condition.Value = row["Value"];
                }
                #endregion

                condition.FollowedOperand = (Webb.Data.FilterOperands)row["Operand"];

                string startBracket = row["BracketS"].ToString().Trim();
                string endBracket   = row["BracketE"].ToString().Trim();
                if (startBracket == "(")
                {
                    if (endBracket == ")")
                    {
                        condition.Bracket = Webb.Data.Bracket.NONE;
                    }
                    else
                    {
                        condition.Bracket = Webb.Data.Bracket.Start;
                    }
                }
                else
                {
                    if (endBracket == ")")
                    {
                        condition.Bracket = Webb.Data.Bracket.End;
                    }
                    else
                    {
                        condition.Bracket = Webb.Data.Bracket.NONE;
                    }
                }

                this.value.Add(condition);
            }

            this.value.PlayAfter = this.C_CheckPlayAfter.Checked;
        }
        public static DBFilter ConvertToDBFilter(int i_FilterID, IDBManager i_DBManager)
        {
            DataTable m_FilterTable = GetFilterInfoTable(i_FilterID, i_DBManager);

            DBFilter m_DBFilter = new DBFilter();

            foreach (DataRow i_Row in m_FilterTable.Rows)
            {
                string m_OP = i_Row["Lable"].ToString();

                string m_Field = i_Row["FieldName"].ToString();

                FilterTypes m_FilterType = FilterTypes.StrEqual;

                object m_Value = i_Row["Value"];

                FilterOperands m_FilterOperand = FilterOperands.And;

                FilterCatalogs m_FilterCatalog = VictoryFilterHelper.GetCatalogFromFieldName(m_Field);

                switch (m_OP)
                {
                case "Any Entry":
                {
                    continue;
                }

                case "No Entry":
                {
                    return(null);
                }

                case "Equal":
                {
                    if (m_FilterCatalog == FilterCatalogs.Number)
                    {
                        m_FilterType = FilterTypes.NumEqual;
                    }
                    else
                    {
                        m_FilterType = FilterTypes.StrEqual;
                    }
                    break;
                }

                case "Greater Than":
                {
                    m_FilterType = FilterTypes.NumGreater;

                    break;
                }

                case "Less Than":
                {
                    m_FilterType = FilterTypes.NumLess;

                    break;
                }

                case "Starts With":
                {
                    m_FilterType = FilterTypes.StrStartWith;

                    break;
                }

                case "Ends With":
                {
                    m_FilterType = FilterTypes.StrEndWith;

                    break;
                }

                case "Includes":
                {
                    m_FilterType = FilterTypes.StrInclude;

                    break;
                }

                case "From To":
                {
                    m_FilterType = FilterTypes.NumLessOrEqual;

                    m_Value = i_Row["vMax"];

                    //"From To" convert to two conditions
                    DBCondition m_DBConditionAdd = new DBCondition(m_Field, FilterTypes.NumGreaterOrEqual, i_Row["vMin"], Bracket.NONE, m_FilterOperand);

                    m_DBFilter.Add(m_DBConditionAdd);

                    break;
                }

                case "Offense":
                case "Defense":
                case "Kick":
                case "Practice":
                case "1st Down":
                case "2nd Down":
                case "3rd Down":
                case "4th Down":
                case "Left":
                case "Right":
                case "Middle":
                case "Run":
                case "Pass":
                {
                    m_FilterType = FilterTypes.StrEqual;

                    m_Value = m_OP;

                    break;
                }

                case "0":
                case "1":
                case "2":
                case "3":
                case "4":
                case "5":
                case "6":
                case "7":
                case "8":
                case "9":
                case "10":
                {
                    m_FilterType = FilterTypes.NumEqual;

                    m_Value = m_OP;

                    break;
                }

                default:
                    continue;
                }
                //switch end
                DBCondition m_DBCondition = new DBCondition(m_Field, m_FilterType, m_Value, Bracket.NONE, m_FilterOperand);

                m_DBFilter.Add(m_DBCondition);
            }

            return(m_DBFilter);
        }