public EmployeeTerritoryCollection FetchAll()
 {
     EmployeeTerritoryCollection coll = new EmployeeTerritoryCollection();
     Query qry = new Query(EmployeeTerritory.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
        public static EmployeeTerritoryCollection ToDtoCollection(this EntityCollection <EmployeeTerritoryEntity> entities)
        {
            OnBeforeEntityCollectionToDtoCollection(entities);
            var seenObjects = new Hashtable();
            var collection  = new EmployeeTerritoryCollection();

            foreach (var entity in entities)
            {
                collection.Add(entity.ToDto(seenObjects, new Hashtable()));
            }
            OnAfterEntityCollectionToDtoCollection(entities, collection);
            return(collection);
        }
 static partial void OnAfterEntityCollectionToDtoCollection(EntityCollection <EmployeeTerritoryEntity> entities, EmployeeTerritoryCollection dtos);
 public EmployeeTerritoryCollection FetchByQuery(Query qry)
 {
     EmployeeTerritoryCollection coll = new EmployeeTerritoryCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
 public EmployeeTerritoryCollection FetchByID(object EmployeeID)
 {
     EmployeeTerritoryCollection coll = new EmployeeTerritoryCollection().Where("EmployeeID", EmployeeID).Load();
     return coll;
 }
Пример #6
0
        public static void RefreshForeignKeyTest(string connectionName)
        {
            OrderItemCollection oiColl = new OrderItemCollection();

            oiColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                oiColl.es.Connection.Name = connectionName;
            }

            oiColl.Query.Where(oiColl.Query.OrderID > 11 |
                               oiColl.Query.ProductID > 9);
            oiColl.Query.Load();
            oiColl.MarkAllAsDeleted();
            oiColl.Save();

            OrderCollection oColl = new OrderCollection();

            oColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                oColl.es.Connection.Name = connectionName;
            }

            oColl.Query.Where(oColl.Query.OrderID > 11);
            oColl.Query.Load();
            oColl.MarkAllAsDeleted();
            oColl.Save();

            EmployeeTerritoryCollection etColl = new EmployeeTerritoryCollection();

            etColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                etColl.es.Connection.Name = connectionName;
            }

            etColl.Query.Where(etColl.Query.EmpID > 4 |
                               etColl.Query.TerrID > 4);
            etColl.Query.Load();
            etColl.MarkAllAsDeleted();
            etColl.Save();

            CustomerCollection cColl = new CustomerCollection();

            cColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                cColl.es.Connection.Name = connectionName;
            }

            cColl.Query.Where(cColl.Query.CustomerID > "99999" &
                              cColl.Query.CustomerSub > "001");
            cColl.Query.Load();
            cColl.MarkAllAsDeleted();
            cColl.Save();

            TerritoryExCollection tExColl = new TerritoryExCollection();

            tExColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                tExColl.es.Connection.Name = connectionName;
            }

            tExColl.Query.Where(tExColl.Query.TerritoryID > 1);
            tExColl.Query.Load();
            tExColl.MarkAllAsDeleted();
            tExColl.Save();

            TerritoryCollection tColl = new TerritoryCollection();

            tColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                tColl.es.Connection.Name = connectionName;
            }

            tColl.Query.Where(tColl.Query.TerritoryID > 5);
            tColl.Query.Load();
            tColl.MarkAllAsDeleted();
            tColl.Save();

            ReferredEmployeeCollection reColl = new ReferredEmployeeCollection();

            reColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                reColl.es.Connection.Name = connectionName;
            }

            reColl.Query.Where(reColl.Query.EmployeeID > 4 |
                               reColl.Query.ReferredID > 5);
            reColl.Query.Load();
            reColl.MarkAllAsDeleted();
            reColl.Save();

            ProductCollection pColl = new ProductCollection();

            pColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                pColl.es.Connection.Name = connectionName;
            }

            pColl.Query.Where(pColl.Query.ProductID > 10);
            pColl.Query.Load();
            pColl.MarkAllAsDeleted();
            pColl.Save();

            GroupCollection gColl = new GroupCollection();

            gColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                gColl.es.Connection.Name = connectionName;
            }

            gColl.Query.Where(gColl.Query.Id > "15001");
            gColl.Query.Load();
            gColl.MarkAllAsDeleted();
            gColl.Save();

            EmployeeCollection eColl = new EmployeeCollection();

            eColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                eColl.es.Connection.Name = connectionName;
            }

            eColl.Query.Where(eColl.Query.EmployeeID > 5);
            eColl.Query.Load();
            eColl.MarkAllAsDeleted();
            eColl.Save();

            CustomerGroupCollection cgColl = new CustomerGroupCollection();

            cgColl.es.Connection.Name = "ForeignKeyTest";
            if (connectionName.Length != 0)
            {
                cgColl.es.Connection.Name = connectionName;
            }

            cgColl.Query.Where(cgColl.Query.GroupID > "99999" |
                               cgColl.Query.GroupID < "00001");
            cgColl.Query.Load();
            cgColl.MarkAllAsDeleted();
            cgColl.Save();
        }