/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnActualizar_Click(object sender, EventArgs e) { if (Valida()) { Int32 informacion = 0; N_Inventario obj = new N_Inventario(); informacion = obj.updtInventario(Convert.ToInt32(Session["Row"].ToString()), txtNombre.Text, TxtDescripcion.Text, Txtcosto.Text, Txtcantidad.Text, TxtClave.Text, Convert.ToInt32(ddlEstado.SelectedIndex) == 2 ? 0 : 1); if (informacion == 1) { popUpMensajeAplicacion(1, "Información guardada con éxito; =)"); } else { popUpMensajeAplicacion(2, "Se presentó un problema al guardar la información, Por Favor revisa e intenta de nuevo; =("); } } cargaProducto(); }
/// <summary> /// Guarda el producto en la bd /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnGuardar_Click(object sender, EventArgs e) { if (Valida()) { Int32 informacion = 0; N_Inventario obj = new N_Inventario(); informacion = obj.AddProducto(txtNombre.Text, TxtDescripcion.Text, Txtcosto.Text, Convert.ToInt32(Txtcantidad.Text), TxtClave.Text); if (informacion == 1) { popUpMensajeAplicacion(2, "Se presentó un problema al guardar la información, Por Favor revisa e intenta de nuevo; =("); } else { popUpMensajeAplicacion(1, "Información guardada con éxito; =)"); } } }
/// <summary> /// Carga los datos del producto seleccionado /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ddlProducto_SelectedIndexChanged(object sender, EventArgs e) { DataSet producto = new DataSet(); N_Inventario ob = new N_Inventario(); producto = ob.getProductoById(Convert.ToInt32(ddlProducto.SelectedItem.Value)); //popup Ventas txtVentaNombre.Text = producto.Tables[0].Rows[0]["nombre"].ToString(); TxtFechaVenta.Text = DateTime.Now.ToShortDateString(); TxtVentaDescripcion.Text = producto.Tables[0].Rows[0]["descripcion"].ToString(); txtVentaCosto.Text = producto.Tables[0].Rows[0]["costo"].ToString(); txtVentaCantidad.Text = "1";//producto.Tables[0].Rows[0]["existencia"].ToString(); lblExistencias.Text = producto.Tables[0].Rows[0]["existencia"].ToString(); txtTotalVenta.Text = (Convert.ToDecimal(txtVentaCosto.Text) * Convert.ToDecimal(txtVentaCantidad.Text)).ToString(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnEliminar_Click(object sender, EventArgs e) { if (Valida()) { Int32 informacion = 0; N_Inventario ob = new N_Inventario(); informacion = ob.DelProducto(Convert.ToInt32(Session["Row"].ToString())); if (informacion == 1) { popUpMensajeAplicacion(2, "Se presentó un problema al guardar la información, Por Favor revisa e intenta de nuevo; =("); } else { popUpMensajeAplicacion(1, "Información guardada con éxito; =)"); } } cargaProducto(); }