Esempio n. 1
0
        public void Update(int VendorID, int AddressID, int AddressTypeID, DateTime ModifiedDate)
        {
            VendorAddress item = new VendorAddress();

            item.VendorID = VendorID;

            item.AddressID = AddressID;

            item.AddressTypeID = AddressTypeID;

            item.ModifiedDate = ModifiedDate;

            item.MarkOld();
            item.Save(UserName);
        }
Esempio n. 2
0
        public static void SaveAddressTypeMap(int varVendorID, int[] itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorAddress WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (int item in itemList)
            {
                VendorAddress varVendorAddress = new VendorAddress();
                varVendorAddress.SetColumnValue("VendorID", varVendorID);
                varVendorAddress.SetColumnValue("AddressTypeID", item);
                varVendorAddress.Save();
            }
        }
Esempio n. 3
0
        public static void SaveVendorMap(int varAddressID, VendorCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorAddress WHERE AddressID=@AddressID", Address.Schema.Provider.Name);

            cmdDel.AddParameter("@AddressID", varAddressID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (Vendor item in items)
            {
                VendorAddress varVendorAddress = new VendorAddress();
                varVendorAddress.SetColumnValue("AddressID", varAddressID);
                varVendorAddress.SetColumnValue("VendorID", item.GetPrimaryKeyValue());
                varVendorAddress.Save();
            }
        }
Esempio n. 4
0
        public static void SaveAddressMap(int varVendorID, System.Web.UI.WebControls.ListItemCollection itemList)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorAddress WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name);

            cmdDel.AddParameter("@VendorID", varVendorID);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (System.Web.UI.WebControls.ListItem l in itemList)
            {
                if (l.Selected)
                {
                    VendorAddress varVendorAddress = new VendorAddress();
                    varVendorAddress.SetColumnValue("VendorID", varVendorID);
                    varVendorAddress.SetColumnValue("AddressID", l.Value);
                    varVendorAddress.Save();
                }
            }
        }
Esempio n. 5
0
 public bool Destroy(object VendorID)
 {
     return(VendorAddress.Destroy(VendorID) == 1);
 }
Esempio n. 6
0
 public bool Delete(object VendorID)
 {
     return(VendorAddress.Delete(VendorID) == 1);
 }