Exemple #1
0
        public static void SaveCustomerMap(int varAddressID, int[] itemList)
        {
            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 (int item in itemList)
            {
                CustomerAddress varCustomerAddress = new CustomerAddress();
                varCustomerAddress.SetColumnValue("AddressID", varAddressID);
                varCustomerAddress.SetColumnValue("CustomerID", item);
                varCustomerAddress.Save();
            }
        }
Exemple #2
0
        public void Update(int CustomerID, int AddressID, int AddressTypeID, Guid Rowguid, DateTime ModifiedDate)
        {
            CustomerAddress item = new CustomerAddress();

            item.CustomerID = CustomerID;

            item.AddressID = AddressID;

            item.AddressTypeID = AddressTypeID;

            item.Rowguid = Rowguid;

            item.ModifiedDate = ModifiedDate;

            item.MarkOld();
            item.Save(UserName);
        }
Exemple #3
0
        public static void SaveAddressTypeMap(int varCustomerID, AddressTypeCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM CustomerAddress WHERE CustomerID=@CustomerID", Customer.Schema.Provider.Name);

            cmdDel.AddParameter("@CustomerID", varCustomerID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (AddressType item in items)
            {
                CustomerAddress varCustomerAddress = new CustomerAddress();
                varCustomerAddress.SetColumnValue("CustomerID", varCustomerID);
                varCustomerAddress.SetColumnValue("AddressTypeID", item.GetPrimaryKeyValue());
                varCustomerAddress.Save();
            }
        }
Exemple #4
0
        public static void SaveAddressTypeMap(int varCustomerID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM CustomerAddress WHERE CustomerID=@CustomerID", Customer.Schema.Provider.Name);

            cmdDel.AddParameter("@CustomerID", varCustomerID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    CustomerAddress varCustomerAddress = new CustomerAddress();
                    varCustomerAddress.SetColumnValue("CustomerID", varCustomerID);
                    varCustomerAddress.SetColumnValue("AddressTypeID", l.Value);
                    varCustomerAddress.Save();
                }
            }
        }
Exemple #5
0
 public bool Destroy(object CustomerID)
 {
     return(CustomerAddress.Destroy(CustomerID) == 1);
 }
Exemple #6
0
 public bool Delete(object CustomerID)
 {
     return(CustomerAddress.Delete(CustomerID) == 1);
 }