Foros del Web » Programando para Internet » PHP »

Conversion ASP.net vb PHP

Estas en el tema de Conversion ASP.net vb PHP en el foro de PHP en Foros del Web. Estimados amigos del foro, quiero consultar si alguien sabe de alguna herramienta para convertir de ASP.net a PHP, o si alguien me puede dar una ...
  #1 (permalink)  
Antiguo 06/10/2010, 15:02
 
Fecha de Ingreso: octubre-2010
Mensajes: 1
Antigüedad: 13 años, 6 meses
Puntos: 0
Pregunta Conversion ASP.net vb PHP

Estimados amigos del foro, quiero consultar si alguien sabe de alguna herramienta para convertir de ASP.net a PHP, o si alguien me puede dar una mano pasando una pagina de ASP.net a PHP, les estare muy agradecido, es para completar mis horas sociales de la universidad,

Gracias de antemano,

Julian1228

Imports System.Data
Imports System.Data.Odbc
Imports System.Data.OleDb
Imports System.Data.DataSet
Imports System.Configuration
Partial Class Default2
Inherits System.Web.UI.Page
Dim nError As Integer
Dim connString As String
Dim sCicloRevisar As String
Protected Sub btnConsultar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnConsultar.Click
Refrescarnotas()
End Sub
Public Sub mostrar(ByVal bMostrar As Boolean)
Panel1.Visible = bMostrar
End Sub

Public Function bValidacion() As Boolean
bValidacion = True
Dim oOleDbConnection As New OleDbConnection(Me.connString)
Dim ssql As String = "SELECT * FROM expedientealumno WHERE carnet='" + txtcarnet.Text.ToUpper() + "'"
Dim cmd As New OleDbDataAdapter(ssql, oOleDbConnection)
Dim ds1 As New DataSet
Try
cmd.Fill(ds1, "a")
Catch ex As Exception
MsgBox(ex.Message)
End Try

If ds1.Tables("a").Rows.Count = 0 Then
bValidacion = False
nError = 101
Exit Function
End If

ssql = "SELECT * FROM notas As n WHERE n.carnet='" + txtcarnet.Text.ToUpper() + "' AND n.ciclo='" + Ciclo.Text + "/" + txtAno.Text + "'"
cmd = New OleDbDataAdapter(ssql, oOleDbConnection)
Dim ds2 As New Data.DataSet
cmd.Fill(ds2, "a")

If ds2.Tables("a").Rows.Count = 0 Then
ssql = "SELECT * FROM notash As n WHERE n.carnet='" + txtcarnet.Text.ToUpper() + "' AND n.ciclo='" + Ciclo.Text + "/" + txtAno.Text + "'"

cmd = New OleDbDataAdapter(ssql, oOleDbConnection)
Dim ds3 As New Data.DataSet
cmd.Fill(ds3, "a")

If ds3.Tables("a").Rows.Count = 0 Then
bValidacion = False
nError = 107

Exit Function
Else
sCicloRevisar = "V"
End If
Else
sCicloRevisar = "A"
End If

Dim dSaldoObligaciones As Decimal
Dim dSaldoOblihist As Decimal

ssql = "Select (sum(cargos)-sum(abonos)) as Deuda from obligaciones Where carnet='" + txtcarnet.Text.ToUpper() + "' and " & _
" (year(Fecha_vencimiento)<" + Str(Year(Today)) + " OR " & _
" (year(fecha_vencimiento)=" + Str(Year(Today)) + " AND month(Fecha_vencimiento)<" + Str(Month(Today)) + ") OR " & _
" (year(fecha_vencimiento)=" + Str(Year(Today)) + " AND month(Fecha_vencimiento)=" + Str(Month(Today)) + " AND day(fecha_vencimiento)<" + Str(Day(Today)) + "))"

cmd = New OleDbDataAdapter(ssql, oOleDbConnection)
Dim ds As New DataSet
cmd.Fill(ds, "a")

If ds.Tables("a").Rows.Count > 0 Then
'Valido que no sea null
If ds.Tables("a").Rows(0)(0) Is DBNull.Value Then
dSaldoObligaciones = 0
Else
dSaldoObligaciones = ds.Tables("a").Rows(0)(0)
End If
End If

Dim ssqlnew As String
ssqlnew = "Select (sum(o_cargos)-sum(o_abonos)) as Deuda from oblihist Where o_car='" + txtcarnet.Text.ToUpper() + "'"
Dim dtdeuda As New DataSet

cmd = New OleDbDataAdapter(ssqlnew, oOleDbConnection)
Try
cmd.Fill(dtdeuda, "deuda")
Catch ex As Exception
MsgBox(ex.Message)
End Try

If dtdeuda.Tables("deuda").Rows.Count > 0 Then
'Valido que no sea null
If dtdeuda.Tables(0).Rows(0)(0) Is DBNull.Value Then
dSaldoOblihist = 0
Else
dSaldoOblihist = dtdeuda.Tables(0).Rows(0)(0)
End If
End If

If dSaldoObligaciones + dSaldoOblihist > 0 Then
bValidacion = False
nError = 103
Exit Function
End If

