Esempio n. 1
0
        protected void btnEliminar_Click(object sender, EventArgs e)
        {
            if (txtIDProducto.Text == "")
            {
                lblMensaje.Text = "Debe ingresar un ID de Producto";
                txtIDProducto.Focus();
                return;
            }

            if (!ClassLibrary1.CADProducto.ExisteProducto(txtIDProducto.Text))
            {
                lblMensaje.Text = "Producto no existe";
                txtIDProducto.Focus();
                return;
            }
            lblMensaje.Text = ClassLibrary1.CADProducto.BorrarProducto(txtIDProducto.Text);

            //LimpiarForm de cliente
            txtIDProducto.Text  = "";
            txtDescripcion.Text = "";
            txtPrecio.Text      = "";
            txtStock.Text       = "";
            txtNotas.Text       = "";


            //Para actualizar la cuadricula de clientes
            GVProductos.DataBind();
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         GVProductos.DataSource = SqlDataSourceBuscaProductosByName;
         GVProductos.DataBind();
         GridSku.DataSource = SqlDataSourceSelectSKUGrid;
         GridSku.DataBind();
     }
 }
Esempio n. 3
0
        protected void BtnConsultar_Click(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsValid)
                {
                    List <Producto> productos;

                    productos = LogicaNegocio.Logistica.ListarProductos().GetAwaiter().GetResult().FindAll(x => x.Nombre.Contains(TxtNombre.Text));
                    GVProductos.DataSource = productos;
                    GVProductos.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["id"] != null)
        {
            Orden o = new Orden();
            Orden_Productos_Carro opc = new Orden_Productos_Carro();
            int id_orden = int.Parse(Request.QueryString["id"]);
            opc.LoadByOrderId(id_orden);
            this.LabelTotal.Text    = "0";
            this.LEstado.Text       = opc.Nombre_estado;
            this.LDestinatario.Text = opc.Destinatario;
            this.LDistribuidor.Text = opc.Nombre_distribuidor;
            this.LProveedor.Text    = opc.Nombre_proveedor;
            this.LDireccion.Text    = opc.Direccion_entrega;
            this.LTelefono.Text     = opc.Telefono;
            this.LEntrega.Text      = opc.Nombre_envio;
            this.LFecha.Text        = opc.Fecha.ToString();
            this.LNoOrden.Text      = opc.No_orden + "";
            this.LComentario.Text   = opc.Comentario;

            GVProductos.DataSource = opc.ObjectDataSourceProductos(id_orden);
            GVProductos.DataBind();
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["error_message"] != "")
        {
            this.LError.Text = Request.QueryString["error_message"];
        }
        MyShoppingCart sc = (MyShoppingCart)Session["shopping_cart"];
        bool           m  = (sc != null && sc.Total_productos > 0);

        this.LBEliminar.Visible = m;
        this.LBSeguir.Visible   = m;
        this.LAnuncio.Visible   = !m;
        this.IBComprar.Visible  = m;
        this.IBSalvar.Visible   = m;
        if (!IsPostBack)
        {
            if (m)
            {
                GVProductos.DataSource = sc.DefaultView;
                GVProductos.DataBind();
                this.LabelTotal.Text = "Total a pagar: $ " + UsefullProc.FormatoPrecio(sc.Precio_total);
            }
        }
    }
Esempio n. 6
0
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     GVProductos.DataSource = SqlDataSourceBuscaProductosByName;
     GVProductos.DataBind();
 }
Esempio n. 7
0
        protected void btnNuevo_Click(object sender, EventArgs e)
        {
            if (txtIDProducto.Text == "")
            {
                lblMensaje.Text = "Debe ingresar un ID de Producto";
                txtIDProducto.Focus();
                return;
            }

            if (ClassLibrary1.CADProducto.ExisteProducto(txtIDProducto.Text))
            {
                lblMensaje.Text = "Producto ya existe";
                txtIDProducto.Focus();
                return;
            }
            if (txtDescripcion.Text == "")
            {
                lblMensaje.Text = "Debe ingresar una Descripcion para el producto";
                txtDescripcion.Focus();
                return;
            }
            if (txtPrecio.Text == "")
            {
                lblMensaje.Text = "Debe ingresar un precio para el Producto";
                txtPrecio.Focus();
                return;
            }
            if (!Utilidades.isNumeric(txtPrecio.Text))
            {
                lblMensaje.Text = "Debe ingresar un valor numerico en el Precio del Producto";
                txtPrecio.Focus();
                return;
            }
            if (Convert.ToDouble(txtPrecio.Text) <= 0)
            {
                lblMensaje.Text = "Debe ingresar un Precio mayor que (0)";
                txtPrecio.Focus();
                return;
            }
            if (txtStock.Text == "")
            {
                lblMensaje.Text = "Debe ingresar un stock para el Producto";
                txtStock.Focus();
                return;
            }
            if (!Utilidades.isNumeric(txtStock.Text))
            {
                lblMensaje.Text = "Debe ingresar un valor numerico en el Stock del Producto";
                txtStock.Focus();
                return;
            }
            if (Convert.ToDouble(txtStock.Text) <= 0)
            {
                lblMensaje.Text = "Debe ingresar un stock positivo";
                txtStock.Focus();
                return;
            }
            lblMensaje.Text = ClassLibrary1.CADProducto.NuevoProducto(txtIDProducto.Text, txtDescripcion.Text,
                                                                      Convert.ToDecimal(txtPrecio.Text), Convert.ToInt32(txtStock.Text), txtNotas.Text);

            //Para actualizar la cuadricula de clientes
            GVProductos.DataBind();
        }