当前位置: 首页>>代码示例>>C#>>正文


C# IWorkspace.Delete方法代码示例

本文整理汇总了C#中IWorkspace.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# IWorkspace.Delete方法的具体用法?C# IWorkspace.Delete怎么用?C# IWorkspace.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IWorkspace的用法示例。


在下文中一共展示了IWorkspace.Delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateWarehouseTestContext

        private static void CreateWarehouseTestContext(WarehouseTestContext testContext, IWorkspace workspace)
        {
            workspace.Delete<InventoryTransactionType>(x => x.Id > 0);
            workspace.Delete<Entity>(x => x.Id > 0);

            testContext.Iskender = workspace.Single<MenuItem>(x => x.Name == "İskender");
            testContext.Iskender.Portions[0].MenuItemId = testContext.Iskender.Id;

            testContext.DonerEti = new InventoryItem { Name = "Döner Eti", BaseUnit = "GR", GroupCode = "", TransactionUnit = "KG", TransactionUnitMultiplier = 1000 };
            testContext.Yogurt = new InventoryItem { Name = "Yoğurt", BaseUnit = "GR", GroupCode = "", TransactionUnit = "KG", TransactionUnitMultiplier = 1000 };
            testContext.Pide = new InventoryItem { Name = "Pide", BaseUnit = "Yarım", GroupCode = "", TransactionUnit = "Adet", TransactionUnitMultiplier = 2 };
            testContext.ZeytinYagi = new InventoryItem { Name = "Zeytin Yağı", BaseUnit = "Ölçü", GroupCode = "", TransactionUnit = "Litre", TransactionUnitMultiplier = 100 };

            workspace.Add(testContext.DonerEti);
            workspace.Add(testContext.Yogurt);
            workspace.Add(testContext.Pide);
            workspace.Add(testContext.ZeytinYagi);

            testContext.IskenderRecipe = new Recipe { Name = "İskender Reçetesi", Portion = testContext.Iskender.Portions[0] };
            workspace.Add(testContext.IskenderRecipe);

            testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.DonerEti, Quantity = 120 });
            testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.Yogurt, Quantity = 50 });
            testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.Pide, Quantity = 2 });
            testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.ZeytinYagi, Quantity = 1 });

            testContext.LocalWarehouseAccountType = new AccountType { Name = "Local Warehouse Account Type" };
            testContext.SellerWarehouseAccountType = new AccountType { Name = "Seller Warehouse Account Type" };

            workspace.Add(testContext.LocalWarehouseAccountType);
            workspace.Add(testContext.SellerWarehouseAccountType);

            testContext.WarehouseType = workspace.Single<WarehouseType>(x => x.Name == Resources.Warehouses);
            testContext.WarehouseEntityType = new EntityType { Name = "Warehouse Resource Type" };
            workspace.Add(testContext.WarehouseEntityType);

            testContext.LocalWarehouseAccount = new Account { AccountTypeId = testContext.LocalWarehouseAccountType.Id };
            testContext.Seller1Account = new Account { AccountTypeId = testContext.SellerWarehouseAccountType.Id };
            testContext.Seller2Account = new Account { AccountTypeId = testContext.SellerWarehouseAccountType.Id };

            workspace.Add(testContext.LocalWarehouseAccount);
            workspace.Add(testContext.Seller1Account);
            workspace.Add(testContext.Seller2Account);

            testContext.LocalWarehouse = new Warehouse
                {
                    WarehouseTypeId = testContext.WarehouseType.Id
                };
            testContext.BarWarehouse = new Warehouse
                {
                    WarehouseTypeId = testContext.WarehouseType.Id
                };
            testContext.Seller1Warehouse = new Warehouse
                {
                    WarehouseTypeId = testContext.WarehouseType.Id
                };
            testContext.Seller2Warehouse = new Warehouse
                {
                    WarehouseTypeId = testContext.WarehouseType.Id
                };

            workspace.Add(testContext.LocalWarehouse);
            workspace.Add(testContext.BarWarehouse);
            workspace.Add(testContext.Seller1Warehouse);
            workspace.Add(testContext.Seller2Warehouse);

            testContext.LocalWarehouseEntity = new Entity
                {
                    WarehouseId = testContext.LocalWarehouse.Id,
                    EntityTypeId = testContext.WarehouseEntityType.Id,
                    AccountId = testContext.LocalWarehouseAccount.Id
                };
            testContext.BarWarehouseEntity = new Entity
                {
                    WarehouseId = testContext.BarWarehouse.Id,
                    EntityTypeId = testContext.WarehouseEntityType.Id
                };
            testContext.Seller1WarehouseEntity = new Entity
                {
                    WarehouseId = testContext.Seller1Warehouse.Id,
                    EntityTypeId = testContext.WarehouseEntityType.Id,
                    AccountId = testContext.Seller1Account.Id
                };
            testContext.Seller2WarehouseEntity = new Entity
                {
                    WarehouseId = testContext.Seller2Warehouse.Id,
                    EntityTypeId = testContext.WarehouseEntityType.Id,
                    AccountId = testContext.Seller2Account.Id
                };

            workspace.Add(testContext.LocalWarehouseEntity);
            workspace.Add(testContext.BarWarehouseEntity);
            workspace.Add(testContext.Seller1WarehouseEntity);
            workspace.Add(testContext.Seller2WarehouseEntity);

            testContext.PurchaseAccountTransactionType = new AccountTransactionType
                                                             {
                                                                 SourceAccountTypeId =
                                                                     testContext.SellerWarehouseAccountType.Id,
                                                                 TargetAccountTypeId =
//.........这里部分代码省略.........
开发者ID:hperassi,项目名称:SambaPOS-3,代码行数:101,代码来源:InventoryTests.cs


注:本文中的IWorkspace.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。