public Guid Create(MenuOnDay entity) { _commonDb.ExecuteNonQuery("insert into MenuOnDay(id, description, date) values(@id, @description, @date)", entity); return(entity.Id); }
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 }); }
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); } }
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); } }
public Guid Create(Product entity) { _commonDb.ExecuteNonQuery("insert into products(id, description, name, price) values(@id, @description, @name, @price)", entity); return(entity.Id); }
public void Create(DishList dishList) { _commonDb.ExecuteNonQuery("insert into MenuDish(idMenu, idDish, dishCount) values(@idMenu, @idDish, @dishCount)", dishList); }
public Guid Create(Dish entity) { _commonDb.ExecuteNonQuery( "insert into Dish(id, description, name) values(@id, @description, @name)", entity); return(entity.Id); }