public void EliminarTest() { bool eliminar = OrdenBLL.Eliminar(1); Assert.AreEqual(eliminar, true); }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Orden>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: //todo listado = OrdenBLL.GetList(p => true); break; case 1: //ID int id = Convert.ToInt32(CriterioTextBox.Text); listado = OrdenBLL.GetList(p => p.OrdenId == id); break; case 2: //Fecha DateTime fecha = Convert.ToDateTime(CriterioTextBox.Text); listado = OrdenBLL.GetList(p => p.Fecha == fecha); break; } } else { listado = OrdenBLL.GetList(p => true); } ConsultaDataGrid.ItemsSource = null; ConsultaDataGrid.ItemsSource = listado; }
private void BucarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Orden>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: listado = OrdenBLL.GetList(x => true); break; case 1: int id; id = int.Parse(CriterioTextBox.Text); listado = OrdenBLL.GetList(x => x.OrdenId == id); break; case 2: int clienteid; clienteid = int.Parse(CriterioTextBox.Text); listado = OrdenBLL.GetList(x => x.ClienteId == clienteid); break; } } else { listado = OrdenBLL.GetList(p => true); } ConsultarDataGrid.ItemsSource = null; ConsultarDataGrid.ItemsSource = listado; }
public void BuscarTest() { Ordene ordene = new Ordene(); ordene = OrdenBLL.Buscar(1); Assert.IsNotNull(ordene); }
public void ExisteTest() { bool paso = false; paso = OrdenBLL.Existe(1); Assert.AreEqual(paso, true); }
private void GuardarButton_Click(object sender, RoutedEventArgs e) { bool paso = false; if (string.IsNullOrWhiteSpace(OrdenIdTextBox.Text) || OrdenIdTextBox.Text == "0") { paso = OrdenBLL.Guardar(orden); } else { if (!ExisteBD()) { MessageBox.Show("No Se puede Modificar porque no existe", "Fallo", MessageBoxButton.OK, MessageBoxImage.Error); return; } paso = OrdenBLL.Modificar(orden); } if (paso) { Limpiar(); MessageBox.Show("Guardado!!", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("No fue posible guardar!!", "Fallo", MessageBoxButton.OK, MessageBoxImage.Error); } }
public void cargarDetalle() { OrdenBLL ordBLL = new OrdenBLL(); if (Session["numero_boleta"] != null) { int numeroBoleta = Int32.Parse(Session["numero_boleta"].ToString()); DataTable dtTOTAL = ordBLL.GetDetalleByBoleta(numeroBoleta); if (dtTOTAL.Rows.Count > 0) { GridView2.DataSource = ordBLL.GetDetalleByBoleta(numeroBoleta); GridView2.DataBind(); Button5.Visible = true; } else { Label2.Visible = false; Label3.Visible = false; RadioButton1.Visible = false; RadioButton2.Visible = false; Label4.Visible = false; } GetTotal(numeroBoleta); } }
private void guardarButton_Click(object sender, RoutedEventArgs e) { Ordenes ordenes; bool paso = false; if (!Validar()) { return; } ordenes = LlenaClase(); if (Convert.ToInt32(idTextBox.Text) == 0) { paso = OrdenBLL.Guardar(ordenes); } else { if (!ExisteEnLaBaseDeDatos()) { MessageBox.Show("No se puede Modificar una persona que no existe", "Fallo", MessageBoxButton.OK, MessageBoxImage.Error); return; } paso = OrdenBLL.Modificar(ordenes); } if (paso) { MessageBox.Show("Guardado!", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); LimpiarCampos(); } else { MessageBox.Show("No fue posible guardar!!", "Fallo"); } }
/* * private bool validar() * { * bool paso = true; * * if (string.IsNullOrWhiteSpace(MontoTextbox.Text)) * { * MessageBox.Show("No puede dejar campos vacios"); * MontoTextbox.Focus(); * paso = false; * } * * if (string.IsNullOrWhiteSpace(ProductoIdTextbox.Text)) * { * MessageBox.Show("No puede dejar campos vacios"); * ProductoIdTextbox.Focus(); * paso = false; * } * * * return paso; * * } */ private void Button_Guardar(object sender, RoutedEventArgs e) { Orden orden = new Orden(); bool paso = false; // if (!validar()) // return; orden = LlenaClase(); if (IdTextbox.Text == "0") { paso = OrdenBLL.Guardar(orden); } else { if (!ExisteEnLaBaseDatos()) { MessageBox.Show("Personas No Existe!!"); } MessageBox.Show("Persona Modificada!!"); paso = OrdenBLL.Modificar(orden); } if (paso) { MessageBox.Show("¡¡Guardado!!"); } else { MessageBox.Show("No se Guardo!!"); } }
public void EliminarTest() { bool paso = false; paso = OrdenBLL.Eliminar(1); Assert.AreEqual(paso, true); }
public void GetListTest() { var lista = new List <Ordene>(); lista = OrdenBLL.GetList(p => true); Assert.IsNotNull(lista); }
public void GetListTest() { bool paso = false; List <Ordenes> ordenes = OrdenBLL.GetList(o => true); if (ordenes != null) { paso = true; } Assert.AreEqual(paso, true); }
private void BuscarButton_Click(object sender, RoutedEventArgs e) { Orden anterior = OrdenBLL.Buscar(Convert.ToInt32(OrdenIdTextBox.Text)); if (anterior != null) { orden = anterior; Actualizar(); } else { MessageBox.Show("Persona no Encontrada"); } }
public void BuscarTest() { Ordenes orden = new Ordenes(); bool paso = false; orden = OrdenBLL.Buscar(1); if (orden != null) { paso = true; } Assert.AreEqual(paso, true); }
public void ModificarTest() { bool paso = false; Ordenes orden = new Ordenes(); OrdenesDetalle ordenesDetalle = new OrdenesDetalle(); orden.ordenId = 1; orden.suplidorId = 1; orden.fecha = DateTime.Now; orden.monto = 250; paso = OrdenBLL.Modificar(orden); Assert.AreEqual(paso, true); }
private void eliminarButton_Click(object sender, RoutedEventArgs e) { int id; int.TryParse(idTextBox.Text, out id); if (OrdenBLL.Eliminar(id)) { MessageBox.Show("Eliminado", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Erro Al eliminar una persona"); } }
private void Button_Eliminar(object sender, RoutedEventArgs e) { int id; int.TryParse(IdTextbox.Text, out id); if (OrdenBLL.Eliminar(id)) { MessageBox.Show("Eliminado con exito!!"); } else { MessageBox.Show("No se pudo Eliminar!!"); } }
private void EliminarButton_Click(object sender, RoutedEventArgs e) { int id; id = Convert.ToInt32(OrdenIdTextBox.Text); Limpiar(); if (OrdenBLL.Eliminar(id)) { MessageBox.Show("Eliminado", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show(OrdenIdTextBox.Text, "No se puede eliminar una persona que no existe"); } }
private void buscarButton_Click(object sender, RoutedEventArgs e) { int id; Ordenes ordenes = new Ordenes(); int.TryParse(idTextBox.Text, out id); ordenes = OrdenBLL.Buscar(id); if (ordenes != null) { MessageBox.Show("Persona Encontrada", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); LlenaCampos(ordenes); } else { MessageBox.Show("Persona no econtrada", "Error", MessageBoxButton.OK, MessageBoxImage.Error); LimpiarCampos(); } }
private void Button_Buscar(object sender, RoutedEventArgs e) { int id; int.TryParse(IdTextbox.Text, out id); Orden orden = new Orden(); orden = OrdenBLL.Buscar(id); if (orden != null) { MessageBox.Show("Persona Encontrada!!"); LlenaCampo(orden); } else { MessageBox.Show("Persona No Encontrada!!"); } }
private void BuscarButton_Click(object sender, RoutedEventArgs e) { int id; Orden ordes = new Orden(); int.TryParse(OrdenIdTextBox.Text, out id); Limpiar(); ordes = OrdenBLL.Buscar(id); if (ordes != null) { MessageBox.Show("Persona Encontrada"); LlenaCampo(ordes); } else { MessageBox.Show("Persona no Encontrada"); } }
private void GuardarButton_Click(object sender, RoutedEventArgs e) { Orden ordenes; bool paso = false; if (!Validar()) { return; } ordenes = LlenaClase(); Limpiar(); //Determinar si es guardar o modificar if (string.IsNullOrWhiteSpace(OrdenIdTextBox.Text) || OrdenIdTextBox.Text == "0") { paso = OrdenBLL.Guardar(ordenes); } else { if (!ExisteEnLaBaseDeDatos()) { MessageBox.Show("No se puede modificar una persona que no existe", "Fallo", MessageBoxButton.OK, MessageBoxImage.Error); return; } paso = OrdenBLL.Modificar(ordenes); } //Informar el resultado if (paso) { MessageBox.Show("Guardado!!", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("No fue posible guardar!!", "Fallo", MessageBoxButton.OK, MessageBoxImage.Error); } }
public void InsertarTest() { bool paso = false; Ordenes orden = new Ordenes(); OrdenesDetalle ordenesDetalle = new OrdenesDetalle(); orden.ordenId = 0; orden.suplidorId = 1; orden.fecha = DateTime.Now; orden.monto = 2500; ordenesDetalle.ordenDetalleId = 0; ordenesDetalle.ordenId = 0; ordenesDetalle.productId = 1; ordenesDetalle.producto = "Malta Morena"; ordenesDetalle.cantidad = 5; ordenesDetalle.costo = 500; orden.OrdenesDetalles.Add(ordenesDetalle); paso = OrdenBLL.Insertar(orden); Assert.AreEqual(paso, true); }
private bool ExisteEnLaBaseDeDatos() { Ordenes ordenes = OrdenBLL.Buscar(Convert.ToInt32(idTextBox.Text)); return(ordenes != null); }
protected void Button1_Click(object sender, EventArgs e) { OrdenBLL ordBLL = new OrdenBLL(); //ordBLL.creaOrden(); if (Session["numero_boleta"] == null) { } else if (Session["numero_boleta"] != null && GridView1.Rows.Count > 0) { string faltaStock = ""; foreach (GridViewRow row in GridView1.Rows) { int id = int.Parse(row.Cells[1].Text); string cat = row.Cells[3].Text; if (cat != "bebible") { PlatoBLL plaBLL = new PlatoBLL(); int stockactual = plaBLL.verificaStock(id); int stockSolicitado = int.Parse(((TextBox)row.Cells[5].FindControl("TextBox1")).Text); if (stockactual < stockSolicitado) { faltaStock = faltaStock + row.Cells[2].Text + " Stock Actual: " + stockactual + "\\n "; } } else if (cat == "bebible") { BebestibleBLL bebesBLL = new BebestibleBLL(); int stockactual = bebesBLL.verificaStock(id); int stockSolicitado = int.Parse(((TextBox)row.Cells[5].FindControl("TextBox1")).Text); if (stockactual < stockSolicitado) { faltaStock = faltaStock + row.Cells[2].Text + " Stock Actual: " + stockactual + "\\n "; } } } if (faltaStock.Length <= 0) { bool check = ordBLL.creaOrden(int.Parse(Session["numero_boleta"].ToString())); if (check) { foreach (GridViewRow row in GridView1.Rows) { int id = int.Parse(row.Cells[1].Text); int cantidad = int.Parse(((TextBox)row.Cells[5].FindControl("TextBox1")).Text); if (row.Cells[3].Text != "bebible") { PlatoBLL plBLL = new PlatoBLL(); plBLL.ingresaRelacion(id, cantidad); plBLL.reduceStock(id, cantidad); } else if (row.Cells[3].Text == "bebible") { BebestibleBLL bebBLL = new BebestibleBLL(); bebBLL.agregarRelacion(id, cantidad); bebBLL.reduceStock(id, cantidad); } } Session["pedido"] = null; Response.Redirect("/CarroCompras.aspx"); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('No se pudo Generar la orden: \\n Insuficiente Stock de: \\n" + faltaStock + " ')", true); } } }
private bool ExisteEnLaBaseDeDatos() { Orden ordenes = OrdenBLL.Buscar((int)OrdenIdTextBox.Text.ToInt()); return(ordenes != null); }
private bool ExisteBD() { orden = OrdenBLL.Buscar(Convert.ToInt32(OrdenIdTextBox.Text)); return(orden != null); }
private bool ExisteEnLaBaseDatos() { Orden orden = OrdenBLL.Buscar((int)Convert.ToInt32(ClienteIdTextbox.Text)); return(orden != null); }
public void ExisteTest() { bool existe = OrdenBLL.Existe(1); Assert.AreEqual(existe, false); }