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