Пример #1
0
        public void eliminar_componente(string id)
        {
            cc = dm.GetcomponenteCollection();
            componente c = cc.FindByid(id);

            c.estado = false;
            dm.CommitAll();
        }
Пример #2
0
        public void modificar_componente(string id, string nombre, string marca, int id_prov)
        {
            cc = dm.GetcomponenteCollection();
            componente c = cc.FindByid(id);

            c.nombre      = nombre;
            c.marca       = marca;
            c.idproveedor = id_prov;
            dm.CommitAll();
        }
Пример #3
0
 private bool verificar_c(componente c)
 {
     foreach (string[] cmp in listac)
     {
         if (cmp[0] == c.nombre)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #4
0
        private void dgvComp_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            id_comp = (String)dgvComp.CurrentRow.Cells[0].Value;
            componente c = negocio.buscar_c(id_comp);

            edtNombreC.Text       = c.nombre;
            edtMarcaC.Text        = c.marca;
            edtCodC.Text          = c.id;
            cbxProv2.SelectedItem = c.proveedor;
            btnModC.Enabled       = true;
            btnElimC.Enabled      = true;
        }
Пример #5
0
        private void btnAddComp_Click(object sender, EventArgs e)
        {
            FListaComponente form = new FListaComponente();

            form.ShowDialog(this);
            componente c = negocioInv.buscar_c(FListaComponente.id);

            if (!verificar_c(c))
            {
                string[] row = new string[] { c.nombre, FListaComponente.cantidad, FListaComponente.monto };
                listac.Add(row);
                dgvCompFR.Rows.Add(row);
            }
        }
Пример #6
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (cbxLista.SelectedIndex == -1 || textBox1.Text == "" || numericUpDown1.Value == 0)
     {
         MessageBox.Show("DEBE LLENAR TODOS LOS CAMPOS PARA CONTINUAR.");
     }
     else
     {
         componente c = (componente)cbxLista.SelectedItem;
         id       = c.id;
         cantidad = Convert.ToString(numericUpDown1.Value);
         monto    = textBox1.Text;
         Close();
     }
 }