protected void imbFinalizado_Click(object sender, ImageClickEventArgs e)
    {
        Funciones  objeto    = new Funciones();
        SqlCommand comando   = new SqlCommand();
        string     variable  = rGCorreos.MasterTableView.Items[rGCorreos.SelectedIndexes[0].ToString()]["Cuenta"].Text;
        DateTime   fecha     = DateTime.Now;
        string     estado    = "Finalizado";
        int        nroPedido = Convert.ToInt32(rGCorreos.MasterTableView.Items[rGCorreos.SelectedIndexes[0].ToString()]["nroPedido"].Text);
        string     tipo      = rGCorreos.MasterTableView.Items[rGCorreos.SelectedIndexes[0].ToString()]["tipo"].Text;

        objeto.ArmarParametrosCopiaFielPlano(comando, variable, fecha, estado, nroPedido, tipo);
        objeto.EjecutarSp("SPagregarCopiaFielPlano", comando);
        string  origen = "*****@*****.**";
        string  destino;
        DataSet ds  = new DataSet();
        string  sql = "Select mail from PropietarioxCuenta where nroCuenta='" + variable + "'";

        objeto.agregar_tabla_dataset(sql, "mail", ds);
        destino = ds.Tables[0].Rows[0][0].ToString();
        try
        {
            enviarCorreo(origen, destino, "Finalizado");
        }
        catch
        {
            lblcartel.Text    = "El estado fue actualizado correctamente, pero no se logro enviar el correo electrónico al propietario";
            lblcartel.Visible = true;
        }
        Response.Redirect("./SolicitudesCopiaFiel.aspx");
    }
    protected void imbEntregado_Click(object sender, ImageClickEventArgs e)
    {
        Funciones  objeto    = new Funciones();
        SqlCommand comando   = new SqlCommand();
        string     variable  = rGCorreos.MasterTableView.Items[rGCorreos.SelectedIndexes[0].ToString()]["Cuenta"].Text;
        DateTime   fecha     = DateTime.Now;
        string     estado    = "Entregado";
        int        nroPedido = Convert.ToInt32(rGCorreos.MasterTableView.Items[rGCorreos.SelectedIndexes[0].ToString()]["nroPedido"].Text);
        string     tipo      = rGCorreos.MasterTableView.Items[rGCorreos.SelectedIndexes[0].ToString()]["tipo"].Text;

        objeto.ArmarParametrosCopiaFielPlano(comando, variable, fecha, estado, nroPedido, tipo);
        objeto.EjecutarSp("SPagregarCopiaFielPlano", comando);
        Response.Redirect("./SolicitudesCopiaFiel.aspx");
    }
예제 #3
0
    protected void guardarBase()
    {
        Funciones objeto = new  Funciones();
        DateTime  fecha  = DateTime.Now;
        DataSet   ds     = new DataSet();
        string    cuenta = Convert.ToString(Session["NroCuenta"]);
        string    estado = "Solicitado";
        int       nroPedido;
        string    tipo = "";
        string    sql  = "Select MAX(nroPedido)as cantidad from PedidoCopiaFiel where NroCuenta='" + cuenta + "'";

        objeto.agregar_tabla_dataset(sql, "Cantidad", ds);
        if (ds.Tables[0].Rows[0][0].ToString() == "")
        {
            nroPedido = 1;
        }
        else
        {
            nroPedido = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()) + 1;
        }
        SqlCommand comando = new SqlCommand();

        if (rb1.Checked == true)
        {
            tipo = "fisico";
        }
        else
        {
            if (rbDitigal.Checked == true)
            {
                tipo = "digital";
            }
        }
        string sql2 = "Update PropietarioxCuenta set mail='" + txtMail.Text + "' where nroDocumento='" + txtUsuario.Text + "'";

        objeto.Ejecutarconsulta2(sql2);
        objeto.ArmarParametrosCopiaFielPlano(comando, cuenta, fecha, estado, nroPedido, tipo);
        objeto.EjecutarSp("SPagregarCopiaFielPlano", comando);
    }