private void btnNuevo_Click(object sender, EventArgs e) { //if (dataGridView1.SelectedRows.Count > 0){ // //DevComponents.DotNetBar.MessageBoxEx.Show("La Fila no debe Estar Seleccionada."); // //FrmRegistroProductos P = new FrmRegistroProductos(); // //dataGridView1.ClearSelection(); // //P.Show(); //}else{ Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is FrmRegistroProductos); if (frm != null) { //si la instancia existe la pongo en primer plano frm.BringToFront(); return; } else { FrmRegistroProductos P = new FrmRegistroProductos(); //if (dataGridView1.SelectedRows.Count > 0) // Program.Evento = 1; //else Program.Evento = 0; dataGridView1.ClearSelection(); P.Show(); } // } }
private void btnEditar_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { FrmRegistroProductos P = new FrmRegistroProductos(); P.txtIdP.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); P.IdC.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); P.txtProducto.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); P.txtMarca.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); P.txtPCompra.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); P.txtPVenta.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); P.txtStock.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); P.dateTimePicker1.Value = Convert.ToDateTime(dataGridView1.CurrentRow.Cells[7].Value.ToString()); P.Show(); if (dataGridView1.SelectedRows.Count > 0) { Program.Evento = 1; } else { Program.Evento = 0; } dataGridView1.ClearSelection(); } else { DevComponents.DotNetBar.MessageBoxEx.Show("Debe Seleccionar la Fila a Editar.", "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btnEditar_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { FrmRegistroProductos Pr = new FrmRegistroProductos(); Pr.txtCodigo.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); Pr.cbxCategoria.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); Pr.txtDescripcion.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); Pr.txtMarca.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); Pr.txtStock.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); Pr.txtPCostoIVA.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); Pr.txtPVenta.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); Pr.dtmFechaRegistro.Value = Convert.ToDateTime(dataGridView1.CurrentRow.Cells[7].Value.ToString()); Pr.cmbProveedor.Text = dataGridView1.CurrentRow.Cells[8].Value.ToString(); Pr.Show(); if (dataGridView1.SelectedRows.Count > 0) { Program.Evento = 1; } else { Program.Evento = 0; } dataGridView1.ClearSelection(); } else { DevComponents.DotNetBar.MessageBoxEx.Show("Debe Seleccionar la Fila a Editar.", "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } CargarListadoArticulo(); }
private void productos_Click(object sender, EventArgs e) { FrmRegistroProductos P = new FrmRegistroProductos(); P.MdiParent = this; P.Show(); }
private void btnNuevo_Click(object sender, EventArgs e) { FrmRegistroProductos P = new FrmRegistroProductos(); if (dataGridView1.SelectedRows.Count > 0) { Program.Evento = 1; } else { Program.Evento = 0; } dataGridView1.ClearSelection(); P.Show(); }
private void btnNuevo_Click(object sender, EventArgs e) { //if (dataGridView1.SelectedRows.Count > 0){ // //DevComponents.DotNetBar.MessageBoxEx.Show("La Fila no debe Estar Seleccionada."); // //FrmRegistroProductos P = new FrmRegistroProductos(); // //dataGridView1.ClearSelection(); // //P.Show(); //}else{ FrmRegistroProductos P = new FrmRegistroProductos(); if (dataGridView1.SelectedRows.Count > 0) Program.Evento = 1; else Program.Evento = 0; dataGridView1.ClearSelection(); P.Show(); // } }
private void btnEditar_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is FrmRegistrarEmpleados); if (frm != null) { //si la instancia existe la pongo en primer plano frm.BringToFront(); return; } else { FrmRegistroProductos P = new FrmRegistroProductos(); P.txtIdP.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); P.IdC.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); P.txtProducto.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); P.txtMarca.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); P.txtPCompra.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); P.txtPVenta.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); P.txtStock.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); P.dateTimePicker1.Value = Convert.ToDateTime(dataGridView1.CurrentRow.Cells[7].Value.ToString()); P.Show(); } if (dataGridView1.SelectedRows.Count > 0) { Program.Evento = 1; } else { Program.Evento = 0; } dataGridView1.ClearSelection(); } else { DevComponents.DotNetBar.MessageBoxEx.Show("Debe Seleccionar la Fila a Editar.", "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } dataGridView1.ClearSelection(); timer1.Start(); }
private void dataGridView1_DoubleClick(object sender, EventArgs e) { if (DevComponents.DotNetBar.MessageBoxEx.Show("¿Desea modificar el registro.?", "Sistema de Ventas.", MessageBoxButtons.YesNoCancel) == DialogResult.Yes) { Program.IdArticulo = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value.ToString()); FrmRegistroProductos FrmP = new FrmRegistroProductos(); FrmP.txtCodigo.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); Program.IdCategoria = Convert.ToInt32(dataGridView1.CurrentRow.Cells[1].Value.ToString()); FrmP.txtDescripcion.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); FrmP.txtMarca.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); FrmP.txtStock.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); FrmP.txtPCostoIVA.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); FrmP.txtPVenta.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); FrmP.dtmFechaRegistro.Value = Convert.ToDateTime(dataGridView1.CurrentRow.Cells[7].Value.ToString()); Program.Proveedor = Convert.ToInt32(dataGridView1.CurrentRow.Cells[8].Value.ToString()); FrmP.Show(); dataGridView1.ClearSelection(); timer1.Start(); } }
private void btnEditar_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { FrmRegistroProductos P = new FrmRegistroProductos(); P.txtIdP.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); P.IdC.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); P.txtProducto.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); P.txtMarca.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); P.txtPCompra.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); P.txtPVenta.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); P.txtStock.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); P.txtitbis.Text = dataGridView1.CurrentRow.Cells[9].Value.ToString(); P.cbtipo.Text = dataGridView1.CurrentRow.Cells[10].Value.ToString(); P.dateTimePicker1.Value = Convert.ToDateTime(dataGridView1.CurrentRow.Cells[8].Value.ToString()); P.button1.Visible = true; P.btnGuardar.Visible = false; P.label6.Text = "Fecha de Modificacion"; P.label11.Text = "Actualizar Producto"; P.Show(); if (dataGridView1.SelectedRows.Count > 0) { Program.Evento = 1; } else { Program.Evento = 0; } dataGridView1.ClearSelection(); } else { DevComponents.DotNetBar.MessageBoxEx.Show("Debe Seleccionar la Fila a Editar.", "Sistema de Ventas.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }