public Provider GetProviderByMailAndPasswordMatch(string email, string password) { Connection.Command cmd = new Connection.Command("GetProviderByMailAndPasswordMatch", true); cmd.AddParameter("@email", email); cmd.AddParameter("@password", password); return(_con.ExecuteReader(cmd, Mapper.ProviderToDAO).SingleOrDefault()); }
public int Insert(ClientAddress Value) { Connection.Command cmd = new Connection.Command("CreateClientAddress", true); cmd.AddParameter("@IdAddress", Value.IdAddress); cmd.AddParameter("@IdClient", Value.IdClient); return(_con.ExecuteNonQuery(cmd)); }
public IEnumerable <Category> GetAllWineTypeCategory(int IdWine, int IdTag) { Connection.Command cmd = new Connection.Command("GetAllWineTypeCategory", true); cmd.AddParameter("@idWine", IdWine); cmd.AddParameter("@idTag", IdTag); return(_con.ExecuteReader(cmd, Mapper.CategoryToDAO)); }
public int InsertPriceForwine(Price price) { Connection.Command cmd = new Connection.Command("InsertNewWinePrice", true); cmd.AddParameter("@IdWine", price.IdWine); cmd.AddParameter("@Price", price.PriceWine); return(_con.ExecuteNonQuery(cmd)); }
public int Insert(Client value) { Connection.Command cmd = new Connection.Command("RegisterClient", true); cmd.AddParameter("@Email", value.EmailAddress); cmd.AddParameter("@Password", value.Password); return((int)_con.ExecuteScalar(cmd)); }
public int InsertNewWineCategory(int IdWine, int IdCategory) { Connection.Command cmd = new Connection.Command("InsertWineCategory", true); cmd.AddParameter("@IdWine", IdWine); cmd.AddParameter("@IdCategory", IdCategory); return(_con.ExecuteNonQuery(cmd)); }
public int Insert(City value) { Connection.Command cmd = new Connection.Command("CreateCity", true); cmd.AddParameter("@CityName", value.CityName); cmd.AddParameter("@Country", value.Country); cmd.AddParameter("@PostalCode", value.PostalCode); return(_con.ExecuteNonQuery(cmd)); }
public int Insert(Address value) { Connection.Command cmd = new Connection.Command("CreateAddress", true); cmd.AddParameter("@IdCity", value.IdCity); cmd.AddParameter("@Number", value.Number); cmd.AddParameter("@Street", value.Street); return((int)_con.ExecuteScalar(cmd)); }
public int GetIdByValues(string country, string cp, string city) { Connection.Command cmd = new Connection.Command("GetCityIdByValues", true); cmd.AddParameter("@country", country); cmd.AddParameter("@cp", cp); cmd.AddParameter("@city", city); return((int)_con.ExecuteScalar(cmd)); }
public int InsertCommandWine(CommandWine cw) { Connection.Command cmd = new Connection.Command("InsertCommandWine", true); cmd.AddParameter("@IdCommand", cw.IdCommand); cmd.AddParameter("@IdWine", cw.IdWine); cmd.AddParameter("@Quantity", cw.Quantity); return(_con.ExecuteNonQuery(cmd)); }
public int Insert(Command value) { Connection.Command cmd = new Connection.Command("InsertCommand", true); cmd.AddParameter("@DateCommand", value.DateCommand); cmd.AddParameter("@IdClient", value.IdClient); cmd.AddParameter("@IdAddressBilling", value.IdAddress); return((int)_con.ExecuteScalar(cmd)); }
public int Insert(Comment value) { Connection.Command cmd = new Connection.Command("InsertNewComment", true); cmd.AddParameter("@Note", value.Note); cmd.AddParameter("@Comment", value.CommentValue); cmd.AddParameter("@IdClient", value.IdClient); cmd.AddParameter("@IdWine", value.IdWine); return(_con.ExecuteNonQuery(cmd)); }
public int Insert(Wine value) { Connection.Command cmd = new Connection.Command("InsertNewWine", true); cmd.AddParameter("@WineName", value.WineName); cmd.AddParameter("@Description", value.Description); cmd.AddParameter("@Year", value.Year); cmd.AddParameter("@IdProvider", value.IdProvider); return((int)_con.ExecuteScalar(cmd)); }
public bool UpdateClientWithoutPassword(Client newValue) { Connection.Command cmd = new Connection.Command("UpdateClientWithoutPassword", true); cmd.AddParameter("@IdUser", newValue.Id); cmd.AddParameter("@fn", newValue.Firstname); cmd.AddParameter("@ln", newValue.Lastname); cmd.AddParameter("@EmailAddress", newValue.EmailAddress); cmd.AddParameter("@PhoneNumber", newValue.PhoneNumber); cmd.AddParameter("@BirthDate", newValue.BirthDate); _con.ExecuteNonQuery(cmd); return(true); }
public bool Update(Address newValue) { Connection.Command cmd = new Connection.Command("UpdateAddress", true); cmd.AddParameter("@IdAddress", newValue.Id); cmd.AddParameter("@IdCity", newValue.IdCity); cmd.AddParameter("@Number", newValue.Number); cmd.AddParameter("@Street", newValue.Street); if (_con.ExecuteNonQuery(cmd) > 0) { return(true); } return(false); }
public bool FindEmail(string email, int idUser) { Connection.Command cmd = new Connection.Command("FindEmail", true); cmd.AddParameter("@email", email); cmd.AddParameter("@idUser", idUser); int?exist = (int?)_con.ExecuteScalar(cmd); if (exist > 0) { return(true); } return(false); }
public IEnumerable <CommandWine> GetAllCommandWineByCommandId(int id) { Connection.Command cmd = new Connection.Command("GetAllCommandWineByCommandId", true); cmd.AddParameter("@IdCommand", id); return(_con.ExecuteReader(cmd, Mapper.CommandWineToDAO)); }
public Client GetOne(int value) { Connection.Command cmd = new Connection.Command("SelectClientById", true); cmd.AddParameter("@id", value); return(_con.ExecuteReader(cmd, Mapper.ClientToDAO).SingleOrDefault()); }
public IEnumerable <Price> GetWinePrice(int idWine) { Connection.Command cmd = new Connection.Command("GetWinePrices", true); cmd.AddParameter("@IdWine", idWine); return(_con.ExecuteReader(cmd, Mapper.PriceToDAO)); }
public IEnumerable <Wine> GetWineByProviderId(int idProvider) { Connection.Command cmd = new Connection.Command("GetWineByProviderId", true); cmd.AddParameter("@IdProvider", idProvider); return(_con.ExecuteReader(cmd, Mapper.WineToDAO)); }
public IEnumerable <Wine> GetAll() { Connection.Command cmd = new Connection.Command("GetAllWine", true); return(_con.ExecuteReader(cmd, Mapper.WineToDAO)); }
public IEnumerable <string> GetCPByCityName(string City) { Connection.Command cmd = new Connection.Command("GetCPByCityName", true); cmd.AddParameter("@name", City); return(_con.ExecuteReader(cmd, Mapper.CpToDAO)); }
public IEnumerable <string> GetCountries() { Connection.Command cmd = new Connection.Command("GetCountries", true); return(_con.ExecuteReader(cmd, Mapper.CountryToDAO)); }
public Command GetOne(int value) { Connection.Command cmd = new Connection.Command("GetCommandByIdCommand", true); cmd.AddParameter("@IdCommand", value); return(_con.ExecuteReader(cmd, Mapper.CommandToDAO).FirstOrDefault()); }
public IEnumerable <Comment> GetCommentByWineId(int IdWine) { Connection.Command cmd = new Connection.Command("GetCommentByIdWine", true); cmd.AddParameter("@idWine", IdWine); return(_con.ExecuteReader(cmd, Mapper.CommentToDAO)); }
public IEnumerable <Category> GetAllCategoriesByType(int IdType) { Connection.Command cmd = new Connection.Command("GetAllCategoriesByIdType", true); cmd.AddParameter("@IdType", IdType);// Categoy tag return(_con.ExecuteReader(cmd, Mapper.CategoryToDAO)); }
public int Delete(int value) { Connection.Command cmd = new Connection.Command("DisableWine", true); cmd.AddParameter("@IdWine", value); return(_con.ExecuteNonQuery(cmd)); }
public int EnableWine(int id) { Connection.Command cmd = new Connection.Command("EnableWineById", true); cmd.AddParameter("@Id", id); return(_con.ExecuteNonQuery(cmd)); }
public Role GetOne(int value) { Connection.Command cmd = new Connection.Command("GetRoleById", true); cmd.AddParameter("@id", value); return(_con.ExecuteReader(cmd, Mapper.RoleToDAO).SingleOrDefault()); }
public IEnumerable <City> GetAll() { Connection.Command cmd = new Connection.Command("GetCities", true); return(_con.ExecuteReader(cmd, Mapper.CityToDAO)); }