コード例 #1
0
 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));
 }
コード例 #3
0
 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));
 }
コード例 #4
0
 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));
 }
コード例 #5
0
 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));
 }
コード例 #6
0
 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));
 }
コード例 #7
0
 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));
 }
コード例 #8
0
 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));
 }
コード例 #9
0
 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));
 }
コード例 #10
0
 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));
 }
コード例 #11
0
 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));
 }
コード例 #12
0
 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));
 }
コード例 #13
0
 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));
 }
コード例 #14
0
 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);
 }
コード例 #15
0
 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);
 }
コード例 #16
0
        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);
        }
コード例 #17
0
 public IEnumerable <CommandWine> GetAllCommandWineByCommandId(int id)
 {
     Connection.Command cmd = new Connection.Command("GetAllCommandWineByCommandId", true);
     cmd.AddParameter("@IdCommand", id);
     return(_con.ExecuteReader(cmd, Mapper.CommandWineToDAO));
 }
コード例 #18
0
 public Client GetOne(int value)
 {
     Connection.Command cmd = new Connection.Command("SelectClientById", true);
     cmd.AddParameter("@id", value);
     return(_con.ExecuteReader(cmd, Mapper.ClientToDAO).SingleOrDefault());
 }
コード例 #19
0
 public IEnumerable <Price> GetWinePrice(int idWine)
 {
     Connection.Command cmd = new Connection.Command("GetWinePrices", true);
     cmd.AddParameter("@IdWine", idWine);
     return(_con.ExecuteReader(cmd, Mapper.PriceToDAO));
 }
コード例 #20
0
 public IEnumerable <Wine> GetWineByProviderId(int idProvider)
 {
     Connection.Command cmd = new Connection.Command("GetWineByProviderId", true);
     cmd.AddParameter("@IdProvider", idProvider);
     return(_con.ExecuteReader(cmd, Mapper.WineToDAO));
 }
コード例 #21
0
 public IEnumerable <Wine> GetAll()
 {
     Connection.Command cmd = new Connection.Command("GetAllWine", true);
     return(_con.ExecuteReader(cmd, Mapper.WineToDAO));
 }
コード例 #22
0
 public IEnumerable <string> GetCPByCityName(string City)
 {
     Connection.Command cmd = new Connection.Command("GetCPByCityName", true);
     cmd.AddParameter("@name", City);
     return(_con.ExecuteReader(cmd, Mapper.CpToDAO));
 }
コード例 #23
0
 public IEnumerable <string> GetCountries()
 {
     Connection.Command cmd = new Connection.Command("GetCountries", true);
     return(_con.ExecuteReader(cmd, Mapper.CountryToDAO));
 }
コード例 #24
0
 public Command GetOne(int value)
 {
     Connection.Command cmd = new Connection.Command("GetCommandByIdCommand", true);
     cmd.AddParameter("@IdCommand", value);
     return(_con.ExecuteReader(cmd, Mapper.CommandToDAO).FirstOrDefault());
 }
コード例 #25
0
 public IEnumerable <Comment> GetCommentByWineId(int IdWine)
 {
     Connection.Command cmd = new Connection.Command("GetCommentByIdWine", true);
     cmd.AddParameter("@idWine", IdWine);
     return(_con.ExecuteReader(cmd, Mapper.CommentToDAO));
 }
コード例 #26
0
 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));
 }
コード例 #27
0
 public int Delete(int value)
 {
     Connection.Command cmd = new Connection.Command("DisableWine", true);
     cmd.AddParameter("@IdWine", value);
     return(_con.ExecuteNonQuery(cmd));
 }
コード例 #28
0
 public int EnableWine(int id)
 {
     Connection.Command cmd = new Connection.Command("EnableWineById", true);
     cmd.AddParameter("@Id", id);
     return(_con.ExecuteNonQuery(cmd));
 }
コード例 #29
0
 public Role GetOne(int value)
 {
     Connection.Command cmd = new Connection.Command("GetRoleById", true);
     cmd.AddParameter("@id", value);
     return(_con.ExecuteReader(cmd, Mapper.RoleToDAO).SingleOrDefault());
 }
コード例 #30
0
 public IEnumerable <City> GetAll()
 {
     Connection.Command cmd = new Connection.Command("GetCities", true);
     return(_con.ExecuteReader(cmd, Mapper.CityToDAO));
 }