Beispiel #1
0
 public void FetchTableSale(ITable table)
 {
     MainTask.FetchTableSale(table);
     MainTask.Navigator.NavigateDirectly(MainTask.SaleView);
     var saleController = MainTask.Navigator.GetController(MainTask.SaleView) as SaleViewController;
     saleController.UpdateView();
 }
 public BusinessObjectsPropertiesRenderForeignKeyConstructorForDbContext(MyMeta.ITable table, RequestContext context)
 {
     this._context = context;
     this._table = table;
     this._script = context.ScriptSettings;
     this._output = context.Zeus.Output;
 }
Beispiel #3
0
    public bool joinTabletoFeatureLayer(IServerContext mapContext,
        ITable externalTable,
        IFeatureLayer featureLayer,
        string tableJoinField,
        string layerJoinField,
        esriJoinType joinType)
    {
        IDisplayTable pDispTable = featureLayer as IDisplayTable;

        IFeatureClass pFCLayer = pDispTable.DisplayTable as IFeatureClass;
        ITable pTLayer = (ITable)pFCLayer;

        string strJnFieldLayer = layerJoinField;
        string strJnFieldTable = tableJoinField;

        IMemoryRelationshipClassFactory pMemRelFact = (IMemoryRelationshipClassFactory)mapContext.CreateObject("esriGeoDatabase.MemoryRelationshipClassFactory");
        IRelationshipClass pRelClass = (IRelationshipClass)pMemRelFact.Open("Join",
                                                        (IObjectClass)externalTable, strJnFieldTable,
                                                        (IObjectClass)pTLayer, strJnFieldLayer,
                                                        "forward", "backward",
                                                        esriRelCardinality.esriRelCardinalityOneToOne);

        IDisplayRelationshipClass pDispRC = (IDisplayRelationshipClass)featureLayer;
        pDispRC.DisplayRelationshipClass(pRelClass, joinType);   //esriLeftOuterJoin
        IDisplayTable dt = (IDisplayTable)featureLayer;
        ITable jointable = dt.DisplayTable;

        bool retval = false;
        if (jointable is IRelQueryTable)
        {
            retval = true;
        }
        return retval;
    }
Beispiel #4
0
 private static void MapAllColumns(MappingSet set, ITable table, Entity entity)
 {
     for(int i = 0; i < table.Columns.Count; i++)
     {
         set.ChangeMappedColumnFor(entity.ConcreteProperties[i]).To(table.Columns[i]);
     }
 }
        public ITable EvaluateAggregate(QueryProcessor processor, bool distinct, ITable group, Expression[] args)
        {
            if (!function.IsAggregate)
                throw new InvalidOperationException("The function is not an aggregate.");

            try {
                // Execute it
                object[] funArgs;
                if (invokeType == 6) {
                    funArgs = new object[] { function.Name, processor, distinct, group, args };
                }
                    // The QueryProcessor, Expression[] construct
                else if (invokeType == 1) {
                    funArgs = new object[] { processor, distinct, group, args };
                } else {
                    throw new ApplicationException("Unknown invoke type");
                }

                return (ITable)method.Invoke(null, funArgs);
            } catch (MethodAccessException e) {
                throw new ApplicationException(e.Message, e);
            } catch (TargetInvocationException e) {
                throw new ApplicationException(e.InnerException.Message, e.InnerException);
            }
        }
Beispiel #6
0
        public static void AddElement(ITable element,bool addtolist = true)
        {
            lock (_newElements)
            {
                if (_newElements.ContainsKey(element.GetType()))
                {
                    if (!_newElements[element.GetType()].Contains(element))
                        _newElements[element.GetType()].Add(element);
                }
                else
                {
                    _newElements.Add(element.GetType(), new List<ITable> { element });
                }
            }
            if (addtolist)
            {
                #region Add value into array
                var field = GetCache(element);
                if (field == null)
                {
                    Logger.Error("Unable to add record value to the list, static list field wasnt finded");
                    return;
                }

                var method = field.FieldType.GetMethod("Add");
                if (method == null)
                {
                    Console.WriteLine("Unable to add record value to the list, add method wasnt finded");
                    return;
                }

                method.Invoke(field.GetValue(null), new object[] { element });
                #endregion
            }
        }
