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(); } }
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); }
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(); } }
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(); } } }
public bool Destroy(object CustomerID) { return(CustomerAddress.Destroy(CustomerID) == 1); }
public bool Delete(object CustomerID) { return(CustomerAddress.Delete(CustomerID) == 1); }