public ContactCollection FetchByQuery(Query qry) { ContactCollection coll = new ContactCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public ContactCollection FetchAll() { ContactCollection coll = new ContactCollection(); Query qry = new Query(Contact.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static AVManager.DAL.ContactCollection GetContactCollection(int varVendorID) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand( "SELECT * FROM Contact INNER JOIN VendorContact ON " + "Contact.ContactID=VendorContact.ContactID WHERE VendorContact.VendorID=@VendorID", Vendor.Schema.Provider.Name); cmd.AddParameter("@VendorID", varVendorID, DbType.Int32); IDataReader rdr = SubSonic.DataService.GetReader(cmd); ContactCollection coll = new ContactCollection(); coll.LoadAndCloseReader(rdr); return(coll); }
public static void SaveContactMap(int varVendorID, ContactCollection items) { QueryCommandCollection coll = new SubSonic.QueryCommandCollection(); //delete out the existing QueryCommand cmdDel = new QueryCommand("DELETE FROM VendorContact WHERE VendorID=@VendorID", Vendor.Schema.Provider.Name); cmdDel.AddParameter("@VendorID", varVendorID); coll.Add(cmdDel); DataService.ExecuteTransaction(coll); foreach (Contact item in items) { VendorContact varVendorContact = new VendorContact(); varVendorContact.SetColumnValue("VendorID", varVendorID); varVendorContact.SetColumnValue("ContactID", item.GetPrimaryKeyValue()); varVendorContact.Save(); } }
public static void SaveContactMap(int varCreditCardID, ContactCollection items) { QueryCommandCollection coll = new SubSonic.QueryCommandCollection(); //delete out the existing QueryCommand cmdDel = new QueryCommand("DELETE FROM ContactCreditCard WHERE CreditCardID=@CreditCardID", CreditCard.Schema.Provider.Name); cmdDel.AddParameter("@CreditCardID", varCreditCardID); coll.Add(cmdDel); DataService.ExecuteTransaction(coll); foreach (Contact item in items) { ContactCreditCard varContactCreditCard = new ContactCreditCard(); varContactCreditCard.SetColumnValue("CreditCardID", varCreditCardID); varContactCreditCard.SetColumnValue("ContactID", item.GetPrimaryKeyValue()); varContactCreditCard.Save(); } }
public ContactCollection FetchByID(object ContactID) { ContactCollection coll = new ContactCollection().Where("ContactID", ContactID).Load(); return(coll); }