예제 #1
0
        public Guid Create(MenuOnDay entity)
        {
            _commonDb.ExecuteNonQuery("insert into MenuOnDay(id, description, date) values(@id, @description, @date)",
                                      entity);

            return(entity.Id);
        }
예제 #2
0
        private void Down(MigrationInfo migrationInfo)
        {
            migrationInfo.Migration.Down();
            foreach (var query in migrationInfo.Migration.Queries)
            {
                _commonDb.ExecuteNonQuery(query);
            }

            _commonDb.ExecuteNonQuery("delete from __Migrations where name = @name", new { migrationInfo.Name });
        }
예제 #3
0
        public Guid Create(Product product)
        {
            try
            {
                _commonDb.ExecuteNonQuery("insert into products(code, description, price, isAvailable, deliveryDate, codeType, codeUnit) " +
                                          "values(@code, @description, @price, @isAvailable, @deliveryDate, @codeType, @codeUnit)",
                                          product);

                return(product.Code);
            }
            catch (Exception e)
            {
                throw new ProductOperationException("Product create error!", e);
            }
        }
예제 #4
0
        public Guid Create(string description)
        {
            try
            {
                var productUnit = new ProductUnit {
                    Description = description
                };
                _commonDb.ExecuteNonQuery("insert into units(code, description) values(@code, @description)",
                                          productUnit);

                return(productUnit.Code);
            }
            catch (Exception e)
            {
                throw new CategoryOperationException("Unit create error!", e);
            }
        }
        public Guid Create(string description)
        {
            try
            {
                var productType = new ProductType {
                    Description = description
                };
                _commonDb.ExecuteNonQuery("insert into types(code, description) values(@code, @description)",
                                          productType);

                return(productType.Code);
            }
            catch (Exception e)
            {
                throw new ProductTypeOperationException("Type create error!", e);
            }
        }
예제 #6
0
 public Guid Create(Product entity)
 {
     _commonDb.ExecuteNonQuery("insert into products(id, description, name, price) values(@id, @description, @name, @price)", entity);
     return(entity.Id);
 }
예제 #7
0
 public void Create(DishList dishList)
 {
     _commonDb.ExecuteNonQuery("insert into MenuDish(idMenu, idDish, dishCount) values(@idMenu, @idDish, @dishCount)", dishList);
 }
예제 #8
0
 public Guid Create(Dish entity)
 {
     _commonDb.ExecuteNonQuery(
         "insert into Dish(id, description, name) values(@id, @description, @name)", entity);
     return(entity.Id);
 }