End Function
Sub ErrorShow(ByVal nError As Integer)
Select Case nError
Case 101 : lblMensajeError.Text = "!! El Número de carnet es incorrecto.¡¡"
Case 102 : lblMensajeError.Text = "!! El Ciclo que ingreso es incorrecto.¡¡"
Case 103 : lblMensajeError.Text = "!! El Alumno no esta solvente de pago.¡¡"
Case 104 : lblMensajeError.Text = "!! No existe ningún registro de alumnos.¡¡"
Case 105 : lblMensajeError.Text = "!! Asegurese de ingresar el carnet o bien el ciclo correctamente.¡¡"
Case 107 : lblMensajeError.Text = "!! No existen datos en la tabla de notas.¡¡"
End Select
Me.lblMensajeError.Visible = True
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim i As Integer
For i = Year(Today) To 1979 Step -1
txtAno.Items.Add(i)
Next i

If Month(Now) = 1 Then
Ciclo.SelectedIndex = 1
Else

If Month(Now) > 1 And Month(Now) < 8 Then
Ciclo.SelectedIndex = 2
Else
Ciclo.SelectedIndex = 3
End If
End If
End If
connString = ConfigurationManager.ConnectionStrings("Connection Stringupes").ConnectionString
End Sub

Protected Sub BtnLimpiar_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Panel1.Visible = False
Me.txtcarnet.Text = ""
End Sub

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

End Sub

Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
RefrescarNotas()
End Sub

Public Sub RefrescarNotas()
Try
lblMensajeError.Text = ""
lblNombre.Text = ""
lblCarrera.Text = ""

If Not bValidacion() Then
lblMensajeError.Visible = True
mostrar(False)
ErrorShow(nError)
Exit Sub
End If

Dim sSql33 As String
If sCicloRevisar = "A" Then
sSql33 = "SELECT " & _
"e.nombres +' '+ e.apellido1 +' '+ e.apellido2 +' '+ e.apellcasada as alumno, " & _
"n.carnet, e.cumgeneral, c.nombre as carrera, n.ciclo," & _
"n.codigo_asi, a.nombre, n.seccion, n.matricula, "n.nota1 as nota1, n.nota2 as nota2, n.nota3 as nota3, n.nota4 as nota4," & _
"n.promedio as promedio, t.nombre as ntipoins " & _
"FROM notas AS n, tipoinscripcionmaterias AS t, " & _
"asignatura AS a, expedientealumno AS e, " & _
"carrera AS c WHERE n.carnet='" + txtcarnet.Text.ToUpper().ToUpper() + "' AND n.ciclo='" + Ciclo.Text + "/" + txtAno.Text + "' " AND n.tipo_ins=t.codigo AND n.codigo_asi=a.codigo " & _
" AND n.carnet=e.carnet and e.codcarrera=c.codigo_carrera" & _
" ORDER BY n.Promedio DESC"
Else
sSql33 = "SELECT " & _
"e.nombres +' '+ e.apellido1 +' '+ e.apellido2 +' '+ e.apellcasada as alumno, n.carnet, e.cumgeneral, c.nombre as carrera, n.ciclo, "n.codigo_asi, a.nombre, n.seccion, n.matricula, n.nota1 as nota1, "n.nota2 as nota2, n.nota3 as nota3, n.nota4 as nota4, n.promedio as promedio, t.nombre as ntipoins " & _
"FROM notash AS n, tipoinscripcionmaterias AS t, "asignatura AS a, expedientealumno AS e, carrera AS c WHERE n.carnet='" + txtcarnet.Text.ToUpper() + "' " AND n.ciclo='" + Ciclo.Text + "/" + txtAno.Text + "' " & _
" AND n.tipo_ins=t.codigo AND n.codigo_asi=a.codigo " & _
" AND n.carnet=e.carnet and e.codcarrera=c.codigo_carrera" & _
" ORDER BY n.Promedio DESC"
End If

Dim oOleDbConnection As New OleDbConnection(connString)
Dim cmd As New OleDbDataAdapter(sSql33, oOleDbConnection)
Dim ds As New DataSet

cmd.Fill(ds, "33")

If ds.Tables("33").Rows.Count > 0 Then
lblNombre.Text = ds.Tables("33").Rows(0)("alumno").ToString
lblCarrera.Text = ds.Tables("33").Rows(0)("carrera").ToString
lblCum.Text = ds.Tables("33").Rows(0)("CumGeneral").ToString
mostrar(True)
End If

GridView1.DataSource = ds.Tables("33").DefaultView
GridView1.DataBind()
Catch ex As Exception
Dim er As String = ex.ToString
End Try
End Sub
End Class
  #2 (permalink)  
Antiguo 06/10/2010, 15:11
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Tema movido desde PHP orientado a objetos a PHP
  #3 (permalink)  
Antiguo 06/10/2010, 15:32
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 8 meses
Puntos: 1532
Respuesta: Conversion ASP.net vb PHP

podrás conseguir una que te lo pase a C#, pero a php me parece casi imposible, PHP es completamente diferente a ASP.net, para emprezar, no tiene mecanismos de web forms, ni datagrid, no hay datasets, dataadapters, etc. todo lo tienes que hacer manualmente, a excepción de que uses un framework php, pero incluso así todo es absolutamente diferente, practicante tendrás que hacer un sistema nuevo.
__________________
¡Por favor!: usa el highlight para mostrar código
El que busca, encuentra...

Etiquetas: asp, conversion, aspx
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:50.