Beispiel #7
0
        private static EntityType CreateSSDLEntityType(ITable table)
        {
            EntityType entityType = new EntityType()
            {
                Name = table.TableName,
                EntitySetName = table.TableName,
                Schema = table.SchemaName,
                StoreName = table.TableName,
                StoreSchema = table.SchemaName
            };

            if (table is IView)
            {
                entityType.StoreType = StoreType.Views;
                entityType.DefiningQuery = (table as IView).DefiningQuery;
            }
            else
                entityType.StoreType = StoreType.Tables;

            foreach (IColumn column in table.Items)
            {
                entityType.Properties.Add(CreateSSDLProperty(column, entityType));
            }

            return entityType;
        }
Beispiel #8
0
 public SelectFilter(
     ITable table,
     QueryFilter query,
     List<SortCriteria> sorts)
     : this(table, query, sorts, false)
 {
 }
 public dataGeneralConfusionMatirx(ITable table, string dependentField, string independentField)
 {
     InTable = table;
     DependentFieldNames = new string[]{dependentField};
     IndependentFieldNames = new string[]{independentField};
     ClassFieldNames = new string[]{dependentField,independentField};
 }
 public dataPrepCompareClassifications(ITable table, string reference, string mapped1, string mapped2)
 {
     InTable = table;
     DependentFieldNames = new string[] { reference };
     IndependentFieldNames = new string[] { mapped1, mapped2 };
     ClassFieldNames = new string[] { reference, mapped1, mapped2 };
 }
Beispiel #11
0
 public override void Write(ITable table)
 {
     foreach (ILogger logger in _loggers)
     {
         logger.Write(table: table);
     }
 }
Beispiel #12
0
 public bool IsGood(IRow row, ITable table)
 {
     var keystring = table.GetKeystring(row);
     var inf = _lookup[keystring];
     System.Threading.Thread.Sleep(inf.Duration);
     return inf.Result;
 }
