public void Insert(string CustomerID, string CustomerTypeID)
        {
            CustomerCustomerDemo item = new CustomerCustomerDemo();

            item.CustomerID = CustomerID;

            item.CustomerTypeID = CustomerTypeID;


            item.Save(UserName);
        }
        public void Update(string CustomerID, string CustomerTypeID)
        {
            CustomerCustomerDemo item = new CustomerCustomerDemo();

            item.MarkOld();
            item.IsLoaded = true;

            item.CustomerID = CustomerID;

            item.CustomerTypeID = CustomerTypeID;

            item.Save(UserName);
        }
Пример #3
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();
            }
        }
 public bool Destroy(object CustomerID)
 {
     return(CustomerCustomerDemo.Destroy(CustomerID) == 1);
 }
 public bool Delete(object CustomerID)
 {
     return(CustomerCustomerDemo.Delete(CustomerID) == 1);
 }