public Special Save(Special special) { using (var connection = ConnectionStrings.GetOpenConnection()) { connection.Execute( "SaveSpecial", special, commandType: CommandType.StoredProcedure ); } return(special); }
public Make Save(Make make) { using (var cn = ConnectionStrings.GetOpenConnection()) { cn.Execute( "SaveMake", make, commandType: System.Data.CommandType.StoredProcedure ); } return(make); }
public Purchase SavePurchase(Purchase purchase) { using (var cn = ConnectionStrings.GetOpenConnection()) { cn.Execute( "SavePurchase", purchase, commandType: System.Data.CommandType.StoredProcedure ); } return(purchase); }
public ContactForm AddContactForm(ContactForm contactForm) { using (var connection = ConnectionStrings.GetOpenConnection()) { connection.Execute( "AddContactForm", contactForm, commandType: System.Data.CommandType.StoredProcedure ); } return(contactForm); }
public List <Make> GetMakes() { List <Make> makes = new List <Make>(); using (var cn = ConnectionStrings.GetOpenConnection()) { makes = cn.Query <Make>( "GetMakes", commandType: System.Data.CommandType.StoredProcedure ).ToList(); } return(makes); }
public List <ExteriorColor> GetAll() { List <ExteriorColor> colors = new List <ExteriorColor>(); using (var cn = ConnectionStrings.GetOpenConnection()) { colors = cn.Query <ExteriorColor>( "GetAllExteriorColors", commandType: CommandType.StoredProcedure ).ToList(); } return(colors); }
public List <BodyStyle> GetAll() { List <BodyStyle> bodies = new List <BodyStyle>(); using (var cn = ConnectionStrings.GetOpenConnection()) { bodies = cn.Query <BodyStyle>( "GetAllBodyStyles", commandType: CommandType.StoredProcedure ).ToList(); } return(bodies); }
public List <Listing> GetSoldListings() { List <Listing> listings; using (var connection = ConnectionStrings.GetOpenConnection()) { listings = connection.Query <Listing>( "GetSoldListings", commandType: CommandType.StoredProcedure ).ToList(); } return(listings); }
public List <State> GetAll() { List <State> states; using (var connection = ConnectionStrings.GetOpenConnection()) { states = connection.Query <State>( "StatesSelectAll", commandType: CommandType.StoredProcedure ).ToList(); } return(states); }
public bool DeleteListing(int id) { using (var cn = ConnectionStrings.GetOpenConnection()) { var parameters = new DynamicParameters(); parameters.Add("@ListingId", id); cn.Execute( "ListingDelete", parameters, commandType: CommandType.StoredProcedure ); } return(true); }
public bool DeleteSpecial(int id) { using (var connection = ConnectionStrings.GetOpenConnection()) { var parameters = new DynamicParameters(); parameters.Add("@SpecialId", id); connection.Execute( "DeleteSpecial", parameters, commandType: CommandType.StoredProcedure ); } return(true); }
public Listing GetListingById(int id) { Listing listing; using (var cn = ConnectionStrings.GetOpenConnection()) { var parameters = new DynamicParameters(); parameters.Add("@ListingId", id); listing = cn.Query <Listing>( "GetListingById", parameters, commandType: CommandType.StoredProcedure ).SingleOrDefault(); } return(listing); }
public State GetState(int stateId) { State stateToReturn; using (var connection = ConnectionStrings.GetOpenConnection()) { var parameters = new DynamicParameters(); parameters.Add("@StateId", stateId); stateToReturn = connection.Query <State>( "GetState", parameters, commandType: CommandType.StoredProcedure ).SingleOrDefault(); } return(stateToReturn); }