Пример #1
0
        public static void SaveOrderMap(int varProductID, OrderCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [Order Details] WHERE [Order Details].[ProductID] = PARM__ProductID", Product.Schema.Provider.Name);

            cmdDel.AddParameter("PARM__ProductID", varProductID, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Order item in items)
            {
                OrderDetail varOrderDetail = new OrderDetail();
                varOrderDetail.SetColumnValue("ProductID", varProductID);
                varOrderDetail.SetColumnValue("OrderID", item.GetPrimaryKeyValue());
                varOrderDetail.Save();
            }
        }
Пример #2
0
        public static void SaveProductMap(int varOrderID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [Order Details] WHERE [Order Details].[OrderID] = @OrderID", Order.Schema.Provider.Name);

            cmdDel.AddParameter("@OrderID", varOrderID, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                OrderDetail varOrderDetail = new OrderDetail();
                varOrderDetail.SetColumnValue("OrderID", varOrderID);
                varOrderDetail.SetColumnValue("ProductID", item);
                varOrderDetail.Save();
            }
        }
Пример #3
0
        public static void SaveProductMap(int varProductPhotoID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductProductPhoto WHERE ProductPhotoID=@ProductPhotoID", ProductPhoto.Schema.Provider.Name);

            cmdDel.AddParameter("@ProductPhotoID", varProductPhotoID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProductProductPhoto varProductProductPhoto = new ProductProductPhoto();
                varProductProductPhoto.SetColumnValue("ProductPhotoID", varProductPhotoID);
                varProductProductPhoto.SetColumnValue("ProductID", item);
                varProductProductPhoto.Save();
            }
        }
