private void add_shopping_Click(object sender, EventArgs e) { if (dgv_stock_unidades.CurrentRow == null) { MessageBox.Show("No ha seleccionado ninguna unidad", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { if (venta == null) { venta = new frm_venta(cotizacion); venta.Show(); venta.addDetail(Convert.ToInt32(dgv_stock_unidades.CurrentRow.Cells["col_id_unidad"].Value.ToString())); dgv_stock_unidades.Rows.RemoveAt(dgv_stock_unidades.CurrentRow.Index); pic_unidad.Image = (Image)Resources.errorUnidad; } else { venta.addDetail(Convert.ToInt32(dgv_stock_unidades.CurrentRow.Cells["col_id_unidad"].Value.ToString())); venta.Visible = true; dgv_stock_unidades.Rows.RemoveAt(dgv_stock_unidades.CurrentRow.Index); pic_unidad.Image = (Image)Resources.errorUnidad; } } }
private void button1_Click(object sender, EventArgs e) { if (obtieneAjustes()) { if (!revisaCaja()) { if (privilegios[0] == true) { var forma = new frm_aperturaCaja(idSucursal, userName, nameUser); if (forma.ShowDialog() == DialogResult.OK) { obtieneCaja(); frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios); if (codigo != "") { frm.textBox11.Text = codigo; frm.textBox11.Focus(); SendKeys.Send("{ENTER}"); } frm.Show(); } } else { DialogResult result; result = MessageBox.Show("ACTUALMENTE NO CUENTAS CON LOS PRIVILEGIOS PARA APERTURAR UNA CAJA ¿DESEA INGRESAR CREDENCIALES DE ADMINISTRADOR?", "TRASLADO DE MERCADERIA", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == System.Windows.Forms.DialogResult.Yes) { var forma = new frm_getCredenciales(null); if (forma.ShowDialog() == DialogResult.OK) { if (forma.currenSesion.getSesion == true) { var formas = new frm_aperturaCaja(idSucursal, userName, nameUser); if (formas.ShowDialog() == DialogResult.OK) { obtieneCaja(); frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios); if (codigo != "") { frm.textBox11.Text = codigo; frm.textBox11.Focus(); SendKeys.Send("{ENTER}"); } frm.Show(); } } } } } } else { obtieneCaja(); frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios); if (codigo != "") { frm.textBox11.Text = codigo; frm.textBox11.Focus(); SendKeys.Send("{ENTER}"); } frm.Show(); } } else { obtieneCaja(); frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios); if (codigo != "") { frm.textBox11.Text = codigo; frm.textBox11.Focus(); SendKeys.Send("{ENTER}"); } frm.Show(); } }