Beispiel #13
0
        public override void Write(ITable table)
        {
            this.htmlText.Append(@"<table style='border-collapse:collapse' border=0 cellspacing=0 cellpadding=0>");
            bool headerRow = table.HasHeader;
            foreach (var row in table.Rows)
            {
                this.htmlText.Append(@"<tr>");
                for (int i = 0; i < row.Length; i++)
                {
                    this.htmlText.Append(headerRow ? @"<th" : @"<td");

                    switch (table.ColumnFormats[i].Justification)
                    {
                        case Justification.Centered:
                            this.htmlText.Append(@" style='text-align:center'>");
                            break;
                        case Justification.Right:
                            this.htmlText.Append(@" style='text-align:right'>");
                            break;
                        case Justification.Left:
                        default:
                            this.htmlText.Append(@" style='text-align:left'>");
                            break;
                    }

                    this.htmlText.AppendFormat("<span style='font-size:11.0pt;font-family:Calibri,sans-serif;white-space:pre'>{0}</span>", row[i]);
                    this.htmlText.Append(headerRow ? @"</th>" : @"</td>");
                }

                headerRow = false;
                this.htmlText.Append(@"</tr>");
            }
            this.htmlText.Append(@"</table>");
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="Name">Name</param>
 /// <param name="Definition">Definition</param>
 /// <param name="Type">Type</param>
 /// <param name="ParentTable">Parent table</param>
 public Trigger(string Name, string Definition, TriggerType Type, ITable ParentTable)
 {
     this.Name = Name;
     this.Definition = Definition;
     this.Type = Type;
     this.ParentTable = ParentTable;
 }
Beispiel #15
0
 private static IRow GetTableRow(ITable table, DataRow r)
 {
     var rv = new Row();
     r.ItemArray.Select((o, i) => table.Columns[i].BinarySearch(o)).ToList()
         .ForEach(idx => rv.Rows.Add(idx));
     return rv;
 }
 public dataPrepCluster(ITable table, string[] variables, int numberOfClasses)
 {
     InTable = table;
     VariableFieldNames = variables;
     k = numberOfClasses;
     buildModel();
 }
 public dataPrepMultinomialLogisticRegression(ITable table, string[] dependentField, string[] independentFields, string[] categoricalFields)
 {
     InTable = table;
     DependentFieldNames = dependentField;
     IndependentFieldNames = independentFields;
     ClassFieldNames = categoricalFields;
 }
 public dataPrepStrata(ITable table, string[] variables, string strataField)
 {
     InTable = table;
     VariableFieldNames = variables;
     StrataField = strataField;
     buildModel();
 }
Beispiel #19
0
 Logic(ITable table, IDealer dealer, IModuleContainer moduleContainer, List<IPlayer> players)
 {
     _table = table;
     _dealer = dealer;
     _players = players;
     _moduleContainer = moduleContainer;
 }
        public override void OnStart(object param)
        {
            var employeeId = new Guid((param as object[])[0].ToString());
            CurrentEmployee = System.GetEmployee(Company.Id, employeeId);

            if ((param as object[]).Count() > 1)
            {
                var tableId = new Guid((param as object[])[1].ToString());
                var tableAreaId = new Guid((param as object[])[2].ToString());

                if ((param as object[]).Count() > 3) 
                {
                    var currentSaleId = new Guid((param as object[])[3].ToString());
                }
                
                if ((param as object[]).Count() > 4) 
                {
                    wantToMoveTable = (bool)((param as object[])[4] as bool?);
                }
               

                CurrentTable =  System.GetTable(Company.Id, Store.Id, tableAreaId, tableId);
            }

            Navigator.ActivateView(Tables);
        }
        private void RenderConcreteClass(ITable table)
        {
            _hdrUtil.WriteClassHeader(_output);

            _output.autoTabLn("using System;");
            _output.autoTabLn("using System.Linq;");
            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ".Interfaces;");
            _output.autoTabLn("using " + _script.Settings.ServiceLayer.ServiceNamespace + ".Generated;");
            _output.autoTabLn("using " + _script.Settings.ServiceLayer.ServiceNamespace + ".Interfaces;");
            _output.autoTabLn("");
            _output.autoTabLn("namespace " + _script.Settings.ServiceLayer.ServiceNamespace);
            _output.autoTabLn("{");
            _output.tabLevel++;
            _output.autoTabLn("public class " + StringFormatter.CleanUpClassName(table.Name) + "Service : " + StringFormatter.CleanUpClassName(table.Name) + "ServiceBase, I" + StringFormatter.CleanUpClassName(table.Name) + "Service");
            _output.autoTabLn("{");
            _output.tabLevel++;
            _output.autoTabLn("public " + StringFormatter.CleanUpClassName(table.Name) + "Service(I" + StringFormatter.CleanUpClassName(table.Name) + _script.Settings.DataOptions.ClassSuffix.Name + " " + StringFormatter.CamelCasing(StringFormatter.CleanUpClassName(table.Name)) + _script.Settings.DataOptions.ClassSuffix.Name + ")");
            _output.tabLevel++;
            _output.autoTabLn(": base(" + StringFormatter.CamelCasing(StringFormatter.CleanUpClassName(table.Name)) + _script.Settings.DataOptions.ClassSuffix.Name + ")");
            _output.tabLevel--;
            _output.autoTabLn("{");
            _output.autoTabLn("");
            _output.autoTabLn("}");
            _output.tabLevel--;
            _output.autoTabLn("}");
            _output.tabLevel--;
            _output.autoTabLn("}");

            _context.FileList.Add("    " + StringFormatter.CleanUpClassName(table.Name) + "Service.cs");
            SaveOutput(CreateFullPath(_script.Settings.ServiceLayer.ServiceNamespace, StringFormatter.CleanUpClassName(table.Name) + "Service.cs"), SaveActions.DontOverwrite);
        }
Beispiel #22
0
 internal CqlCommand(Expression expression, ITable table, StatementFactory stmtFactory, PocoData pocoData)
 {
     _expression = expression;
     Table = table;
     _statementFactory = stmtFactory;
     PocoData = pocoData;
 }
Beispiel #23
0
        public Column(ITable Table, IDataReader DataReader)
        {
            _table = Table;

            object val = System.DBNull.Value;

            _name = (string)DataReader[ReaderNameField];

            _dbType = this.ParseDbType((string)DataReader[ReaderTypeField]);

            val = DataReader[ReaderSizeField];

            if (val != System.DBNull.Value)
                _size = (int)val;

            val = DataReader[ReaderDefaultValueField];

            if (val != System.DBNull.Value)
                _defaultValue = ParseDefaultValue((string)val);

            val = DataReader[ReaderIsNullableField];

            if (val != System.DBNull.Value)
                _isNullable = ParseIsNullable(val);

            val = DataReader[ReaderIsPkField];

            if (val != System.DBNull.Value)
                _isPk = ParseIsPk(val);

            val = DataReader[ReaderIsPkAutoGeneratedField];

            if (val != System.DBNull.Value)
                _isPkAutoGenerated = ParseIsIdent(val);
        }
