X-Git-Url: https://hackdaworld.org/gitweb/?p=outofuni%2Ftavern2.git;a=blobdiff_plain;f=lib%2Fproduct_category_component.dart;fp=lib%2Fproduct_category_component.dart;h=7b48a2aef0a8da676a90f16808295d9ffa9e8d07;hp=69633990e7f43e9f510363b8efed4011aa67f4f4;hb=3307c69f4b16867ba7522626b6b0acf2d6d9a478;hpb=8efc1c411ba4d97505c3836bd78bb5e68f521e2e diff --git a/lib/product_category_component.dart b/lib/product_category_component.dart index 6963399..7b48a2a 100644 --- a/lib/product_category_component.dart +++ b/lib/product_category_component.dart @@ -26,6 +26,7 @@ class ProductCategoryComponent implements OnInit { String new_prod_category_id; final ProductCategoryService _prodcatSrv; final Router _router; + var docreate=false; ProductCategoryComponent(this._prodcatSrv,this._router); @@ -44,6 +45,21 @@ class ProductCategoryComponent implements OnInit { getProductCategories(); } + void checkInput() { + if(new_prod_category_name=='' || new_prod_category_id=='') { + docreate=false; + } + else { + docreate=true; + for(var cat in product_categories) { + if(cat.id==new_prod_category_id) { + docreate=false; + break; + } + } + } + } + choose(ProductCategory pt) { selected_prod_category=pt; goto_products(pt);