private void KeyPressEvent(object sender, KeyPressEventArgs e) { if (e.KeyChar == (Char)Keys.Enter) { if (txt_Filtro.TextLength == 13) { foreach (DataRow x in datos.dt_Clientes.Rows) { if (x[2].ToString() == txt_Filtro.Text) { datos.setCliente(new Cliente(Convert.ToInt32(x[0]), x[1].ToString(), x[2].ToString(), x[4].ToString(), x[5].ToString(), x[6].ToString(), x[7].ToString(), x[8].ToString(), x[9].ToString())); t.CentrarFoco(); this.Close(); return; } } DialogResult dialogResult = MessageBox.Show("El Cliente no exite ¿desea agregarlo?", "Alerta", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { frm_NuevoCliente frm = new frm_NuevoCliente(datos, txt_Filtro, this); frm.ShowDialog(); t.CentrarFoco(); } else if (dialogResult == DialogResult.No) { } } else { MessageBox.Show("Cuit-Cuil incompleto"); } } }
private void ClickBotton(object sender, EventArgs e) { if (btn_Salir == sender) { this.Close(); } if (btn_Cargar == sender) { if (lv_Productos.SelectedItems.Count > 0) { if (txt_Cantidad.Text == "" || txt_Cantidad.Text == "0" || txt_Cantidad.Text == " ") { MessageBox.Show("Campo de cantidad con valor no valido"); } else { t.Carga(Convert.ToInt32(txt_Cantidad.Text)); t.Sumar(); t.CentrarFoco(); this.Close(); } } else { MessageBox.Show("No se selecciono ningun producto"); } } }
private void frm_Ventas_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { this.Close(); t.CentrarFoco(); } }
private void CargarRetiro() { if (txt_Monto.Text != "" && txt_Nota.Text != "") { if (Convert.ToDouble(txt_Monto.Text) > 0) { if (datos.CajaActual > Convert.ToDouble(txt_Monto.Text)) { Mensaje msj = new Mensaje(); msj.op = 5; msj.Monto = Convert.ToDouble(txt_Monto.Text); msj._Mensaje = txt_Nota.Text; msj.Empleado = datos.FirmaEmpleado; datos.CajaActual = datos.CajaActual - Convert.ToDouble(txt_Monto.Text); msj.CajaActual = datos.CajaActual; msj.Hora = DateTime.Now.ToLocalTime().ToString(); msj.IdRetiro = datos.IdRetiro; send.EnviarMensaje(c.SerializarObj(msj)); Ventas ventas = Ventas.getInstance(); ventas.CargarRetiro(datos.IdRetiro, msj.Monto, datos.FirmaEmpleado, DateTime.Now.ToLocalTime().ToString()); MessageBox.Show("Listo dinero en Caja actual : $ " + datos.CajaActual); t.CentrarFoco(); this.Close(); } else { MessageBox.Show("No se puede retirar mas de la caja total"); } } else { MessageBox.Show("El valor a retirar no puede ser negativo"); } } else { MessageBox.Show("Campos sin llenar!"); } }