Beispiel #1
0
        private void dtg_productos_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 4)
            {
                int            id  = Int32.Parse(dtg_productos.CurrentRow.Cells["Id"].Value.ToString());
                UI_verProducto frm = new UI_verProducto(id);
                frm.Show();
            }
            else if (e.ColumnIndex == 5)
            {
                int id = Int32.Parse(dtg_productos.CurrentRow.Cells["Id"].Value.ToString());

                UI_editar_producto frm = new UI_editar_producto(id);
                frm.Show();
            }
            else if (e.ColumnIndex == 6)
            {
                if (MessageBox.Show("Eliminar producto", "Confirmar",
                                    MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    int id = Int32.Parse(dtg_productos.CurrentRow.Cells["Id"].Value.ToString());
                    buissnes.DeleteProductos(id);
                    MessageBox.Show("Producto Eliminado");
                }
            }
        }
Beispiel #2
0
        public static void wDelete(object sender, FileSystemEventArgs e)
        {
            XmlDocument lista = new XmlDocument();

            lista.Load(e.FullPath);
            Productos prod = Common.DeserializeFromXml <Productos>(lista.OuterXml);

            buissnes.DeleteProductos(prod.Id);
            Console.WriteLine($"Delete: {e.Name}");
        }