Example #1
0
    protected void btnContinuar_Click(object sender, EventArgs e)
    {
        DropDownList ddlEstatusAlmacen   = (DropDownList)FormView1.FindControl("ddlEstatusAlmacen");
        DropDownList lstEstatusPendiente = (DropDownList)FormView1.FindControl("lstEstatusPendiente");

        AdmPedidosPendientesVO VOPedidoPend = new AdmPedidosPendientesVO();
        AdmPedidosPendientesBL BLPedidoPend = new AdmPedidosPendientesBL();

        VOPedidoPend.SeriePedido            = lblSerie.Text;
        VOPedidoPend.FolioPedido            = Int32.Parse(lblFolio.Text);
        VOPedidoPend.OficinaId              = Int32.Parse(Request["oficinaId"].ToString());
        VOPedidoPend.Mensaje                = txtMensaje.Text.Trim();
        VOPedidoPend.EstatusPedidoAlmacenId = Int32.Parse(ddlEstatusAlmacen.SelectedItem.Value);
        VOPedidoPend.EstatusPendienteId     = Int32.Parse(lstEstatusPendiente.SelectedItem.Value);
        VOPedidoPend.UsuarioId              = Int32.Parse(Session["usuarioID"].ToString());
        VOPedidoPend           = (AdmPedidosPendientesVO)BLPedidoPend.execute(VOPedidoPend);
        VOPedidoPend.Operacion = AdmPedidosPendientesVO.INSERTAR;
        VOPedidoPend           = (AdmPedidosPendientesVO)BLPedidoPend.execute(VOPedidoPend);
        if (VOPedidoPend.Resultado == 0)
        {
            lblMensaje.Text = "CAMBIO APLICADO";
        }
        else
        {
            lblMensaje.Text = "Cambio NO aplicado";
        }
        ddlEstatusAlmacen.Dispose();
        lstEstatusPendiente.Dispose();
        lblMensaje.ForeColor = Color.FromName("#990000");
        lblMensaje.BackColor = Color.FromName("#E0E0E0");
        lblMensaje.Font.Bold = true;
    }
    //private set_insertaDatosPedidosPendientesPrincipalTableAdapter setPedidosPendientesPrincipal = new set_insertaDatosPedidosPendientesPrincipalTableAdapter();

    //private DataTable datos = null;

    public Object execute(Object O)
    {
        VOReg = (AdmPedidosPendientesVO)O;

        if (VOReg.Operacion == AdmPedidosPendientesVO.ACTUALIZAR)
        {
            return(actualizaPedidosSeguimiento());
        }
        else if (VOReg.Operacion == AdmPedidosPendientesVO.INSERTAR)
        {
            return(insertaPedidosSeguimiento());
        }
        else if (VOReg.Operacion == AdmPedidosPendientesVO.BUSCAR)
        {
            return(buscarPedidosSeguimiento());
        }
        return(VOReg);
    }