Example #1
0
        public override Task PreRender()
        {
            if (!Context.IsPostBack)
            {
                // load pickers
                Categories = pickerService.GetCategories();
                Suppliers  = pickerService.GetSuppliers();

                // load current product
                if (IsNew)
                {
                    CurrentProduct = new ProductDetailModel();
                }
                else
                {
                    CurrentProduct = productsService.GetProductById(Id);
                }
            }

            return(base.PreRender());
        }