Beispiel #1
0
        public UuserReservas canje(DataTable tabla)
        {
            DUser         data = new DUser();
            UuserReservas dato = new UuserReservas();

            int sum = 0;
            int p   = 0;

            foreach (DataRow fila in tabla.Rows)
            {
                string punto = tabla.Rows[0]["puntos"].ToString();
                p   = int.Parse(punto);
                sum = p;
            }
            dato.Cant = sum;

            if (sum < 100)
            {
                dato.Est1 = true;
                dato.Est2 = false;
            }
            else
            {
                dato.Est1 = false;
                dato.Est2 = true;
            }
            return(dato);
        }
    protected void B_guardar_Click(object sender, EventArgs e)
    {
        UuserReservas       dato   = new UuserReservas();
        UPreserva           datos  = new UPreserva();
        LUser               doc    = new LUser();
        L_Persistencia      dac    = new L_Persistencia();
        ClientScriptManager cm     = this.ClientScript;
        string              nombre = Session["usuario"].ToString();

        System.Data.DataTable validez1 = doc.obteberidres(nombre); //duda aca con doc
        Int32        id_reserva        = int.Parse(validez1.Rows[0]["id_reserva"].ToString());
        Button       btn     = (Button)sender;
        DataListItem item    = (DataListItem)btn.NamingContainer;
        TextBox      guardar = (TextBox)item.FindControl("TB_insertarPedido");

        datos.Cantidad = int.Parse(guardar.Text);
        Label lblid = (Label)item.FindControl("LB_idPlatos");

        datos.Id_plato      = int.Parse(lblid.Text);
        datos.Id_reserva    = id_reserva;
        datos.Fecha_ingreso = DateTime.Now;
        //datos.Fecha_despacho = DateTime.Parse(null);

        dac.insertarPlatoR(datos);
        // doc.insertarplares(dato);
        String mens = Session["men"].ToString();

        cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('" + mens.ToString() + "');</script>");
    }
Beispiel #3
0
        public DataTable insertarplares(UuserReservas plato)
        {
            DUser     dato = new DUser();
            DataTable data = dato.Insertarpreserva(plato);

            return(data);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
        Response.Cache.SetAllowResponseInBrowserHistory(false);
        Response.Cache.SetNoStore();



        int       Id    = int.Parse(Session["user_id"].ToString());
        LUser     dao   = new LUser();
        DataTable tabla = new DataTable();

        int id_usuario = int.Parse(Session["user_id"].ToString());

        GridView1.DataSource = dao.obtenerReservas(id_usuario);
        GridView1.DataBind();



        tabla = dao.obtenerPuntos(Id);
        //DataTable obtepuntos = dao.canje(id_usuario, Id);
        UuserReservas dato = dao.canje(tabla);

        LB_puntos.Text    = dato.Cant.ToString();
        Label5.Visible    = dato.Est1;
        DataList1.Visible = dato.Est2;
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UuserReservas datos      = new UuserReservas();
        Luser         user       = new Luser();
        int           id_usuario = int.Parse(Session["user_id"].ToString());

        // GV_misreservas.DataSource = user.obtenerMisReservas(id_usuario);
        //GV_misreservas.DataBind();
    }
    protected void DataList1_SelectedIndexChanged(object sender, DataListCommandEventArgs e)
    {
        UuserReservas pla  = new UuserReservas();
        LUser         inse = new LUser();

        //DataTable registro = inse.Insertarpreserva();


        int res = Convert.ToInt32(DL_menuReser.DataKeys[e.Item.ItemIndex].ToString());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
        Response.Cache.SetAllowResponseInBrowserHistory(false);
        Response.Cache.SetNoStore();

        Int32   FORMULARIO = 1;
        LIdioma idioma     = new LIdioma();
        UIdioma com        = new UIdioma();
        Int32   DDL;

        try
        {
            DDL = int.Parse(Session["ddl"].ToString());
        }
        catch
        {
            DDL = 1;
        }

        DataTable info       = idioma.obtenerControl(FORMULARIO, DDL);
        Hashtable compIdioma = new Hashtable();

        Session["mensajes"] = compIdioma;
        compIdioma          = idioma.hastableIdioma(info, compIdioma);
        L_PuntosR.Text      = compIdioma["L_PuntosR"].ToString();
        L_cantPuntos.Text   = compIdioma["L_cantPuntos"].ToString();
        L_puntosInsu.Text   = compIdioma["L_puntosInsu"].ToString();
        L_Historial.Text    = compIdioma["L_Historial"].ToString();
        BT_Regresar.Text    = compIdioma["BT_Regresar"].ToString();
        GV_Historial.Columns[0].HeaderText = compIdioma["LB_Mesa"].ToString();
        GV_Historial.Columns[1].HeaderText = compIdioma["LB_Dia"].ToString();
        DL_canje.DataBind();
        Session["men"] = compIdioma["JS_canje"].ToString();

        int            Id         = int.Parse(Session["user_id"].ToString());
        LUser          dao        = new LUser();
        DataTable      tabla      = new DataTable();
        L_Persistencia data       = new L_Persistencia();
        int            id_usuario = int.Parse(Session["user_id"].ToString());

        GV_Historial.DataSource = data.listadeReservas(id_usuario);
        GV_Historial.DataBind();

        DataTable inter = data.ToDataTable(data.listadePuntos(Id));
        //tabla = data.listadePuntos(Id);
        UuserReservas dato = dao.canje(inter);

        LB_puntos.Text       = inter.Rows[0]["puntos"].ToString();
        L_puntosInsu.Visible = dato.Est1;
        DL_canje.Visible     = dato.Est2;
    }
    protected void B_guardar_Click(object sender, EventArgs e)
    {
        UuserReservas       dato   = new UuserReservas();
        LUser               doc    = new LUser();
        ClientScriptManager cm     = this.ClientScript;
        string              nombre = Session["usuario"].ToString();

        System.Data.DataTable validez1 = doc.obteberidres(nombre);
        Int32        id_reserva        = int.Parse(validez1.Rows[0]["id_reserva"].ToString());
        Button       btn     = (Button)sender;
        DataListItem item    = (DataListItem)btn.NamingContainer;
        TextBox      guardar = (TextBox)item.FindControl("TB_insertarPedido");

        dato.Cant = int.Parse(guardar.Text);
        Label lblid = (Label)item.FindControl("Label1");

        dato.Id_plato   = int.Parse(lblid.Text);
        dato.Id_reserva = id_reserva;

        doc.insertarplares(dato);
        cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('Pedido insertado con exito');</script>");
    }