Beispiel #1
0
 private void setAddProductPlan()
 {
     clearAddingProductPage();
     this.productsManipulationPlan        = ProductsManipulationPlan.CreatingNewProduct;
     this.pages.SelectedTab               = addingProductPage;
     this.updete_createProductButton.Text = Resources.AddProductMessage;
 }
Beispiel #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.productsManipulationPlan = ProductsManipulationPlan.CreatingNewProduct;

            //Initialize all pages
            InitializeProductList();
            InitializeRecipeAdding();
            InitializeDishList();
        }
Beispiel #3
0
        private void setProductToUpdate(ProductItem productToUpdate)
        {
            this.newProduct.SmallPhotoLink       = productToUpdate.ProductModel.SmallPhotoLink;
            this.updete_createProductButton.Text = Resources.UpdateText;

            this.updatingProduct          = productToUpdate.ProductModel;
            this.productsManipulationPlan = ProductsManipulationPlan.UpdatingExistingProduct;

            //Fill fields whith values of available product
            this.creatingProductNameTextField.Text     = productToUpdate.ProductModel.Name;
            this.creatingProductProteinsTextField.Text = productToUpdate.ProductModel.Proteins.ToString();
            this.creatingProductFatsTextField.Text     = productToUpdate.ProductModel.Fats.ToString();
            this.creatingProductCarbsTextField.Text    = productToUpdate.ProductModel.Carbohydrates.ToString();
            this.creatingProductPhotoLabel.Image       = productToUpdate.PictureLabel.Image;

            this.creatingProductTypeSelector.SelectedIndex = productToUpdate.ProductModel.ProductTypeModel.Id;

            this.pages.SelectedTab = addingProductPage;
        }