コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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();
                }
            }
        }
コード例 #4
0
 public bool Destroy(object CustomerID)
 {
     return(StoreContact.Destroy(CustomerID) == 1);
 }
コード例 #5
0
 public bool Delete(object CustomerID)
 {
     return(StoreContact.Delete(CustomerID) == 1);
 }