Commit inicial Ventas Productivo
This commit is contained in:
850
OI/Desarrollo.aspx.vb
Normal file
850
OI/Desarrollo.aspx.vb
Normal file
@@ -0,0 +1,850 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
|
||||
|
||||
|
||||
Partial Class OI_Desarrollo
|
||||
Inherits ClsPaginas
|
||||
|
||||
Property CveEvento As Integer
|
||||
Get
|
||||
If ViewState("CveEvento") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveEvento"), Integer)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEvento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property CveDesarrollo As Integer
|
||||
Get
|
||||
If ViewState("CveDesarrollo") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveDesarrollo"), Integer)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveDesarrollo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'CveDesarrolloDetalle
|
||||
Property CveDesarrolloDetalle As Integer
|
||||
Get
|
||||
If ViewState("CveDesarrolloDetalle") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveDesarrolloDetalle"), Integer)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("CveDesarrolloDetalle") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property CveDesarrolloDetalleTipo As Integer
|
||||
Get
|
||||
If ViewState("CveDesarrolloTareaTipo") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveDesarrolloTareaTipo"), Integer)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("CveDesarrolloTareaTipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property DesarrolloDetalleTipo As String
|
||||
Get
|
||||
If ViewState("DesarrolloTareaTipo") Is Nothing Then
|
||||
Return "-1"
|
||||
Else
|
||||
Return ViewState("DesarrolloTareaTipo").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("DesarrolloTareaTipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property CveUsuarioResponsable As Integer
|
||||
Get
|
||||
If ViewState("CveUsuarioResponsable") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveUsuarioResponsable"), Integer)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("CveUsuarioResponsable") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property CveUsuarioAsignado As Integer
|
||||
Get
|
||||
If ViewState("CveUsuarioAsignado") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveUsuarioAsignado"), Integer)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("CveUsuarioAsignado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property CveUsuarioPruebas As Integer
|
||||
Get
|
||||
If ViewState("CveUsuarioPruebas") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveUsuarioPruebas"), Integer)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("CveUsuarioPruebas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property Bloquear As Boolean
|
||||
Get
|
||||
If ViewState("Bloquear") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return DirectCast(ViewState("Bloquear"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Boolean)
|
||||
ViewState("Bloquear") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#Region "Adjunto"
|
||||
Property CveDesarrolloAdjunto As Integer
|
||||
Get
|
||||
If ViewState("CveDesarrolloAdjunto") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveDesarrolloAdjunto"), Integer)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("CveDesarrolloAdjunto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property DesarrolloAdjunto As String
|
||||
Get
|
||||
If ViewState("DesarrolloAdjunto") Is Nothing Then
|
||||
Return "-1"
|
||||
Else
|
||||
Return ViewState("DesarrolloAdjunto").ToString
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As String)
|
||||
ViewState("DesarrolloAdjunto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property DesarrolloAdjuntoArchivo As String
|
||||
Get
|
||||
If ViewState("DesarrolloAdjuntoArchivo") Is Nothing Then
|
||||
Return "-1"
|
||||
Else
|
||||
Return ViewState("DesarrolloAdjuntoArchivo").ToString
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As String)
|
||||
ViewState("DesarrolloAdjuntoArchivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub OI_Desarrollo_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
|
||||
CargaCombos()
|
||||
|
||||
If Request.QueryString("CveEvento") <> Nothing Then
|
||||
CveEvento = Request.QueryString("CveEvento").ToEntero
|
||||
Else
|
||||
CveEvento = -1
|
||||
End If
|
||||
|
||||
If Request.QueryString("CveDesarrollo") <> Nothing Then
|
||||
|
||||
CveDesarrollo = Request.QueryString("CveDesarrollo").ToEntero
|
||||
CargaDesarrollo()
|
||||
CargaDesarrolloDetalles()
|
||||
CargaAdjuntos()
|
||||
|
||||
DVPruebas.Visible = True
|
||||
DVFormatoTecnico.Visible = True
|
||||
DVAdjuntos.Visible = True
|
||||
DVAsignacion.Visible = True
|
||||
LnkGuardar.Text = "Actualizar"
|
||||
|
||||
LnkWizard.Visible = True
|
||||
LnkWizard.PostBackUrl = $"./DesarrolloWizard.aspx?CveDesarrollo={CveDesarrollo}"
|
||||
|
||||
If Bloquear Then
|
||||
BloquearTodo()
|
||||
End If
|
||||
|
||||
Else
|
||||
CveDesarrollo = -1
|
||||
DVPruebas.Visible = False
|
||||
DVFormatoTecnico.Visible = False
|
||||
DVAdjuntos.Visible = False
|
||||
DVAsignacion.Visible = False
|
||||
LnkGuardar.Text = "Guardar"
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub CargaDesarrollo()
|
||||
|
||||
If CveDesarrollo > 0 Then
|
||||
|
||||
Dim objDesarrolo As New ClsDesarrollo
|
||||
|
||||
If objDesarrolo.DesarrolloGet(CveDesarrollo, -1, -1, -1, -1, -1, "-1", -1, -1, -1) Then
|
||||
|
||||
If objDesarrolo.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
TxtDesarrollo.Text = objDesarrolo.DtResultados(0)("Desarrollo").ToString
|
||||
LblTitulo.Text = $"Desarrollo: {objDesarrolo.DtResultados(0)("Desarrollo").ToString}"
|
||||
UpTitulo.Update()
|
||||
|
||||
TxtDescripcion.Text = objDesarrolo.DtResultados(0)("Descripcion").ToString
|
||||
CveUsuarioResponsable = objDesarrolo.DtResultados(0)("CveUsuarioResponsable").ToString.ToEntero
|
||||
CveUsuarioAsignado = objDesarrolo.DtResultados(0)("CveUsuarioAsignado").ToString.ToEntero
|
||||
CveUsuarioPruebas = objDesarrolo.DtResultados(0)("CveUsuarioPruebas").ToString.ToEntero
|
||||
|
||||
If Not objDesarrolo.DtResultados(0)("CveUsuarioAsignado").ToString = "" Then
|
||||
DdlUsuarioDes.SelectedValueExist(objDesarrolo.DtResultados(0)("CveUsuarioAsignado").ToString.ToEntero)
|
||||
End If
|
||||
|
||||
If Not objDesarrolo.DtResultados(0)("CveUsuarioPruebas").ToString = "" Then
|
||||
DdlUsuarioPruebas.SelectedValueExist(objDesarrolo.DtResultados(0)("CveUsuarioPruebas").ToString.ToEntero)
|
||||
End If
|
||||
|
||||
DdlModulo.SelectedValueExist(objDesarrolo.DtResultados(0)("CveModulo").ToString.ToEntero)
|
||||
TxtTiempoEstimado.Text = objDesarrolo.DtResultados(0)("TiempoEstimado").ToString
|
||||
' DdlEstado.SelectedValueExist(objDesarrolo.DtResultados(0)("CveDesarrolloEstado").ToString)
|
||||
ChkFManual.Checked = If(Boolean.Parse(objDesarrolo.DtResultados(0)("Manual").ToString), True, False)
|
||||
|
||||
If UsuarioActual.CveUsuario <> objDesarrolo.DtResultados(0)("CveUsuarioResponsable").ToString.ToEntero Then
|
||||
Bloquear = True
|
||||
Else
|
||||
Bloquear = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
objDesarrolo.Dispose()
|
||||
Else
|
||||
DdlUsuarioPruebas.SelectedValueExist(UsuarioActual.CveUsuario)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub BloquearTodo()
|
||||
|
||||
LnkGuardar.Visible = False
|
||||
'UpGuardar.Update()
|
||||
|
||||
|
||||
For Each GvRow As GridViewRow In GvAdjuntos.Rows
|
||||
GvRow.FCLinkButton("imgE").Visible = False
|
||||
GvRow.FCLinkButton("ImgD").Visible = False
|
||||
Next
|
||||
LnkAgregarAdjunto.Visible = False
|
||||
|
||||
For Each GvRow As GridViewRow In GvFTTareas.Rows
|
||||
GvRow.FCLinkButton("imgE").Visible = False
|
||||
GvRow.FCLinkButton("ImgD").Visible = False
|
||||
Next
|
||||
LnkAgregarTarea.Visible = False
|
||||
|
||||
|
||||
For Each GvRow As GridViewRow In GvFTTareas.Rows
|
||||
GvRow.FCLinkButton("imgE").Visible = False
|
||||
GvRow.FCLinkButton("ImgD").Visible = False
|
||||
Next
|
||||
LnkAgregarTarea.Visible = False
|
||||
|
||||
|
||||
For Each GvRow As GridViewRow In GvFTComprobaciones.Rows
|
||||
GvRow.FCLinkButton("imgE").Visible = False
|
||||
GvRow.FCLinkButton("ImgD").Visible = False
|
||||
Next
|
||||
LnkAgregarComprovaciones.Visible = False
|
||||
|
||||
For Each GvRow As GridViewRow In GvFTRecomendaciones.Rows
|
||||
GvRow.FCLinkButton("imgE").Visible = False
|
||||
GvRow.FCLinkButton("ImgD").Visible = False
|
||||
Next
|
||||
LnkAgregarRecomendaciones.Visible = False
|
||||
|
||||
For Each GvRow As GridViewRow In GvPruebasBasicas.Rows
|
||||
GvRow.FCLinkButton("imgE").Visible = False
|
||||
GvRow.FCLinkButton("ImgD").Visible = False
|
||||
Next
|
||||
LnkAgregarPruebaBasica.Visible = False
|
||||
|
||||
|
||||
For Each GvRow As GridViewRow In GvPruebaspecificas.Rows
|
||||
GvRow.FCLinkButton("imgE").Visible = False
|
||||
GvRow.FCLinkButton("ImgD").Visible = False
|
||||
Next
|
||||
LnkAgregarPruebaEspecifica.Visible = False
|
||||
|
||||
|
||||
'GvFTComprobaciones
|
||||
' UpAdjunto.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
DdlUsuarioDes.DataSource = GlobalDTUsuarios(-1, 2)
|
||||
DdlUsuarioDes.DataBind()
|
||||
DdlUsuarioDes.Items.Insert(0, New ListItem("Selecione uno", "-1"))
|
||||
|
||||
DdlUsuarioPruebas.DataSource = GlobalDTUsuarios(-1, 2)
|
||||
DdlUsuarioPruebas.DataBind()
|
||||
DdlUsuarioPruebas.Items.Insert(0, New ListItem("Selecione uno", "-1"))
|
||||
|
||||
DdlModulo.DataSource = GlobalDTModulos()
|
||||
DdlModulo.DataBind()
|
||||
DdlModulo.Items.Insert(0, New ListItem("Selecione uno", "-1"))
|
||||
|
||||
CargaComboEstados()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaComboEstados()
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
Dim DTEstados As New DataTable
|
||||
|
||||
If ObjDesarrollo.DesarrolloEstadosGet(1) Then
|
||||
|
||||
'DTEstados = ObjDesarrollo.DtResultados
|
||||
'DdlEstado.DataSource = DTEstados
|
||||
'DdlEstado.DataBind()
|
||||
'DdlEstado.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
End If
|
||||
DTEstados.Dispose()
|
||||
ObjDesarrollo.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub LnkGuardar_Click(sender As Object, e As EventArgs) Handles LnkGuardar.Click
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
Dim FechaTermino As Date = Nothing
|
||||
Dim Manual As Integer = If(ChkFManual.Checked, 1, 0)
|
||||
Dim FechaAsiganacion As Date = Nothing
|
||||
|
||||
|
||||
If CveDesarrollo = -1 Then
|
||||
|
||||
If ObjDesarrollo.DesarrolloAddUpdate(-1, TxtDesarrollo.Text.Trim, CveEvento, UsuarioActual.CveUsuario, DdlUsuarioPruebas.SelectedValue.ToEntero, DdlModulo.SelectedValue.ToEntero, TxtDescripcion.Text, DdlUsuarioDes.SelectedValue.ToEntero, Nothing, TxtTiempoEstimado.Text.ToEntero, 1, Manual, UsuarioActual.CveUsuario) Then
|
||||
CveDesarrollo = ObjDesarrollo.DtResultados(0)(0).ToString.ToEntero
|
||||
Response.Redirect($"./Desarrollo.aspx?CveDesarrollo={CveDesarrollo}")
|
||||
' Alert("El desarrollo se agrego correctamente", TipoMensaje.MsgInformacion, $"href='.Desarrollo.aspx?CveDesarrollo={CveDesarrollo}'")
|
||||
Else
|
||||
Alert("Se presento un error al agregar el desarrollo", TipoMensaje.MsgError)
|
||||
End If
|
||||
Else
|
||||
Dim _CveEstadoTemp As Integer = -1
|
||||
If DdlUsuarioDes.SelectedValue.ToEntero <> CveUsuarioAsignado Then
|
||||
FechaAsiganacion = Now
|
||||
_CveEstadoTemp = 2
|
||||
End If
|
||||
|
||||
If ObjDesarrollo.DesarrolloAddUpdate(CveDesarrollo, TxtDesarrollo.Text.Trim, CveEvento, UsuarioActual.CveUsuario, DdlUsuarioPruebas.SelectedValue.ToEntero, DdlModulo.SelectedValue.ToEntero, TxtDescripcion.Text, DdlUsuarioDes.SelectedValue.ToEntero, FechaAsiganacion, TxtTiempoEstimado.Text.ToEntero, _CveEstadoTemp, Manual, UsuarioActual.CveUsuario, FechaTermino) Then
|
||||
Alert("El desarrollo se actualizo correctamente.")
|
||||
Else
|
||||
Alert("Se presento un error al actualizar el desarrollo", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
If CveDesarrollo > 0 Then
|
||||
|
||||
End If
|
||||
|
||||
ObjDesarrollo.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MuestraModalformatoTecnico(Tipo As Integer)
|
||||
|
||||
CveDesarrolloDetalle = -1
|
||||
LnkModalHojaTecnica.Text = "Guardar"
|
||||
|
||||
Select Case Tipo
|
||||
Case 1
|
||||
LtlTituloModalHojaTecnica.Text = "Agregar Tarea"
|
||||
LtltxtModalHojaTecnica.Text = "Tarea"
|
||||
TxtHojaTecnicaPrioridad.Text = ""
|
||||
DvHojaTecnicaPrioridad.Visible = True
|
||||
Exit Select
|
||||
Case 2
|
||||
LtlTituloModalHojaTecnica.Text = "Agregar Comprobación"
|
||||
LtltxtModalHojaTecnica.Text = "Comprobación"
|
||||
TxtHojaTecnicaPrioridad.Text = ""
|
||||
DvHojaTecnicaPrioridad.Visible = True
|
||||
Exit Select
|
||||
Case 3
|
||||
LtlTituloModalHojaTecnica.Text = "Agregar Recomendación"
|
||||
LtltxtModalHojaTecnica.Text = "Recomendación"
|
||||
TxtHojaTecnicaPrioridad.Text = ""
|
||||
DvHojaTecnicaPrioridad.Visible = False
|
||||
Exit Select
|
||||
End Select
|
||||
|
||||
ChkModalHojaTecnicaContinua.Visible = True
|
||||
txtModalHojaTecnica.Text = ""
|
||||
RegistraScript("$('#DivModalHojaTecnica').modal({ backdrop: 'static', keyboard: false});", "MTareas")
|
||||
UpModalHojaTecnica.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub MuestraModalFormatoPruebas(Tipo As Integer)
|
||||
|
||||
CveDesarrolloDetalle = -1
|
||||
LnkModalPruebas.Text = "Guardar"
|
||||
|
||||
Select Case Tipo
|
||||
Case 1
|
||||
LlTituloModalPruebas.Text = "Agregar Caso Basico"
|
||||
'TxtModalPruebas.Text = "Caso basico"
|
||||
TxtPruebasPrioridad.Text = ""
|
||||
Exit Select
|
||||
Case 2
|
||||
LlTituloModalPruebas.Text = "Agregar Caso Especifico"
|
||||
'TxtModalPruebas.Text = "Caso Especifico"
|
||||
Exit Select
|
||||
End Select
|
||||
|
||||
ChkModalPruebasContinua.Visible = True
|
||||
TxtModalPruebas.Text = ""
|
||||
|
||||
RegistraScript("$('#DivModalPruebas').modal({ backdrop: 'static', keyboard: false});", "MTPruebas")
|
||||
|
||||
UpModalPruebas.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregarTarea_Click(sender As Object, e As EventArgs) Handles LnkAgregarTarea.Click
|
||||
|
||||
CveDesarrolloDetalleTipo = 1
|
||||
DesarrolloDetalleTipo = "Tarea"
|
||||
ChkModalHojaTecnicaContinua.Visible = True
|
||||
MuestraModalformatoTecnico(1)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregarComprovaciones_Click(sender As Object, e As EventArgs) Handles LnkAgregarComprovaciones.Click
|
||||
CveDesarrolloDetalleTipo = 2
|
||||
DesarrolloDetalleTipo = "Comprobación"
|
||||
ChkModalHojaTecnicaContinua.Visible = True
|
||||
MuestraModalformatoTecnico(2)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregarRecomendaciones_Click(sender As Object, e As EventArgs) Handles LnkAgregarRecomendaciones.Click
|
||||
CveDesarrolloDetalleTipo = 3
|
||||
DesarrolloDetalleTipo = "Recomendación"
|
||||
ChkModalHojaTecnicaContinua.Visible = True
|
||||
MuestraModalformatoTecnico(3)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregarPruebaBasica_Click(sender As Object, e As EventArgs) Handles LnkAgregarPruebaBasica.Click
|
||||
CveDesarrolloDetalleTipo = 4
|
||||
DesarrolloDetalleTipo = "Prueba basica"
|
||||
|
||||
MuestraModalFormatoPruebas(1)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregarPruebaEspecifica_Click(sender As Object, e As EventArgs) Handles LnkAgregarPruebaEspecifica.Click
|
||||
CveDesarrolloDetalleTipo = 5
|
||||
DesarrolloDetalleTipo = "Prueba especifica"
|
||||
|
||||
MuestraModalFormatoPruebas(2)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkModalHojaTecnica_Click(sender As Object, e As EventArgs) Handles LnkModalHojaTecnica.Click
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
If ObjDesarrollo.DesarrolloDetalleAddUpdate(CveDesarrolloDetalle, CveDesarrollo, CveDesarrolloDetalleTipo, txtModalHojaTecnica.Text.Trim, "-1", 0, UsuarioActual.CveUsuario, -1, -1, -1, TxtHojaTecnicaPrioridad.Text.ToEntero) Then
|
||||
' Alert(" La " & DesarrolloDetalleTipo & " Se agregado correctamente")
|
||||
txtModalHojaTecnica.Focus()
|
||||
Else
|
||||
Alert("Se presento un erro al guarar la " & DesarrolloDetalleTipo, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
txtModalHojaTecnica.Text = ""
|
||||
UpModalHojaTecnica.Update()
|
||||
|
||||
If Not ChkModalHojaTecnicaContinua.Checked Then
|
||||
RegistraScript("$('#DivModalHojaTecnica').modal('hide');", "MTareas")
|
||||
End If
|
||||
|
||||
CargaDesarrolloDetalles()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LnkModalPruebas_Click(sender As Object, e As EventArgs) Handles LnkModalPruebas.Click
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
If ObjDesarrollo.DesarrolloDetalleAddUpdate(CveDesarrolloDetalle, CveDesarrollo, CveDesarrolloDetalleTipo, TxtModalPruebas.Text.Trim, "-1", 0, UsuarioActual.CveUsuario, -1, -1, -1, TxtPruebasPrioridad.Text.ToEntero) Then
|
||||
'Alert(" La " & DesarrolloDetalleTipo & " Se agregado correctamente")
|
||||
Else
|
||||
Alert("Se presento un erro al guardar la " & DesarrolloDetalleTipo, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
TxtModalPruebas.Text = ""
|
||||
UpModalPruebas.Update()
|
||||
If Not ChkModalPruebasContinua.Checked Then
|
||||
RegistraScript("$('#DivModalPruebas').modal('hide');", "MTPruebas")
|
||||
End If
|
||||
|
||||
CargaDesarrolloDetalles()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDesarrolloDetalles()
|
||||
If CveDesarrollo > 0 Then
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
If ObjDesarrollo.DesarrolloDetalleGet(-1, CveDesarrollo, -1, "-1", -1) Then
|
||||
|
||||
Dim DtDatosDetalles As New DataTable
|
||||
DtDatosDetalles = ObjDesarrollo.DtResultados
|
||||
|
||||
GvFTTareas.DataSource = DtDatosDetalles.FiltraParametros("CveDesarrolloDetalleTipo = 1")
|
||||
GvFTTareas.DataBind()
|
||||
GvFTComprobaciones.DataSource = DtDatosDetalles.FiltraParametros("CveDesarrolloDetalleTipo = 2")
|
||||
GvFTComprobaciones.DataBind()
|
||||
GvFTRecomendaciones.DataSource = DtDatosDetalles.FiltraParametros("CveDesarrolloDetalleTipo = 3")
|
||||
GvFTRecomendaciones.DataBind()
|
||||
|
||||
GvPruebasBasicas.DataSource = DtDatosDetalles.FiltraParametros("CveDesarrolloDetalleTipo = 4")
|
||||
GvPruebasBasicas.DataBind()
|
||||
GvPruebaspecificas.DataSource = DtDatosDetalles.FiltraParametros("CveDesarrolloDetalleTipo = 5")
|
||||
GvPruebaspecificas.DataBind()
|
||||
Else
|
||||
GvFTTareas.DataSource = Nothing
|
||||
GvFTTareas.DataBind()
|
||||
GvFTComprobaciones.DataSource = Nothing
|
||||
GvFTComprobaciones.DataBind()
|
||||
GvFTRecomendaciones.DataSource = Nothing
|
||||
GvFTRecomendaciones.DataBind()
|
||||
|
||||
GvPruebasBasicas.DataSource = Nothing
|
||||
GvPruebasBasicas.DataBind()
|
||||
GvPruebaspecificas.DataSource = Nothing
|
||||
GvPruebaspecificas.DataBind()
|
||||
|
||||
End If
|
||||
|
||||
UpGRal.Update()
|
||||
ObjDesarrollo.Dispose()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveDesarrolloDetalle = GvRow.DataKey("CveDesarrolloDetalle").ToEntero
|
||||
CveDesarrolloDetalleTipo = GvRow.DataKey("CveDesarrolloDetalleTipo").ToEntero
|
||||
DesarrolloDetalleTipo = GvRow.DataKey("DesarrolloDetalleTipo")
|
||||
Dim Descripcion As String = If(CveDesarrolloDetalleTipo = 4 Or CveDesarrolloDetalleTipo = 5, TxtModalPruebas.Text.Trim, txtModalHojaTecnica.Text.Trim)
|
||||
|
||||
If CveDesarrolloDetalleTipo = 4 Or CveDesarrolloDetalleTipo = 5 Then
|
||||
TxtModalPruebas.Text = GvRow.DataKey("Descripcion")
|
||||
TxtPruebasPrioridad.Text = GvRow.DataKey("CvePrioridad")
|
||||
LlTituloModalPruebas.Text = "Actulizar " & DesarrolloDetalleTipo
|
||||
RegistraScript("$('#DivModalPruebas').modal({ backdrop: 'static', keyboard: false});", "MTPruebas")
|
||||
LnkModalPruebas.Text = "Actualizar"
|
||||
'DdlPruebasPrioridad.SelectedValueExist(GvRow.DataKey("CvePrioridad"))
|
||||
ChkModalPruebasContinua.Visible = False
|
||||
ChkModalPruebasContinua.Checked = False
|
||||
UpModalPruebas.Update()
|
||||
Else
|
||||
txtModalHojaTecnica.Text = GvRow.DataKey("Descripcion")
|
||||
|
||||
|
||||
If Not CveDesarrolloDetalleTipo = 3 Then
|
||||
TxtHojaTecnicaPrioridad.Text = GvRow.DataKey("CvePrioridad")
|
||||
End If
|
||||
|
||||
LtlTituloModalHojaTecnica.Text = "Actulizar " & DesarrolloDetalleTipo
|
||||
RegistraScript("$('#DivModalHojaTecnica').modal({ backdrop: 'static', keyboard: false});", "MTareas")
|
||||
LnkModalHojaTecnica.Text = "Actualizar"
|
||||
'DdlHojaTecnicaPrioridad.SelectedValueExist(GvRow.DataKey("CvePrioridad"))
|
||||
ChkModalHojaTecnicaContinua.Visible = False
|
||||
ChkModalHojaTecnicaContinua.Checked = False
|
||||
UpModalHojaTecnica.Update()
|
||||
End If
|
||||
|
||||
If CveDesarrolloDetalleTipo = 3 Then
|
||||
' DdlHojaTecnicaPrioridad.SelectedValue = "-1"
|
||||
DvHojaTecnicaPrioridad.Visible = False
|
||||
Else
|
||||
DvHojaTecnicaPrioridad.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjDesarrollo.Dispose()
|
||||
End Sub
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim _CveDesarrolloDetalle As Integer = GvRow.DataKey("CveDesarrolloDetalle").ToEntero
|
||||
|
||||
If ObjDesarrollo.DesarrolloDetalleRemove(_CveDesarrolloDetalle) Then
|
||||
'Alert("Se guardo elimino la " & DesarrolloDetalleTipo & " Correctamente.")
|
||||
Else
|
||||
Alert("Se presento un error al eliminar la " & DesarrolloDetalleTipo, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
UpAdjunto.Update()
|
||||
ObjDesarrollo.Dispose()
|
||||
|
||||
CargaDesarrolloDetalles()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaAdjuntos()
|
||||
|
||||
|
||||
If CveDesarrollo > 0 Then
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
If ObjDesarrollo.DesarrolloAdjuntoGet(-1, CveDesarrollo, "-1") Then
|
||||
GvAdjuntos.DataSource = ObjDesarrollo.DtResultados
|
||||
GvAdjuntos.DataBind()
|
||||
Else
|
||||
GvAdjuntos.DataSource = Nothing
|
||||
GvAdjuntos.DataBind()
|
||||
End If
|
||||
|
||||
ObjDesarrollo.Dispose()
|
||||
UpAdjunto.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub EditAdjunto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveDesarrolloAdjunto = GvRow.DataKey("CveDesarrolloAdjunto").ToEntero
|
||||
TxtAdjunto.Text = GvRow.DataKey("DesarrolloAdjunto")
|
||||
DesarrolloAdjuntoArchivo = GvRow.DataKey("DesarrolloAdjuntoArchivo")
|
||||
TxtFileAdjunto.Text = ""
|
||||
ChkModalHojaTecnicaContinua.Visible = False
|
||||
UpModalUploaAdjunto.Update()
|
||||
RegistraScript("$('#ModalUploadAdjunto').modal({ backdrop: 'static', keyboard: false});", "MAdjuntos")
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub DowloadAdjunto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim _DesarrolloAdjuntoArchivo As String = GvRow.DataKey("DesarrolloAdjuntoArchivo")
|
||||
Dim RutaAdjunto As String = Server.MapPath("~/") & "Empresas\2\Desarrollo\Adjuntos\" & _DesarrolloAdjuntoArchivo
|
||||
Response.ClearContent()
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/octet-stream"
|
||||
Response.AddHeader("Content-Disposition", $"attachment; filename={ _DesarrolloAdjuntoArchivo };")
|
||||
Response.TransmitFile(RutaAdjunto)
|
||||
Response.Flush()
|
||||
Response.End()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub DeleteAdjunto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveDesarrolloAdjunto = GvRow.DataKey("CveDesarrolloAdjunto").ToEntero
|
||||
|
||||
Dim _DesarrolloAdjuntoArchivo As String = GvRow.DataKey("DesarrolloAdjuntoArchivo")
|
||||
Dim RutaAdjunto As String = Server.MapPath("~/") & "Empresas\2\Desarrollo\Adjuntos\" & _DesarrolloAdjuntoArchivo
|
||||
|
||||
If ObjDesarrollo.DesarrolloAdjuntoRemove(CveDesarrolloAdjunto) Then
|
||||
|
||||
If File.Exists(RutaAdjunto) Then
|
||||
File.Delete(RutaAdjunto)
|
||||
End If
|
||||
|
||||
Alert("Se elimino el adjunto Correctamente.")
|
||||
RegistraScript("$('#ModalUploadAdjunto').modal('hide');", "MAdjuntos")
|
||||
|
||||
CargaAdjuntos()
|
||||
|
||||
Else
|
||||
Alert("Se presento un error al eliminar el adjunto", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjDesarrollo.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregarAdjunto_Click(sender As Object, e As EventArgs) Handles LnkAgregarAdjunto.Click
|
||||
|
||||
CveDesarrolloAdjunto = -1
|
||||
DesarrolloAdjuntoArchivo = "-1"
|
||||
|
||||
TxtAdjunto.Text = ""
|
||||
TxtFileAdjunto.Text = ""
|
||||
ChkModalHojaTecnicaContinua.Visible = False
|
||||
UpModalUploaAdjunto.Update()
|
||||
|
||||
RegistraScript("$('#ModalUploadAdjunto').modal({ backdrop: 'static', keyboard: false});", "MTPruebas")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub BtnModalAdjuntoUpload_Click(sender As Object, e As EventArgs) Handles BtnModalAdjuntoUpload.Click
|
||||
Dim ObjDesarrollo As New ClsDesarrollo
|
||||
|
||||
|
||||
If ObjDesarrollo.DesarrolloAdjuntoAddUpdate(CveDesarrolloAdjunto, CveDesarrollo, TxtAdjunto.Text, DesarrolloAdjuntoArchivo, UsuarioActual.CveUsuario) Then
|
||||
|
||||
CveDesarrolloAdjunto = ObjDesarrollo.DtResultados(0)("CveDesarrolloAdjunto").ToString.ToEntero
|
||||
|
||||
GuardaDocumentoAdjunto()
|
||||
|
||||
ObjDesarrollo.DesarrolloAdjuntoAddUpdate(CveDesarrolloAdjunto, CveDesarrollo, TxtAdjunto.Text, DesarrolloAdjuntoArchivo, UsuarioActual.CveUsuario)
|
||||
|
||||
Alert("Se guardo archivo el adjunto Correctamente.")
|
||||
RegistraScript("$('#ModalUploadAdjunto').modal('hide');", "MAdjuntos")
|
||||
Else
|
||||
Alert("Se guardo presento un error al eliminar el archivo adjunto.")
|
||||
End If
|
||||
|
||||
|
||||
CargaAdjuntos()
|
||||
|
||||
ObjDesarrollo.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub GuardaDocumentoAdjunto()
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = TxtFileAdjunto.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
Dim ArchivoDestino As String = ""
|
||||
Dim ArchivoAnterior As String = ""
|
||||
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
Try
|
||||
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
|
||||
ArchivoDestino = $"{CveDesarrollo}_{CveDesarrolloAdjunto}." & FileExtension
|
||||
ArchivoAnterior = Server.MapPath("~/") & $"\Empresas\2\Desarrollo\Adjuntos\{DesarrolloAdjuntoArchivo}"
|
||||
Dim rutaDestino As String = Server.MapPath("~/") & $"\Empresas\2\Desarrollo\Adjuntos\{ArchivoDestino}"
|
||||
|
||||
If File.Exists(ArchivoAnterior) Then
|
||||
File.Delete(ArchivoAnterior)
|
||||
End If
|
||||
|
||||
|
||||
If Not System.IO.Directory.Exists(Server.MapPath("~/") & $"\Empresas\2\Desarrollo\Adjuntos\") Then
|
||||
System.IO.Directory.CreateDirectory(Server.MapPath("~/") & $"\Empresas\2\Desarrollo\Adjuntos\")
|
||||
End If
|
||||
|
||||
If File.Exists(rutaDestino) Then
|
||||
File.Delete(rutaDestino)
|
||||
End If
|
||||
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
||||
|
||||
' TxtFileAdjunto.Text = ""
|
||||
' TxtAdjunto.Text = ""
|
||||
UpModalUploaAdjunto.Update()
|
||||
|
||||
DesarrolloAdjuntoArchivo = ArchivoDestino
|
||||
Catch ex As Exception
|
||||
DesarrolloAdjuntoArchivo = "-1"
|
||||
OnError("Error al cargar archivo adjunto", ex)
|
||||
End Try
|
||||
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub GvAdjuntos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAdjuntos.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim _DesarrolloAdjuntoArchivo As String = e.Row.DataKey("DesarrolloAdjuntoArchivo")
|
||||
Dim RutaAdjunto As String = Server.MapPath("~/").ToString & "\Empresas\2\Desarrollo\Adjuntos\" & _DesarrolloAdjuntoArchivo
|
||||
|
||||
Dim LnkDescarga As LinkButton = e.Row.FCLinkButton("ImgDO")
|
||||
If File.Exists(RutaAdjunto) Then
|
||||
|
||||
LnkDescarga.Visible = True
|
||||
ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkDescarga)
|
||||
Else
|
||||
LnkDescarga.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user