private void buttonBuscar_Click(object sender, EventArgs e) { if (validar(1)) { MessageBox.Show("Introducir Id"); } else { int id = Convert.ToInt32(EntradaIdNumericUpDown.Value); EntradaArticulos entradaarticulo = EntradaArticulosBLL.Buscar(id); if (entradaarticulo != null) { EntradaIdNumericUpDown.Value = entradaarticulo.EntradaId; ArticulosComboBox.SelectedValue = entradaarticulo.ArticuloID; CantidadNumericUpDown.Value = entradaarticulo.Cantidad; } else { MessageBox.Show("No Fue Encontrado!", "Fallo!", MessageBoxButtons.OK, MessageBoxIcon.Error); } GeneralErrorProvider.Clear(); } }
public void BuscarTest() { EntradaArticulosBLL <EntradaArticulos> entradaArticulos = new EntradaArticulosBLL <EntradaArticulos>(); EntradaArticulos ea = EntradaArticulosBLL.Buscar(1); Assert.IsNotNull(ea); }
private void Guardarbutton_Click(object sender, EventArgs e) { bool paso = false; EntradaArticulos entradaArticulos = LlenarClase(); if (Validar(2)) { MessageBox.Show("Llenar todos los campos marcados"); return; } if (EntradaArticuloIDnumericUpDown.Value == 0) { paso = EntradaArticulosBLL.Guardar(entradaArticulos); } else { var E = EntradaArticulosBLL.Buscar(Convert.ToInt32(EntradaArticuloIDnumericUpDown.Value)); if (E != null) { paso = EntradaArticulosBLL.Modificar(entradaArticulos); } } if (paso) { Limpiar(); MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void GetListTest() { EntradaArticulosBLL <EntradaArticulos> entradaArticulos = new EntradaArticulosBLL <EntradaArticulos>(); List <EntradaArticulos> lista = new List <EntradaArticulos>(); lista = EntradaArticulosBLL.GetList(c => true); Assert.IsNotNull(lista); }
public void EliminarTest() { EntradaArticulosBLL <EntradaArticulos> entradaArticulos = new EntradaArticulosBLL <EntradaArticulos>(); bool estado = false; estado = EntradaArticulosBLL.Eliminar(1); Assert.AreEqual(true, estado); }
public void ModificarTest() { EntradaArticulosBLL <EntradaArticulos> entradaArticulos = new EntradaArticulosBLL <EntradaArticulos>(); bool estado = false; EntradaArticulos ea = EntradaArticulosBLL.Buscar(1); ea.Cantidad = 12; estado = EntradaArticulosBLL.Modificar(ea); Assert.AreEqual(true, estado); }
protected void PrecioCompraTexbox_TextChanged(object sender, EventArgs e) { int precioVenta = Convert.ToInt32(PrecioVentaTextbox.Text.ToString()); int precioCompra = Convert.ToInt32(PrecioCompraTexbox.Text.ToString()); int ganancia = Utilities.Utils.ToInt(GananciaTextbox.Text.ToString()); if (Utilities.Utils.ToInt(PrecioCompraTexbox.Text) != 0 && Utilities.Utils.ToInt(PrecioVentaTextbox.Text) != 0) { ganancia = EntradaArticulosBLL.CalcularGanancia(precioVenta, precioCompra); } }
private void Guardarbutton_Click(object sender, EventArgs e) { bool estado = false; EntradaArticulos Entrada = new EntradaArticulos(); if (Validar()) { MessageBox.Show("Llene los campos correctamente", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { Entrada = LlenaClase(); if (Convert.ToInt32(IdNumericUpDown.Value) == 0) { estado = EntradaArticulosBLL.Guardar(Entrada); MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { int id = Convert.ToInt32(IdNumericUpDown.Value); EntradaArticulos entradaArticulos = new EntradaArticulos(); entradaArticulos = EntradaArticulosBLL.Buscar(id); if (entradaArticulos != null) { estado = EntradaArticulosBLL.Modificar(LlenaClase()); MessageBox.Show("Modificado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Id no existe", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (estado) { Limpiar(); } else { MessageBox.Show("No se pudo guardar", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public void GuardarTest() { EntradaArticulos ea = new EntradaArticulos(); ea.EntradaId = 1; ea.ArticuloId = 1; ea.Cantidad = 10; ea.Fecha = DateTime.Now; EntradaArticulosBLL <EntradaArticulos> entradaArticulos = new EntradaArticulosBLL <EntradaArticulos>(); bool estado = false; estado = EntradaArticulosBLL.Guardar(ea); Assert.AreEqual(true, estado); }
protected void ButtonBuscar_Click1(object sender, EventArgs e) { PrestamoGridView.DataBind(); Expression <Func <EntradaArticulos, bool> > filtro = x => true; EntradaArticulosBLL entrada = new EntradaArticulosBLL(); int id; switch (TipodeFiltro.SelectedIndex) { case 0: //ID id = Utilities.Utils.ToInt(TextCriterio.Text); filtro = c => c.EntradaArticulosID == id; if (EntradaArticulosBLL.GetList(filtro).Count() == 0) { Utilities.Utils.ShowToastr(this, " Prestamo ID No Existe", "Fallido", "success"); return; } break; case 1: // Nombre filtro = c => c.Articulo.Contains(TextCriterio.Text); if (EntradaArticulosBLL.GetList(filtro).Count() == 0) { Utilities.Utils.ShowToastr(this, "Dicho Nombre no existe", "Fallido", "success"); return; } break; case 2: //Todos filtro = x => true; if (EntradaArticulosBLL.GetList(filtro).Count() == 0) { Utilities.Utils.ShowToastr(this, "No existen Dichas Cuentas", "Fallido", "success"); } break; } PrestamoGridView.DataSource = EntradaArticulosBLL.GetList(filtro); PrestamoGridView.DataBind(); }
public void GetListTest() { bool paso; EntradaArticulos entrada = new EntradaArticulos(); entrada.EntradaArticulosID = 0; entrada.Articulo = "Pulsa"; entrada.PrecioCompra = 600; entrada.PrecioVenta = 900; entrada.Ganancia = 300; entrada.Cantidad = 4; paso = EntradaArticulosBLL.Guardar(entrada); Assert.AreEqual(paso, true); }
private void Guardarbutton_Click(object sender, EventArgs e) { bool paso = false; EntradaArticulos entradaArticulos = LlenarClase(); if (Validar(2)) { MessageBox.Show("Llenar todos los campos marcados"); return; } EntradaerrorProvider.Clear(); if (EntradaArticuloIDnumericUpDown.Value == 0) { paso = EntradaArticulosBLL.Guardar(entradaArticulos); } else { var E = EntradaArticulosBLL.Buscar(Convert.ToInt32(EntradaArticuloIDnumericUpDown.Value)); if (E != null) { paso = EntradaArticulosBLL.Modificar(entradaArticulos); } } if (paso) { MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); EntradaArticuloIDnumericUpDown.Value = 0; CantidadArticulonumericUpDown.Value = 0; ArticulocomboBox.Text.ToString(); PrecioCompranumericUpDown.Value = 0; PrecioVentanumericUpDown.Value = 0; GanancianumericUpDown.Value = 0; EntradaerrorProvider.Clear(); } else { MessageBox.Show("No se pudo guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } LlenarComboBox(); }
private void Buscarbutton_Click(object sender, EventArgs e) { int id = Convert.ToInt32(IdNumericUpDown.Value); EntradaArticulos Entrada = EntradaArticulosBLL.Buscar(id); if (Entrada != null) { FechaDateTimePicker.Value = Entrada.Fecha; ArticuloComboBox.SelectedItem = Entrada.ArticuloId; CantidadNumericUpDown.Value = Entrada.Cantidad; } else { MessageBox.Show("No se encontró", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected void BuscarButton_Click(object sender, EventArgs e) { var entradaArticulos = EntradaArticulosBLL.Buscar( Utilities.Utils.ToInt(EntradaArticuloIDTextbox.Text)); if (entradaArticulos != null) { LlenaCampos(entradaArticulos); Utilities.Utils.ShowToastr(this, "Busqueda exitosa", "Exito"); } else { Limpiar(); Utilities.Utils.ShowToastr(this, "No se pudo encontrar la Entrada de articulo ", "Error", "error"); } }
protected void EliminarButton_Click(object sender, EventArgs e) { int id = Utilities.Utils.ToInt(EntradaArticuloIDTextbox.Text); var cuenta = EntradaArticulosBLL.Buscar(id); if (cuenta == null) { Utilities.Utils.ShowToastr(this, "No se puede Eliminar", "error"); } else { EntradaArticulosBLL.Eliminar(id); Utilities.Utils.ShowToastr(this, "Entrada de articulo Eliminada", "Exito"); Limpiar(); } }
protected void GuardarButton_Click(object sender, EventArgs e) { EntradaArticulos entradaArticulos = LlenarClase(); bool paso = false; if (Page.IsValid) { if (entradaArticulos.EntradaArticulosID == 0) { paso = EntradaArticulosBLL.Guardar(entradaArticulos); } else { var verificar = EntradaArticulosBLL.Buscar(Utilities.Utils.ToInt(EntradaArticuloIDTextbox.Text)); if (verificar != null) { paso = EntradaArticulosBLL.Modificar(entradaArticulos); } else { Utilities.Utils.ShowToastr(this, "Entrada de articulo No Existe", "Fallido", "error"); return; } } if (paso) { Utilities.Utils.ShowToastr(this, "Entrada de articulo Registrada", "Exito", "Exito"); } else { Utilities.Utils.ShowToastr(this, "No pudo Guardarse la Entrada de articulo", "ERROR", "error"); } Limpiar(); return; } }
private List <EntradaArticulos> BuscarRangoFecha() { List <EntradaArticulos> lista = new List <EntradaArticulos>(); Expression <Func <EntradaArticulos, bool> > filtro = f => true; int id = Convert.ToInt32(FiltroComboBox.SelectedIndex); if (FiltroComboBox.SelectedIndex != 0 && FiltroComboBox.SelectedIndex != 2) { CriterioTextBox.ReadOnly = false; if (String.IsNullOrWhiteSpace(CriterioTextBox.Text)) { MyErrorProvider.SetError(CriterioTextBox, "No puede estar vacio"); } } switch (id) { case 0: //Todo. filtro = f => f.Fecha >= FechaDesdeDateTimePicker.Value.Date && f.Fecha <= FechaHastaDateTimePicker.Value.Date; break; case 1: //EntradaId. id = utility.ToInt(CriterioTextBox.Text); filtro = f => f.EntradaId == id && (f.Fecha >= FechaDesdeDateTimePicker.Value.Date && f.Fecha <= FechaHastaDateTimePicker.Value.Date); break; case 2: //Fecha. filtro = f => f.Fecha >= FechaDesdeDateTimePicker.Value.Date && f.Fecha <= FechaHastaDateTimePicker.Value.Date; break; case 3: //EstudianteId. filtro = f => f.ArticuloId.ToString().Contains(CriterioTextBox.Text) && f.Fecha >= FechaDesdeDateTimePicker.Value.Date && f.Fecha <= FechaHastaDateTimePicker.Value.Date; break; case 4: //Cantidad. filtro = f => f.Cantidad.ToString().Contains(CriterioTextBox.Text) && (f.Fecha >= FechaDesdeDateTimePicker.Value.Date && f.Fecha <= FechaHastaDateTimePicker.Value.Date); break; } lista = EntradaArticulosBLL.GetList(filtro); return(lista); }
private void Consultabutton_Click(object sender, EventArgs e) { int id; switch (TipocomboBox.SelectedIndex) { //ID case 0: LimpiarError(); if (SetError(1)) { MessageBox.Show("Introduce un numero"); return; } id = int.Parse(CriteriotextBox.Text); filtrar = t => t.EntradaArticulosID == id; break; //Codigo Articulo case 1: LimpiarError(); if (SetError(2)) { MessageBox.Show("Introduce un caracter"); return; } filtrar = t => t.Articulo == CriteriotextBox.Text; break; //Listar Todo case 5: filtrar = t => true; break; } entradaArticulos = EntradaArticulosBLL.GetList(filtrar); ConsultadataGridView.DataSource = entradaArticulos; }
private void buttonGuardar_Click(object sender, EventArgs e) { bool paso = false; EntradaArticulos entradaarticulo = Llenarclase(); if (validar(2)) { MessageBox.Show("Favor de Llenar las Casillas"); } else { if (EntradaIdNumericUpDown.Value == 0) { paso = EntradaArticulosBLL.Guardar(entradaarticulo); } else { var V = SegundoParcial.BLL.EntradaArticulosBLL.Buscar(Convert.ToInt32(EntradaIdNumericUpDown.Value)); if (V != null) { paso = EntradaArticulosBLL.Modificar(entradaarticulo); } } LimpiarCampos(); GeneralErrorProvider.Clear(); if (paso) { MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void EliminarButton_Click(object sender, EventArgs e) { int id = Convert.ToInt32(IdNumericUpDown.Value); EntradaArticulos Entrada = EntradaArticulosBLL.Buscar(id); if (Entrada != null) { if (EntradaArticulosBLL.Eliminar(id)) { MessageBox.Show("Eliminado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { MessageBox.Show("No se pudo eliminar!!", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("No existe!!", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonEliminar_Click(object sender, EventArgs e) { if (validar(1)) { MessageBox.Show("Introduzca Un Id"); } else { int id = Convert.ToInt32(EntradaIdNumericUpDown.Value); if (EntradaArticulosBLL.Eliminar(id)) { MessageBox.Show("Eliminado!", "Exitosamente", MessageBoxButtons.OK, MessageBoxIcon.Information); LimpiarCampos(); } else { MessageBox.Show("No se Pudo Eliminar!", "Fallo!", MessageBoxButtons.OK, MessageBoxIcon.Error); } GeneralErrorProvider.Clear(); } }
private void GananciaTextBox_TextChanged(object sender, EventArgs e) { GananciaTextBox.Text = EntradaArticulosBLL.CalcularGanancia(PrecioVentanumericUpDown.Value, PrecioCompranumericUpDown.Value).ToString(); }