public static void SaveContactTypeMap(int varCustomerID, int[] itemList) { 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 (int item in itemList) { StoreContact varStoreContact = new StoreContact(); varStoreContact.SetColumnValue("CustomerID", varCustomerID); varStoreContact.SetColumnValue("ContactTypeID", item); varStoreContact.Save(); } }
public void Update(int CustomerID, int ContactID, int ContactTypeID, Guid Rowguid, DateTime ModifiedDate) { StoreContact item = new StoreContact(); item.CustomerID = CustomerID; item.ContactID = ContactID; item.ContactTypeID = ContactTypeID; item.Rowguid = Rowguid; item.ModifiedDate = ModifiedDate; item.MarkOld(); item.Save(UserName); }
public static void SaveContactMap(int varCustomerID, System.Web.UI.WebControls.ListItemCollection itemList) { 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 (System.Web.UI.WebControls.ListItem l in itemList) { if (l.Selected) { StoreContact varStoreContact = new StoreContact(); varStoreContact.SetColumnValue("CustomerID", varCustomerID); varStoreContact.SetColumnValue("ContactID", l.Value); varStoreContact.Save(); } } }
public bool Destroy(object CustomerID) { return(StoreContact.Destroy(CustomerID) == 1); }
public bool Delete(object CustomerID) { return(StoreContact.Delete(CustomerID) == 1); }