private void comboBoxMemorias_SelectedIndexChanged(object sender, EventArgs e)
        {
            Memoria temporal = Program.getEmpresa().buscarMemoria(comboBoxMemorias.Text);

            precio.Text = temporal.precio.ToString();
            stock.Text  = temporal.stock.ToString();
        }
        private void modificarStock_Click(object sender, EventArgs e)
        {
            Mother  temporal  = Program.getEmpresa().buscarMother(comboBoxMothers.Text);
            Micro   temporal2 = Program.getEmpresa().buscarMicro(comboBoxMicros.Text);
            Memoria temporal3 = Program.getEmpresa().buscarMemoria(comboBoxMemorias.Text);
            Disco   temporal4 = Program.getEmpresa().buscarDisco(comboBoxDiscos.Text);

            if (temporal != null)
            {
                temporal.precio = Int32.Parse(precio.Text);
                temporal.stock  = Int32.Parse(stock.Text);
            }
            if (temporal2 != null)
            {
                temporal2.precio = Int32.Parse(precio.Text);
                temporal2.stock  = Int32.Parse(stock.Text);
            }
            if (temporal3 != null)
            {
                temporal3.precio = Int32.Parse(precio.Text);
                temporal3.stock  = Int32.Parse(stock.Text);
            }
            if (temporal4 != null)
            {
                temporal4.precio = Int32.Parse(precio.Text);
                temporal4.stock  = Int32.Parse(stock.Text);
            }

            MessageBox.Show("Se modifico el stock CORRECTAMENTE!", "Moficar Stock", MessageBoxButtons.OK);
        }
Пример #3
0
        private void checkBoxMemoria4_CheckedChanged(object sender, EventArgs e)
        {
            Memoria temporal = Program.getEmpresa().buscarMemoria("DDR4 4GB 2400ghz");

            if (checkBoxMemoria4.Checked)
            {
                precioTotal.Text = (Int32.Parse(precioMemo4.Text) + Int32.Parse(precioTotal.Text)).ToString();
                Program.getEmpresa().listacompras.Add(temporal);
                stockMemo4.Text = (temporal.stock - 1).ToString();
            }
            else if (!checkBoxMemoria4.Checked)
            {
                precioTotal.Text = (Int32.Parse(precioTotal.Text) - Int32.Parse(precioMemo4.Text)).ToString();
                Program.getEmpresa().listacompras.Remove(temporal);
                stockMemo4.Text = (temporal.stock).ToString();
            }
        }
 public Memoria existeEnLista(Memoria m)
 {
     return(m);
 }
        public Empresa()
        {
            usuariosRepo = new List <Usuario>();
            microsRepo   = new List <Micro>();
            mothersRepo  = new List <Mother>();
            discosRepo   = new List <Disco>();
            memosRepo    = new List <Memoria>();
            listacompras = new List <componente>();

            Usuario administrador = new Usuario("admin", "admin");

            usuariosRepo.Add(administrador);

            Usuario usuario = new Usuario("user", "user");

            usuariosRepo.Add(usuario);

            Micro micro1 = new Micro("i3 7800k", 14000, 20);

            microsRepo.Add(micro1);

            Micro micro2 = new Micro("i5 7600k", 30000, 15);

            microsRepo.Add(micro2);

            Micro micro3 = new Micro("i7 8800k", 50000, 10);

            microsRepo.Add(micro3);

            Micro micro4 = new Micro("i9 9900k", 60000, 10);

            microsRepo.Add(micro4);

            Mother mother1 = new Mother("ASUS PRO", 5000, 20);

            mothersRepo.Add(mother1);

            Mother mother2 = new Mother("Gigabyte 320", 10000, 15);

            mothersRepo.Add(mother2);

            Mother mother3 = new Mother("MSI PRO 2", 15000, 15);

            mothersRepo.Add(mother3);

            Mother mother4 = new Mother("Asrock 1150", 20000, 10);

            mothersRepo.Add(mother4);

            Memoria memoria1 = new Memoria("DDR3 4GB 1333ghz", 3200, 20);

            memosRepo.Add(memoria1);

            Memoria memoria2 = new Memoria("DDR3 8GB 1333ghz", 5000, 15);

            memosRepo.Add(memoria2);

            Memoria memoria3 = new Memoria("DDR4 4GB 2400ghz", 4000, 10);

            memosRepo.Add(memoria3);

            Memoria memoria4 = new Memoria("DDR4 8GB 2400ghz", 6000, 10);

            memosRepo.Add(memoria4);

            Disco disco1 = new Disco("HDD 250GB Western", 3500, 20);

            discosRepo.Add(disco1);

            Disco disco2 = new Disco("HDD 500GB Western", 4500, 15);

            discosRepo.Add(disco2);

            Disco disco3 = new Disco("HDD 1TB Western", 5500, 10);

            discosRepo.Add(disco3);

            Disco disco4 = new Disco("SSD 250GB Western", 3500, 15);

            discosRepo.Add(disco4);
        }