Пример #4
0
        public static void SaveProductModelMap(int varIllustrationID, ProductModelCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductModelIllustration WHERE IllustrationID=@IllustrationID", Illustration.Schema.Provider.Name);

            cmdDel.AddParameter("@IllustrationID", varIllustrationID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (ProductModel item in items)
            {
                ProductModelIllustration varProductModelIllustration = new ProductModelIllustration();
                varProductModelIllustration.SetColumnValue("IllustrationID", varIllustrationID);
                varProductModelIllustration.SetColumnValue("ProductModelID", item.GetPrimaryKeyValue());
                varProductModelIllustration.Save();
            }
        }
Пример #5
0
        public static void SaveEmployeeMap(byte varShiftID, byte[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM EmployeeDepartmentHistory WHERE ShiftID=@ShiftID", Shift.Schema.Provider.Name);

            cmdDel.AddParameter("@ShiftID", varShiftID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (byte item in itemList)
            {
                EmployeeDepartmentHistory varEmployeeDepartmentHistory = new EmployeeDepartmentHistory();
                varEmployeeDepartmentHistory.SetColumnValue("ShiftID", varShiftID);
                varEmployeeDepartmentHistory.SetColumnValue("EmployeeID", item);
                varEmployeeDepartmentHistory.Save();
            }
        }
Пример #6
0
        public static void SaveAspnetRoleMap(Guid varUserId, Guid[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [aspnet_UsersInRoles] WHERE [aspnet_UsersInRoles].[UserId] = @UserId", AspnetUser.Schema.Provider.Name);

            cmdDel.AddParameter("@UserId", varUserId, DbType.Guid);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Guid item in itemList)
            {
                AspnetUsersInRole varAspnetUsersInRole = new AspnetUsersInRole();
                varAspnetUsersInRole.SetColumnValue("UserId", varUserId);
                varAspnetUsersInRole.SetColumnValue("RoleId", item);
                varAspnetUsersInRole.Save();
            }
        }
Пример #7
0
        public static void SaveAddressTypeMap(int varVendorID, AddressTypeCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorAddress WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (AddressType item in items)
            {
                VendorAddress varVendorAddress = new VendorAddress();
                varVendorAddress.SetColumnValue("VendorID", varVendorID);
                varVendorAddress.SetColumnValue("AddressTypeID", item.GetPrimaryKeyValue());
                varVendorAddress.Save();
            }
        }
Пример #8
0
        public static void SaveProductMap(short varLocationID, short[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductInventory WHERE LocationID=@LocationID", Location.Schema.Provider.Name);

            cmdDel.AddParameter("@LocationID", varLocationID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (short item in itemList)
            {
                ProductInventory varProductInventory = new ProductInventory();
                varProductInventory.SetColumnValue("LocationID", varLocationID);
                varProductInventory.SetColumnValue("ProductID", item);
                varProductInventory.Save();
            }
        }
Пример #9
0
        public static void SaveContactTypeMap(int varCustomerID, ContactTypeCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM StoreContact WHERE CustomerID=@CustomerID", Store.Schema.Provider.Name);

            cmdDel.AddParameter("@CustomerID", varCustomerID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (ContactType item in items)
            {
                StoreContact varStoreContact = new StoreContact();
                varStoreContact.SetColumnValue("CustomerID", varCustomerID);
                varStoreContact.SetColumnValue("ContactTypeID", item.GetPrimaryKeyValue());
                varStoreContact.Save();
            }
        }
Пример #10
0
        public static void SaveKELENGKAPANMap(string varKODEPBJ, string[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM KELENGKAPANPBJ WHERE KODEBPJ=@KODEBPJ", PBJ.Schema.Provider.Name);

            cmdDel.AddParameter("@KODEBPJ", varKODEPBJ);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (string item in itemList)
            {
                KELENGKAPANPBJ varKELENGKAPANPBJ = new KELENGKAPANPBJ();
                varKELENGKAPANPBJ.SetColumnValue("KODEBPJ", varKODEPBJ);
                varKELENGKAPANPBJ.SetColumnValue("KODEKELENGKAPAN", item);
                varKELENGKAPANPBJ.Save();
            }
        }
Пример #11
0
        public static void SaveEmployeeMap(string varTerritoryID, EmployeeCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [EmployeeTerritories] WHERE [EmployeeTerritories].[TerritoryID] = @TerritoryID", Territory.Schema.Provider.Name);

            cmdDel.AddParameter("@TerritoryID", varTerritoryID, DbType.String);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Employee item in items)
            {
                EmployeeTerritory varEmployeeTerritory = new EmployeeTerritory();
                varEmployeeTerritory.SetColumnValue("TerritoryID", varTerritoryID);
                varEmployeeTerritory.SetColumnValue("EmployeeID", item.GetPrimaryKeyValue());
                varEmployeeTerritory.Save();
            }
        }
Пример #12
0
        public static void SaveTemplateMap(int varTemplateRegionId, TemplateCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Content_Template_TemplateRegion_Map WHERE TemplateRegionId=@TemplateRegionId", TemplateRegion.Schema.Provider.Name);

            cmdDel.AddParameter("@TemplateRegionId", varTemplateRegionId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Template item in items)
            {
                TemplateTemplateRegionMap varTemplateTemplateRegionMap = new TemplateTemplateRegionMap();
                varTemplateTemplateRegionMap.SetColumnValue("TemplateRegionId", varTemplateRegionId);
                varTemplateTemplateRegionMap.SetColumnValue("TemplateId", item.GetPrimaryKeyValue());
                varTemplateTemplateRegionMap.Save();
            }
        }
Пример #13
0
        public static void SaveProductMap(int varDocumentID, ProductCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductDocument WHERE DocumentID=@DocumentID", Document.Schema.Provider.Name);

            cmdDel.AddParameter("@DocumentID", varDocumentID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Product item in items)
            {
                ProductDocument varProductDocument = new ProductDocument();
                varProductDocument.SetColumnValue("DocumentID", varDocumentID);
                varProductDocument.SetColumnValue("ProductID", item.GetPrimaryKeyValue());
                varProductDocument.Save();
            }
        }
Пример #14
0
        public static void SaveVendorMap(int varContactID, VendorCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorContact WHERE ContactID=@ContactID", Contact.Schema.Provider.Name);

            cmdDel.AddParameter("@ContactID", varContactID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Vendor item in items)
            {
                VendorContact varVendorContact = new VendorContact();
                varVendorContact.SetColumnValue("ContactID", varContactID);
                varVendorContact.SetColumnValue("VendorID", item.GetPrimaryKeyValue());
                varVendorContact.Save();
            }
        }
Пример #15
0
        public static void SaveSysUserMap(long varIRole, string[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [tbl_RolesForUsers] WHERE [tbl_RolesForUsers].[FP_sBranchID] = @FP_sBranchID", SysRole.Schema.Provider.Name);

            cmdDel.AddParameter("@FP_sBranchID", varIRole, DbType.String);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (string item in itemList)
            {
                TblRolesForUser varTblRolesForUser = new TblRolesForUser();
                varTblRolesForUser.SetColumnValue("FP_sBranchID", varIRole);
                varTblRolesForUser.SetColumnValue("FP_sBranchID", item);
                varTblRolesForUser.Save();
            }
        }
Пример #16
0
        public static void SavePageMap(int varRegionId, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Content_Page_Region_Map WHERE RegionId=@RegionId", Region.Schema.Provider.Name);

            cmdDel.AddParameter("@RegionId", varRegionId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                PageRegionMap varPageRegionMap = new PageRegionMap();
                varPageRegionMap.SetColumnValue("RegionId", varRegionId);
                varPageRegionMap.SetColumnValue("PageId", item);
                varPageRegionMap.Save();
            }
        }
        public static void SaveProductMap(int varCustomizedProductDisplayTypeId, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Store_CustomizedProductDisplayType_Product_Map WHERE CustomizedProductDisplayTypeId=@CustomizedProductDisplayTypeId", CustomizedProductDisplayType.Schema.Provider.Name);

            cmdDel.AddParameter("@CustomizedProductDisplayTypeId", varCustomizedProductDisplayTypeId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                CustomizedProductDisplayTypeProductMap varCustomizedProductDisplayTypeProductMap = new CustomizedProductDisplayTypeProductMap();
                varCustomizedProductDisplayTypeProductMap.SetColumnValue("CustomizedProductDisplayTypeId", varCustomizedProductDisplayTypeId);
                varCustomizedProductDisplayTypeProductMap.SetColumnValue("ProductId", item);
                varCustomizedProductDisplayTypeProductMap.Save();
            }
        }
Пример #18
0
        public static void SaveCustomerMap(int varAddressID, CustomerCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM CustomerAddress WHERE AddressID=@AddressID", Address.Schema.Provider.Name);

            cmdDel.AddParameter("@AddressID", varAddressID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Customer item in items)
            {
                CustomerAddress varCustomerAddress = new CustomerAddress();
                varCustomerAddress.SetColumnValue("AddressID", varAddressID);
                varCustomerAddress.SetColumnValue("CustomerID", item.GetPrimaryKeyValue());
                varCustomerAddress.Save();
            }
        }
Пример #19
0
        public static void SaveUnitMeasureMap(int varVendorID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ProductVendor WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProductVendor varProductVendor = new ProductVendor();
                varProductVendor.SetColumnValue("VendorID", varVendorID);
                varProductVendor.SetColumnValue("UnitMeasureCode", item);
                varProductVendor.Save();
            }
        }
Пример #20
0
        public static void SaveContactMap(int varCreditCardID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM ContactCreditCard WHERE CreditCardID=@CreditCardID", CreditCard.Schema.Provider.Name);

            cmdDel.AddParameter("@CreditCardID", varCreditCardID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ContactCreditCard varContactCreditCard = new ContactCreditCard();
                varContactCreditCard.SetColumnValue("CreditCardID", varCreditCardID);
                varContactCreditCard.SetColumnValue("ContactID", item);
                varContactCreditCard.Save();
            }
        }
Пример #21
0
        public static void SaveContactTypeMap(int varVendorID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorContact WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                VendorContact varVendorContact = new VendorContact();
                varVendorContact.SetColumnValue("VendorID", varVendorID);
                varVendorContact.SetColumnValue("ContactTypeID", item);
                varVendorContact.Save();
            }
        }
Пример #22
0
        public static void SaveCountryRegionMap(string varCurrencyCode, string[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM CountryRegionCurrency WHERE CurrencyCode=@CurrencyCode", Currency.Schema.Provider.Name);

            cmdDel.AddParameter("@CurrencyCode", varCurrencyCode);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (string item in itemList)
            {
                CountryRegionCurrency varCountryRegionCurrency = new CountryRegionCurrency();
                varCountryRegionCurrency.SetColumnValue("CurrencyCode", varCurrencyCode);
                varCountryRegionCurrency.SetColumnValue("CountryRegionCode", item);
                varCountryRegionCurrency.Save();
            }
        }
Пример #23
0
        public static void SaveUserMap(int varId, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [ProjectAssignments] WHERE [ProjectAssignments].[ProjectID] = @ProjectID", Project.Schema.Provider.Name);

            cmdDel.AddParameter("@ProjectID", varId, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProjectAssignment varProjectAssignment = new ProjectAssignment();
                varProjectAssignment.SetColumnValue("ProjectID", varId);
                varProjectAssignment.SetColumnValue("UserID", item);
                varProjectAssignment.Save();
            }
        }
Пример #24
0
        public static void SaveProductMap(int varDownloadId, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Store_Product_Download_Map WHERE DownloadId=@DownloadId", Download.Schema.Provider.Name);

            cmdDel.AddParameter("@DownloadId", varDownloadId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProductDownloadMap varProductDownloadMap = new ProductDownloadMap();
                varProductDownloadMap.SetColumnValue("DownloadId", varDownloadId);
                varProductDownloadMap.SetColumnValue("ProductId", item);
                varProductDownloadMap.Save();
            }
        }
Пример #25
0
        public static void SaveTerritoryMap(int varEmployeeID, string[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [EmployeeTerritories] WHERE [EmployeeTerritories].[EmployeeID] = @EmployeeID", Employee.Schema.Provider.Name);

            cmdDel.AddParameter("@EmployeeID", varEmployeeID, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (string item in itemList)
            {
                EmployeeTerritory varEmployeeTerritory = new EmployeeTerritory();
                varEmployeeTerritory.SetColumnValue("EmployeeID", varEmployeeID);
                varEmployeeTerritory.SetColumnValue("TerritoryID", item);
                varEmployeeTerritory.Save();
            }
        }
Пример #26
0
        public static void SaveAddressMap(int varEmployeeID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM EmployeeAddress WHERE EmployeeID=@EmployeeID", Employee.Schema.Provider.Name);

            cmdDel.AddParameter("@EmployeeID", varEmployeeID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                EmployeeAddress varEmployeeAddress = new EmployeeAddress();
                varEmployeeAddress.SetColumnValue("EmployeeID", varEmployeeID);
                varEmployeeAddress.SetColumnValue("AddressID", item);
                varEmployeeAddress.Save();
            }
        }
Пример #27
0
        public static void SaveProductMap(int varCategoryID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [Product_Category_Map] WHERE [Product_Category_Map].[CategoryID] = @CategoryID", Category.Schema.Provider.Name);

            cmdDel.AddParameter("@CategoryID", varCategoryID, DbType.Int32);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                ProductCategoryMap varProductCategoryMap = new ProductCategoryMap();
                varProductCategoryMap.SetColumnValue("CategoryID", varCategoryID);
                varProductCategoryMap.SetColumnValue("ProductID", item);
                varProductCategoryMap.Save();
            }
        }
Пример #28
0
        public static void SaveShiftMap(int varEmployeeID, ShiftCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM EmployeeDepartmentHistory WHERE EmployeeID=@EmployeeID", Employee.Schema.Provider.Name);

            cmdDel.AddParameter("@EmployeeID", varEmployeeID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Shift item in items)
            {
                EmployeeDepartmentHistory varEmployeeDepartmentHistory = new EmployeeDepartmentHistory();
                varEmployeeDepartmentHistory.SetColumnValue("EmployeeID", varEmployeeID);
                varEmployeeDepartmentHistory.SetColumnValue("ShiftID", item.GetPrimaryKeyValue());
                varEmployeeDepartmentHistory.Save();
            }
        }
Пример #29
0
        public static void SaveCustomerMap(string varCustomerTypeID, string[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [CustomerCustomerDemo] WHERE [CustomerCustomerDemo].[CustomerTypeID] = PARM__CustomerTypeID", CustomerDemographic.Schema.Provider.Name);

            cmdDel.AddParameter("PARM__CustomerTypeID", varCustomerTypeID, DbType.String);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (string item in itemList)
            {
                CustomerCustomerDemo varCustomerCustomerDemo = new CustomerCustomerDemo();
                varCustomerCustomerDemo.SetColumnValue("CustomerTypeID", varCustomerTypeID);
                varCustomerCustomerDemo.SetColumnValue("CustomerID", item);
                varCustomerCustomerDemo.Save();
            }
        }
Пример #30
0
        public static void SaveProductMap(int varAttributeId, ProductCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM dashCommerce_Store_Product_Attribute_Map WHERE AttributeId=@AttributeId", Attribute.Schema.Provider.Name);

            cmdDel.AddParameter("@AttributeId", varAttributeId);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Product item in items)
            {
                ProductAttributeMap varProductAttributeMap = new ProductAttributeMap();
                varProductAttributeMap.SetColumnValue("AttributeId", varAttributeId);
                varProductAttributeMap.SetColumnValue("ProductId", item.GetPrimaryKeyValue());
                varProductAttributeMap.Save();
            }
        }