Beispiel #24
0
        public SelectFilter(
            ITable table,
            QueryFilter query,
            List<SortCriteria> sorts,
            bool isCount,
            List<IColumn> columns)
        {
            this.table = table;
            this.query = query;
            this.sorts = sorts;
            this.isCount = isCount;
            this.columns = columns;

            if (this.columns == null)
            {
                this.columns = new List<IColumn>();
                foreach (IColumn col in this.table.Columns)
                {
                    if (col.ColumnLocation == ColumnLocation.Database)
                    {
                        this.columns.Add(col);
                    }
                }
            }
        }
Beispiel #25
0
 public MethodDrop(ITable table, IMethod method)
     : base(method)
 {
     this.table = table;
     this.method = method;
     tableMemberDrop = new TableMemberDrop(table, method);
 }
        public void TestSetup()
        {
            var tableInfo = new TableInfo(ObjectName.Parse("APP.people"));
            tableInfo.AddColumn("id", PrimitiveTypes.Bit());
            tableInfo.AddColumn("first_name", PrimitiveTypes.String(), true);
            tableInfo.AddColumn("last_name", PrimitiveTypes.String());
            tableInfo.AddColumn("age", PrimitiveTypes.TinyInt());
            table = new TemporaryTable(tableInfo);

            var tempTable = (TemporaryTable) table;
            tempTable.NewRow(new[] {
                DataObject.BigInt(1),
                DataObject.String("Antonello"),
                DataObject.String("Provenzano"),
                DataObject.Null()
            });
            tempTable.NewRow(new[] {
                DataObject.BigInt(2),
                DataObject.String("Moritz"),
                DataObject.String("Krull"),
                DataObject.TinyInt(31)
            });

            tempTable.BuildIndexes();
        }
Beispiel #27
0
 //public IEnumerable<ITable> Tables { get; set; }
 public void CreateTableSale(ITable table)
 {
     var sale = MainTask.CreateTableSale(MainTask.Register.AreaId, MainTask.Register.Id, MainTask.UserAccount.Id, table.Id);
     MainTask.Navigator.NavigateDirectly(MainTask.SaleView);
     var saleController = MainTask.Navigator.GetController(MainTask.SaleView) as SaleViewController;
     saleController.UpdateView();
 }
Beispiel #28
0
        public static void RemoveElement(ITable element,bool removefromlist = true)
        {
            if (element == null)
                return;
            lock (_removeElements)
            {
                if (_newElements.ContainsKey(element.GetType()) && _newElements[element.GetType()].Contains(element))
                {
                    RemoveFromList(element);
                    _newElements[element.GetType()].Remove(element);
                    return;
                }

                if (_updateElements.ContainsKey(element.GetType()) && _updateElements[element.GetType()].Contains(element))
                    _updateElements[element.GetType()].Remove(element);

                if (_removeElements.ContainsKey(element.GetType()))
                {
                    if (!_removeElements[element.GetType()].Contains(element))
                        _removeElements[element.GetType()].Add(element);
                }
                else
                {
                    _removeElements.Add(element.GetType(), new List<ITable> { element });
                }
            }
            if (removefromlist)
            {
                RemoveFromList(element);
            }
        }
        public static ITable[] ExecuteStatements(this IRequest request, params IStatement[] statements)
        {
            if (statements == null)
                throw new ArgumentNullException("statements");
            if (statements.Length == 0)
                throw new ArgumentException();

            var results = new ITable[statements.Length];
            for (int i = 0; i < statements.Length; i++) {
                var statement = statements[i];

                var context = new ExecutionContext(request);

                if (statement is IPreparableStatement)
                    statement = ((IPreparableStatement) statement).Prepare(request);

                statement.Execute(context);

                ITable result;
                if (context.HasResult) {
                    result = context.Result;
                } else {
                    result = FunctionTable.ResultTable(request, 0);
                }

                results[i] = result;
            }

            return results;
        }
Beispiel #30
0
 ArticleManager()
 {
     _Table = _SE.OpenXTable<string, ArticleContentItem>("Articles");
     var conn = MySQLConnectionPool.GetConnection();
     PlateTypeItems = conn.Query<ArticlePlateTypeItem>("select * from ArticlePlateType").ToList();
     conn.GiveBack();
 }
Beispiel #31
0
 public static Person FindByBk(this ITable <Person> table, long Id)
 {
     return(table.FirstOrDefault(t =>
                                 t.Id == Id));
 }
 public virtual IEnumerable <IAnnotation> For(ITable table)
 => Enumerable.Empty <IAnnotation>();
Beispiel #33
0
 public static async Task <Person> FindByBkAsync(this ITable <Person> table, long Id)
 {
     return(await table.FirstOrDefaultAsync(t =>
                                            t.Id == Id));
 }