private void bttBuscar_Click(object sender, EventArgs e) { if (Validar_Recibo(Recibotxt.Text) == 0) { MessageBoxTemporal.Show("Ingreso incorrectamente el codigo de Recibo", "Error", 1, false); } else if (BD.Busqueda_Articulo(int.Parse(Recibotxt.Text), Serietxt.Text) != 0) { //Probando txtArticulo.Text = Objetos_Mantenimiento.articuloMantenimiento.Descripcion; txtType.Text = Objetos_Mantenimiento.articuloMantenimiento.Tipo; txtMarca.Text = Objetos_Mantenimiento.articuloMantenimiento.Marca; txtModelo.Text = Objetos_Mantenimiento.articuloMantenimiento.Modelo; } else { MessageBoxTemporal.Show("No se encontro el articulo", "Error", 1, false); } }
private void btnBuscar_Click(object sender, EventArgs e) { if (Validar_Recibo(txtNum_Recibo.Text) == 0) { MessageBoxTemporal.Show("Ingreso incorrectamente el numero de Recibo", "Error", 1, false); } else //Probando if (BD.Busqueda_Articulo(int.Parse(txtNum_Recibo.Text), txtNum_Serie.Text) != 0) { txtDescripcion.Text = Objetos_Mantenimiento.articuloMantenimiento.Descripcion; txtEstado.Text = Objetos_Mantenimiento.articuloMantenimiento.Estado; txtMarca2.Text = Objetos_Mantenimiento.articuloMantenimiento.Marca; txtModelo2.Text = Objetos_Mantenimiento.articuloMantenimiento.Modelo; } else { MessageBoxTemporal.Show("No se encontro el articulo", "Error", 1, false); } }
private void btnBuscar_Click(object sender, EventArgs e) { if (txtRecibo.Text == "" || txtSerie.Text == "") { MessageBoxTemporal.Show("Error no deje los campos vacios", "Error", 2, false); } else if (BD.Busqueda_Articulo(int.Parse(txtRecibo.Text), txtSerie.Text) > 0 && Objetos_Mantenimiento.articuloMantenimiento.Estado != "Retirado") { dtgvInfo.Rows[0].Cells[0].Value = Objetos_Mantenimiento.articuloMantenimiento.Descripcion; dtgvInfo.Rows[0].Cells[1].Value = Objetos_Mantenimiento.articuloMantenimiento.Marca; dtgvInfo.Rows[0].Cells[2].Value = Objetos_Mantenimiento.articuloMantenimiento.Modelo; dtgvInfo.Rows[0].Cells[3].Value = Objetos_Mantenimiento.articuloMantenimiento.PrecioPago(Objetos_Mantenimiento.articuloMantenimiento.Meses).ToString(); btnRetirar.Enabled = true; } else { MessageBoxTemporal.Show("No se encontro el Articulo o ya fue retirado", "Error", 2, false); } }
private void button1_Click(object sender, EventArgs e) { if (BD.Login(txtUsuario.Text, txtPassword.Text) > 0) { if (Objetos_Globales.usuario.estado == 2) { MessageBoxTemporal.Show("Usuario inactivo", "Mensaje Importante", 1, false); } else { BD.Fecha_Inicio_Sesion(txtUsuario.Text, txtPassword.Text, Objetos_Globales.fechaHoy()); Menu menu = new Menu(); this.Hide(); menu.Show(); } } else { MessageBox.Show("Usuario y/o contraseña incorrecta", "Error"); } }
public static void EliminarCliente(string identidad) { OpenConnection(); SqlCommand command = new SqlCommand(); command.CommandText = "SP_Eliminar_Cliente"; command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@Identidad", identidad)); try { command.ExecuteNonQuery(); CloseConnection(); } catch { MessageBoxTemporal.Show("Error al encontrar cliente", "Error", 2, false); CloseConnection(); } }
public static void EliminarUsuario(string usuario) { OpenConnection(); SqlCommand command = new SqlCommand(); command.CommandText = "SP_Eliminar_Usuario"; command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@Usuario", usuario)); try { command.ExecuteNonQuery(); CloseConnection(); } catch { MessageBoxTemporal.Show("Error al encontrar usuario", "Error", 2, false); CloseConnection(); } }
private void btnBuscar_Click(object sender, EventArgs e) { if (txtBusqueda_ID.MaskFull) { if (BD.Busqueda_Cliente(txtBusqueda_ID.Text) > 0) { Objetos_Globales.cliente.identidad_Cliente = txtBusqueda_ID.Text; dtgv_Info_Cliente.Rows[0].Cells[0].Value = Objetos_Globales.cliente.nombre_Cliente; dtgv_Info_Cliente.Rows[0].Cells[1].Value = Objetos_Globales.cliente.apellido_Cliente; dtgv_Info_Cliente.Rows[0].Cells[2].Value = Objetos_Globales.cliente.telefono_Cliente; dtgv_Info_Cliente.Rows[0].Cells[3].Value = Objetos_Globales.cliente.correo_Cliente; btnAvanzar.Enabled = true; grpInfo_Nuevo_Cliente.Enabled = false; } else { DialogResult res = MessageBox.Show("No se encontro el cliente en la Base de Datos\nDesea Agregarlo?", "ALERTA", MessageBoxButtons.YesNo); if (res.ToString() == "Yes") { grpInfo_Nuevo_Cliente.Enabled = true; btnAñadir.Enabled = true; txtIdentidad.Text = txtBusqueda_ID.Text; txtNombre.Focus(); btnAvanzar.Enabled = false; } else { grpInfo_Nuevo_Cliente.Enabled = false; btnAñadir.Enabled = false; } } } else { MessageBoxTemporal.Show("Ingrese bien la identidad", "Error", 1, false); } }
private void bttBuscar_Click_1(object sender, EventArgs e) { if (txtNumSerie.Text == "" || txtNumRecibo.Text == "") { MessageBoxTemporal.Show("Error no deje los campos vacios", "Error", 2, false); } else if (txtNumRecibo.Text.Equals("") && txtNumSerie.Text.Equals("")) { MessageBoxTemporal.Show("Ingrese los valores correspondientes", "Mensaje Importante", 2, false); } else { if (BD.Busqueda_Articulo(int.Parse(txtNumRecibo.Text), txtNumSerie.Text) > 0) { txtArticulo.Text = Objetos_Mantenimiento.articuloMantenimiento.Descripcion; txtEstado.Text = Objetos_Mantenimiento.articuloMantenimiento.Estado; txtIntereses.Text = Objetos_Mantenimiento.articuloMantenimiento.Interes.ToString(); txtMonto.Text = Objetos_Mantenimiento.articuloMantenimiento.Prestado.ToString(); txtMeses.Text = Objetos_Mantenimiento.articuloMantenimiento.Meses.ToString(); btnAvanzar.Enabled = true; } } }
private void btnAvanzar_Click(object sender, EventArgs e) { if (BD.Busqueda_Recibo(int.Parse(txtCod_Recibo.Text)) == 0) { BD.Ingreso_Recibo(int.Parse(txtCod_Recibo.Text), Objetos_Globales.cliente.identidad_Cliente, Objetos_Globales.usuario.codigo_Usuario, DateTime.Today.Month.ToString() + "-" + DateTime.Today.Day.ToString() + "-" + DateTime.Today.Year.ToString()); for (int i = 0; i < Objetos_Globales.articulos.Count; i++) { BD.Ingreso_Articulo(int.Parse(txtCod_Recibo.Text), ((Articulo)Objetos_Globales.articulos[i]).NumeroSerie, ((Articulo)Objetos_Globales.articulos[i]).CodigoTipo, ((Articulo)Objetos_Globales.articulos[i]).Descripcion, ((Articulo)Objetos_Globales.articulos[i]).Marca, ((Articulo)Objetos_Globales.articulos[i]).Modelo, ((Articulo)Objetos_Globales.articulos[i]).Prestado, ((Articulo)Objetos_Globales.articulos[i]).Interes, 1, ((Articulo)Objetos_Globales.articulos[i]).Meses, "Articulo"); } MessageBoxTemporal.Show("Transaccion finalizada", "Listo", 1, false); Menu men = new Sistema_Empenos_Anderson.Menu(); men.Show(); this.Hide(); } else { MessageBoxTemporal.Show("Este recibo ya existe", "Mensaje Importante", 1, false); txtCod_Recibo.Enabled = true; } }
private void btnUpdate_Click(object sender, EventArgs e) { BD.Actualizar_Estado_Articulo(txtNum_Serie.Text, int.Parse(txtNum_Recibo.Text), cmbEstados.SelectedIndex + 1, "Articulo"); MessageBoxTemporal.Show("Informacion Actualizada!", "Informacion", 1, false); }
private void btnEliminar_Click(object sender, EventArgs e) { BD.EliminarUsuario(txtUsuarioEliminar.Text); MessageBoxTemporal.Show("Usuario eliminado", "Advertencia", 1, false); btnEliminar.Enabled = false; }
private void bttElim_Click(object sender, EventArgs e) { BD.EliminarCliente(txtID_Cliente.Text); MessageBoxTemporal.Show("Cliente eliminado", "Mensaje", 1, false); bttElim.Enabled = false; }
private void btnAgregar_Click(object sender, EventArgs e) { if (txtCod_Recibo.Text == "" || Validar_Monto(txtCod_Recibo.Text) == 0 || txtNumero_Serie.Text == "" || txtDescripcion.Text == "" || txtMarca.Text == "" || txtModelo.Text == "" || Validar_Monto(txtMonto.Text) == 0 || txtMonto.Text == "" || Validar_Monto(txtTasa.Text) == 0 || double.Parse(txtTasa.Text) > 20) { if (double.Parse(txtTasa.Text) > 20) { MessageBoxTemporal.Show("La tasa de interes máxima es de 20%", "ALERTA", 2, false); } MessageBoxTemporal.Show("Ha ingresado incorrectamente algunos datos!\nPorfavor Reviselos.", "Alerta", 2, false); } else { if (Objetos_Globales.articulos.Count == 0) { Objetos_Globales.articulos.Add(new Articulo(1, double.Parse(txtMonto.Text), double.Parse(txtTasa.Text) / 100, txtDescripcion.Text, txtMarca.Text, txtModelo.Text, "En Prenda", txtNumero_Serie.Text, cmbTipo_Articulo.SelectedText, cmbTipo_Articulo.SelectedIndex + 1, int.Parse(txtCod_Recibo.Text))); dtgvArticulos.Rows.Add(); dtgvArticulos.Rows[row].Cells[0].Value = txtNumero_Serie.Text; dtgvArticulos.Rows[row].Cells[1].Value = txtDescripcion.Text; dtgvArticulos.Rows[row].Cells[2].Value = txtMarca.Text; dtgvArticulos.Rows[row].Cells[3].Value = txtModelo.Text; row++; txtCod_Recibo.Enabled = false; txtNumero_Serie.Text = ""; txtDescripcion.Text = ""; txtMarca.Text = ""; txtModelo.Text = ""; txtMonto.Text = ""; txtTasa.Text = ""; } else { bool existeArticulo = false; for (int i = 0; i < Objetos_Globales.articulos.Count; i++) { if (((Articulo)Objetos_Globales.articulos[i]).NumeroSerie.Equals(txtNumero_Serie.Text)) { i = Objetos_Globales.articulos.Count; existeArticulo = true; } else { existeArticulo = false; } } if (!existeArticulo) { Objetos_Globales.articulos.Add(new Articulo(1, double.Parse(txtMonto.Text), double.Parse(txtTasa.Text), txtDescripcion.Text, txtMarca.Text, txtModelo.Text, "En Prenda", txtNumero_Serie.Text, cmbTipo_Articulo.SelectedValue.ToString(), cmbTipo_Articulo.SelectedIndex + 1, int.Parse(txtCod_Recibo.Text))); dtgvArticulos.Rows.Add(); dtgvArticulos.Rows[row].Cells[0].Value = txtNumero_Serie.Text; dtgvArticulos.Rows[row].Cells[1].Value = txtDescripcion.Text; dtgvArticulos.Rows[row].Cells[2].Value = txtMarca.Text; dtgvArticulos.Rows[row].Cells[3].Value = txtModelo.Text; row++; txtCod_Recibo.Enabled = false; txtNumero_Serie.Text = ""; txtDescripcion.Text = ""; txtMarca.Text = ""; txtModelo.Text = ""; txtMonto.Text = ""; txtTasa.Text = ""; } else { MessageBoxTemporal.Show("Este articulo ya se ha ingresado", "Mensaje Importante", 2, false); } } } }