예제 #1
0
        public brandEdit(Brand.Brand brand, adminPanel adminForm)
        {
            this.brand      = brand;
            this.adminPanel = adminForm;
            InitializeComponent();
            MaterialSkinManager materialUIManager = MaterialSkinManager.Instance;

            materialUIManager.AddFormToManage(this);
            materialUIManager.Theme = MaterialSkinManager.Themes.LIGHT;

            materialUIManager.ColorScheme = new ColorScheme(
                Primary.Blue400, Primary.Blue500,
                Primary.Blue500, Accent.Orange200,
                TextShade.WHITE
                );
            if (brand.ID == 0)
            {
                idPlaceHolder.Text = "Nuova Marca";
            }
            else
            {
                idPlaceHolder.Text = brand.ID.ToString();
            }

            brandName.Text = brand.name;
        }
예제 #2
0
        //create brand button
        private void createBrand_Click(object sender, EventArgs e)
        {
            Brand.Brand newBrand = new Brand.Brand();
            newBrand.ID   = 0;
            newBrand.name = "";
            brandEdit editBrandForm = new brandEdit(newBrand, this);

            editBrandForm.Show();
        }
예제 #3
0
        public void VerificareCreareBrand()
        {
            // arrange
            bool testResult = false;

            Brand.Brand brand = DisciplinaFactory.DisciplinaFactory.Instance.CreareBrand("Audi");

            //act
            if (brand.Nume == "Audi" && brand.ListaMasini != null)
            {
                testResult = true;
            }
            else
            {
                testResult = false;
            }

            // assert
            Assert.True(testResult); // success
        }
예제 #4
0
        //if id is 0 then i'm going to create a new brand. if id != 0 then i update the selected brand
        //called from brandEdit form
        public bool updateBrand(Brand.Brand brand)
        {
            bool result;

            if (brand.ID != 0)
            {
                result = this.BrandManager.updateBrand(this.loggedUser.email, this.loggedUser.password, brand);
            }
            else
            {
                result = this.BrandManager.createBrand(this.loggedUser.email, this.loggedUser.password, brand);
            }
            if (result)
            {
                this.loadBrands();
            }
            else
            {
                MessageBox.Show("Errore all'aggiornameto/creazione della marca");
            }
            return(result);
        }
예제 #5
0
 public Inventar(Brand.Brand masina)
 {
     ListaInventar.Add(masina);
 }