1296 lines
54 KiB
VB.net
1296 lines
54 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
'Imports Subgurim.Controles
|
|
Imports System.IO
|
|
Imports System.Threading
|
|
Imports System.Runtime.InteropServices
|
|
|
|
Partial Class OI_PopUpAgenda
|
|
'Inherits System.Web.UI.Page
|
|
Inherits ClsPaginas
|
|
#Region "Propiedades"
|
|
Private Property CveEvento As Integer
|
|
Get
|
|
Return ViewState("CveEvento").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveEvento") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveTipoEvento As Integer
|
|
Get
|
|
Return ViewState("CveTipoEvento").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveTipoEvento") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property Nuevo As Boolean
|
|
Get
|
|
Return CType(ViewState("Nuevo"), Boolean)
|
|
End Get
|
|
Set(value As Boolean)
|
|
ViewState("Nuevo") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveSeguimiento As Integer
|
|
Get
|
|
Return ViewState("CveSeguimiento").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveSeguimiento") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private ReadOnly Property ArchConsecutivo As String
|
|
Get
|
|
Return ViewState("ArchConsecutivo").ToString
|
|
End Get
|
|
End Property
|
|
|
|
Private Property DTComentarios As DataTable
|
|
Get
|
|
Return CType(ViewState("DTComentarios"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTComentarios") = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "Propiedades Correo"
|
|
|
|
Private Property UsuarioDe() As String
|
|
Get
|
|
Return ViewState("UsuarioDe").ToString()
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("UsuarioDe") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveUsuarioDe() As Integer
|
|
Get
|
|
Return CType(ViewState("CveUsuarioDe").ToString(), Integer)
|
|
End Get
|
|
Set(ByVal value As Integer)
|
|
ViewState("CveUsuarioDe") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CorreoDe() As String
|
|
Get
|
|
Return ViewState("CorreoDe").ToString()
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("CorreoDe") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property UsuarioPara() As String
|
|
Get
|
|
Return ViewState("UsuarioPara").ToString()
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("UsuarioPara") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CveUsuarioPara() As Integer
|
|
Get
|
|
Return CType(ViewState("CveUsuarioPara").ToString(), Integer)
|
|
End Get
|
|
Set(ByVal value As Integer)
|
|
ViewState("CveUsuarioPara") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CorreoPara() As String
|
|
Get
|
|
Return ViewState("CorreoPara").ToString()
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("CorreoPara") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property UsuariosCCP() As String
|
|
Get
|
|
Return CType(ViewState("UsuarioCCP"), String)
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("UsuarioCCP") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property CorreosCCP() As String
|
|
Get
|
|
Return CType(ViewState("CorreosCCP"), String)
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("CorreosCCP") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property Titulo() As String
|
|
Get
|
|
Return ViewState("Titulo").ToString()
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("Titulo") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property Fecha() As String
|
|
Get
|
|
Return ViewState("Fecha").ToString()
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("Fecha") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property TipoNotificacion As Integer
|
|
Get
|
|
Return ViewState("TipoNotificacion").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("TipoNotificacion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property Prioridad() As Integer
|
|
Get
|
|
Return CType(ViewState("Prioridad"), Integer)
|
|
End Get
|
|
Set(ByVal value As Integer)
|
|
ViewState("Prioridad") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private ReadOnly Property Attchment() As String
|
|
Get
|
|
Return ViewState("Attachment").ToString()
|
|
End Get
|
|
End Property
|
|
|
|
Private Property Descripcion() As String
|
|
Get
|
|
Return ViewState("Descripcion").ToString()
|
|
End Get
|
|
Set(ByVal value As String)
|
|
ViewState("Descripcion") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private ReadOnly Property EsBitacora() As Boolean
|
|
Get
|
|
Return CBool(ViewState("EsBitacora"))
|
|
End Get
|
|
End Property
|
|
|
|
Private Property Referencia() As String
|
|
Get
|
|
Return ViewState("REFERENCIA").ToString()
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("REFERENCIA") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private ReadOnly Property CveUsuarioRealizo() As Integer
|
|
Get
|
|
Return ViewState("CveUsuarioRealizo").ToString().ToEntero()
|
|
End Get
|
|
End Property
|
|
|
|
Private Property TipoEvento As String
|
|
Get
|
|
Return ViewState("TipoEvento").ToString()
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("TipoEvento") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private ReadOnly Property CvePendientePadre As Integer
|
|
Get
|
|
Return ViewState("CvePendientePadre").ToString.ToEntero
|
|
End Get
|
|
End Property
|
|
|
|
Private Property ReferenciaDescripcion As String
|
|
Get
|
|
Return ViewState("ReferenciaDescripcion").ToString()
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("ReferenciaDescripcion") = value
|
|
End Set
|
|
|
|
End Property
|
|
|
|
Private ReadOnly Property URL As String
|
|
Get
|
|
Return ViewState("URL").ToString()
|
|
End Get
|
|
End Property
|
|
|
|
Private ReadOnly Property Variables As String
|
|
Get
|
|
Return ViewState("Variables").ToString()
|
|
End Get
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
'Private Property UsuarioPara() As String = String.Empty
|
|
'Private Property UsuariosCCP() As String = String.Empty
|
|
'Private Property CorreoPara() As String = String.Empty
|
|
'Private Property CorreosCCP() As String = String.Empty
|
|
Private Property StrPrioridad() As String = String.Empty
|
|
|
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
|
|
|
|
CType(Me.Master, BaseMasterPage).EsPopup = True
|
|
CType(Me.Master, BaseMasterPage).PopupWidth = 915
|
|
|
|
CveEvento = -1
|
|
TxtFechaInicio.Text = DateTime.Now.ToShortDateString
|
|
TxtFechaFin.Text = DateTime.Now.ToShortDateString
|
|
Nuevo = True
|
|
CveUsuarioDe = -1
|
|
CveUsuarioPara = -1
|
|
CveTipoEvento = 1
|
|
UsuariosCCP = "-1"
|
|
CargaRevision()
|
|
CargaAgendaTipo()
|
|
|
|
If Request("CveTipoEvento") IsNot Nothing AndAlso Request("CveTipoEvento").ToEntero > 0 Then
|
|
CveTipoEvento = Request("CveTipoEvento").ToEntero
|
|
|
|
'Tarea = 1 Agenda = 2 Proyecto = 3 ControlVersiones = 4 Minuta = 5 Bitacora = 6
|
|
If CveTipoEvento = 1 Then
|
|
Tarea()
|
|
LtlTitulo.Text = "Tarea"
|
|
ElseIf CveTipoEvento = 2 Then
|
|
Agenda()
|
|
LtlTitulo.Text = "Agendar a: "
|
|
ElseIf CveTipoEvento = 3 Then
|
|
Proyecto()
|
|
LtlTitulo.Text = "Proyecto"
|
|
ElseIf CveTipoEvento = 4 Then
|
|
ControlVersiones()
|
|
LtlTitulo.Text = "Control de Versiones"
|
|
ElseIf CveTipoEvento = 5 Then
|
|
Minuta()
|
|
LtlTitulo.Text = "Minuta"
|
|
ElseIf CveTipoEvento = 6 Then
|
|
Bitacora()
|
|
LtlTitulo.Text = "Bitacora"
|
|
End If
|
|
|
|
End If
|
|
|
|
If Request("CveActivoFijo") IsNot Nothing AndAlso IsNumeric(Request("CveActivoFijo")) AndAlso Request("CveActivoFijo").ToEntero > 0 Then
|
|
CargaActivoFijo(Request("CveActivoFijo").ToEntero)
|
|
End If
|
|
If Request("CveIE") IsNot Nothing AndAlso IsNumeric(Request("CveIE")) AndAlso Request("CveIE").ToEntero > 0 Then
|
|
CargaIE(Request("CveIE").ToEntero)
|
|
End If
|
|
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
|
|
CargaProspecto(Request("CveProspecto").ToEntero)
|
|
End If
|
|
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
|
|
CargaCliente(Request("CveCliente").ToEntero)
|
|
End If
|
|
If Request("CveOS") IsNot Nothing AndAlso IsNumeric(Request("CveOS")) AndAlso Request("CveOS").ToEntero > 0 Then
|
|
CargaOS(Request("CveOS").ToEntero)
|
|
End If
|
|
If Request("CveOC") IsNot Nothing AndAlso IsNumeric(Request("CveOC")) AndAlso Request("CveOC").ToEntero > 0 Then
|
|
CargaOC(Request("CveOC").ToEntero)
|
|
End If
|
|
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
|
|
CargaPersonal(Request("CvePersonal").ToEntero)
|
|
End If
|
|
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
|
|
CargaProveedor(Request("CveProveedor").ToEntero)
|
|
End If
|
|
If Request("CveUsuario") IsNot Nothing AndAlso IsNumeric(Request("CveUsuario")) AndAlso Request("CveUsuario").ToEntero > 0 Then
|
|
CargaUsuario(Request("CveUsuario").ToEntero)
|
|
End If
|
|
|
|
If Request("CveContrato") IsNot Nothing AndAlso IsNumeric(Request("CveContrato")) AndAlso Request("CveContrato").ToEntero > 0 Then
|
|
CargaContarto(Request("CveContrato").ToEntero)
|
|
End If
|
|
|
|
|
|
|
|
If Request("CveEvento") IsNot Nothing AndAlso IsNumeric(Request("CveEvento")) AndAlso Request("CveEvento").ToEntero > 0 Then
|
|
CveEvento = Request("CveEvento").ToEntero
|
|
cmdGuardar.Visible = False
|
|
CargaDatos()
|
|
|
|
Me.ImgAddObs.Attributes.Add("onclick", "javascript:$get('divObs').style.display=''; PosicionaObjeto(this.id,'divObs');")
|
|
'Configuración de Modalidad Update
|
|
cmdGuardar.Text = "Guardar Cambios"
|
|
'deshabilitar los campos que no se pueden editar
|
|
|
|
|
|
'LtlTitulo.Text = "Consulta del Evento:"
|
|
Else
|
|
GetUsuarios()
|
|
HabilitaTipoEvento(CveTipoEvento)
|
|
|
|
End If
|
|
End If
|
|
End Sub
|
|
Private Sub Tarea() '1
|
|
CveTipoEvento = 1
|
|
|
|
TrAgendaTipo.Visible = True
|
|
TrAsunto.Visible = True
|
|
TrDescripcion.Visible = True
|
|
TrPrioridad.Visible = True
|
|
TrFechaInicio.Visible = True
|
|
TrFechaFin.Visible = True
|
|
TrArchivo.Visible = True
|
|
TdUsuarios.Visible = True
|
|
End Sub
|
|
Private Sub Agenda() '2
|
|
CveTipoEvento = 2
|
|
TrAgendaTipo.Visible = True
|
|
TrAsunto.Visible = True
|
|
TrDescripcion.Visible = True
|
|
TrPrioridad.Visible = True
|
|
TrFechaInicio.Visible = True
|
|
'TrFechaFin.Visible = True
|
|
End Sub
|
|
Private Sub Proyecto() '3
|
|
CveTipoEvento = 3
|
|
TrAsunto.Visible = True
|
|
TrDescripcion.Visible = True
|
|
TrPrioridad.Visible = True
|
|
TdUsuarios.Visible = True
|
|
TrFechaInicio.Visible = True
|
|
TrFechaFin.Visible = True
|
|
TrRevision.Visible = True
|
|
TrArchivo.Visible = True
|
|
End Sub
|
|
Private Sub ControlVersiones() '4
|
|
CveTipoEvento = 4
|
|
TrAsunto.Visible = True
|
|
TrDescripcion.Visible = True
|
|
TrArchivo.Visible = True
|
|
End Sub
|
|
Private Sub Minuta() '5
|
|
CveTipoEvento = 5
|
|
TrAsunto.Visible = True
|
|
TrPrioridad.Visible = True
|
|
TrDescripcion.Visible = True
|
|
TdUsuarios.Visible = True
|
|
TrFechaInicio.Visible = True
|
|
TrArchivo.Visible = True
|
|
End Sub
|
|
Private Sub Bitacora() '6
|
|
CveTipoEvento = 6
|
|
TrDescripcion.Visible = True
|
|
TrFechaInicio.Visible = True
|
|
TrFechaFin.Visible = True
|
|
End Sub
|
|
Private Sub CargaDatos()
|
|
Dim ObjEventos As New ClsOIEventos
|
|
|
|
With ObjEventos
|
|
|
|
If ObjEventos.GetEventos(CveEvento, -1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Nothing, Nothing, Nothing) Then
|
|
|
|
If ObjEventos.DtResultados.Rows.Count > 0 Then
|
|
Nuevo = False
|
|
CveTipoEvento = .CveTipoEvento
|
|
LtlTitulo.Text = .TipoEvento
|
|
Titulo = .Asunto
|
|
|
|
TxtAsunto.Text = .Asunto
|
|
TxtDescripcion.Text = .Descripcion
|
|
DdlPrioridad.SelectedValue = .Prioridad.ToString
|
|
UsuarioDe = .UsuarioDe
|
|
CveUsuarioDe = .CveUsuarioDe
|
|
CorreoDe = .CorreoDe
|
|
CveUsuarioPara = .CveUsuarioPara
|
|
UsuarioPara = .UsuarioPara
|
|
CorreoPara = .CorreoPara
|
|
Descripcion = .Descripcion
|
|
Prioridad = .CvePrioridad
|
|
LblDe.Text = .UsuarioDe
|
|
LblPara.Text = .UsuarioPara
|
|
trDe.Visible = True
|
|
trCCP.Visible = True
|
|
CveSeguimiento = .CveSeguimiento
|
|
TxtFechaInicio.Text = .FechaInicio.ToShortDateString
|
|
|
|
If ObjEventos.FechaInicio.Year > 1900 Then
|
|
TxtFechaInicio.Text = ObjEventos.FechaInicio.ToString
|
|
TxtHoraInicio.SelectedTime = ObjEventos.FechaInicio
|
|
|
|
End If
|
|
|
|
TxtFechaFin.Text = .FechaFin.ToShortDateString
|
|
If ObjEventos.FechaFin.Year > 1900 Then
|
|
TxtFechaFin.Text = ObjEventos.FechaFin.ToString
|
|
TxtHoraFin.SelectedTime = ObjEventos.FechaFin
|
|
End If
|
|
TxtFechaRealTermino.Text = .FechaRealTermino.ToShortDateString
|
|
TxtTipoReferencia.Text = .TipoReferencia
|
|
TxtReferencia.Text = .Referencia
|
|
DdlRevision.SelectedValue = .CveRevision.ToString
|
|
DdlAgendaTipo.SelectedValue = .CveRevision.ToString
|
|
DdlPrioridad.SelectedValue = .CvePrioridad.ToString
|
|
|
|
LblEstatusEvento.Text = "Estatus: " & .EventoEstatus
|
|
TrEstatus.Visible = True
|
|
|
|
Select Case .CveEventoEstatus
|
|
Case 1 'En Revision
|
|
Select Case UsuarioActual.CveUsuario
|
|
Case .CveUsuarioPara
|
|
cmdTerminada.Visible = True
|
|
|
|
Select Case .CveTipoEvento
|
|
Case 4 'Control de Versiones
|
|
ChkPublicar.Visible = True
|
|
cmdTerminada.Visible = False
|
|
End Select
|
|
End Select
|
|
Case 2 'Concluida
|
|
Select Case UsuarioActual.CveUsuario
|
|
Case .CveUsuarioDe
|
|
cmdRevisada.Visible = True
|
|
cmdRevision.Visible = True
|
|
Select Case .CveTipoEvento
|
|
Case 4 'Control de Versiones
|
|
ChkPublicar.Visible = True
|
|
cmdRevisada.Text = "Publicar"
|
|
ChkRegresaraPendiente.Visible = True : ChkRegresaraPendiente.Text = "Regresar a Revisión"
|
|
End Select
|
|
End Select
|
|
Case 3 'Revisada
|
|
End Select
|
|
|
|
'cargo los ususarios
|
|
|
|
If .GetEventosUsuario(CveEvento, UsuarioActual.CveEmpresa) Then
|
|
|
|
GVUsuarios.DataSource = AgregaGrupos(.DtResultados)
|
|
GVUsuarios.DataBind()
|
|
'CARGALOS DATOS USUARIOSCCP
|
|
|
|
For Each Dr As DataRow In .DtResultados.FiltraParametros("CveEvento > 0").Rows
|
|
UsuariosCCP += Dr("Nombre").ToString & ", "
|
|
Next
|
|
UsuariosCCP = UsuariosCCP.Substring(0, UsuariosCCP.Length - 2)
|
|
LblCCP.Text = UsuariosCCP
|
|
End If
|
|
End If
|
|
|
|
TxtAsunto.Enabled = False
|
|
TxtDescripcion.Enabled = False
|
|
DdlPrioridad.Enabled = False
|
|
TxtFechaInicio.Enabled = False
|
|
TxtFechaFin.Enabled = False
|
|
TxtHoraInicio.Enabled = False
|
|
TxtHoraFin.Enabled = False
|
|
ImgCalendario.Visible = False
|
|
ImgCalFechaFin.Visible = False
|
|
DdlRevision.Enabled = False
|
|
LnkUpload.Visible = False
|
|
TxtArchivo.Enabled = False
|
|
HabilitaTipoEvento(.CveTipoEvento)
|
|
End If
|
|
End With
|
|
|
|
ObjEventos.Dispose()
|
|
End Sub
|
|
Private Sub HabilitaTipoEvento(pCveTipoEvento As Integer)
|
|
|
|
Select Case pCveTipoEvento
|
|
Case 4
|
|
TrRevision.Visible = False
|
|
TrArchivo.Visible = False
|
|
cmdRevision.Text = "Regresar a Revisión"
|
|
cmdTerminada.Text = "Por Aprobar"
|
|
cmdRevisada.Text = "Revisada"
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
Private Sub GetUsuarios()
|
|
Dim DT As DataTable = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa, "Rol ASC")
|
|
|
|
GVUsuarios.DataSource = AgregaGrupos(DT)
|
|
DT.Dispose()
|
|
GVUsuarios.DataBind()
|
|
End Sub
|
|
Private Function AgregaGrupos(ByRef DT As DataTable) As DataTable
|
|
If Not DT Is Nothing AndAlso DT.Rows.Count > 0 Then
|
|
|
|
DT.Columns.Add(New DataColumn("Grupo", GetType(String)))
|
|
|
|
Dim i As Integer = 0
|
|
Dim Gpo As String = String.Empty
|
|
Dim dbRow As DataRow
|
|
While i < DT.Rows.Count
|
|
|
|
dbRow = DT.NewRow()
|
|
|
|
If i = 0 Then
|
|
Gpo = DT.Rows(0)("Rol").ToString()
|
|
dbRow("Rol") = DT.Rows(i)("Rol")
|
|
dbRow("Grupo") = "S"
|
|
DT.Rows.InsertAt(dbRow, i)
|
|
Gpo = DT.Rows(i)("Rol").ToString()
|
|
Else
|
|
If Gpo <> DT.Rows(i)("Rol").ToString() Then
|
|
dbRow("Rol") = DT.Rows(i)("Rol")
|
|
dbRow("Grupo") = "S"
|
|
DT.Rows.InsertAt(dbRow, i)
|
|
End If
|
|
Gpo = DT.Rows(i)("Rol").ToString()
|
|
End If
|
|
i += 1
|
|
End While
|
|
End If
|
|
Return DT
|
|
|
|
End Function
|
|
Protected Sub gvUsuarios_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GVUsuarios.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
If (Not IsDBNull(DataBinder.Eval(e.Row.DataItem, "Grupo"))) AndAlso CStr(DataBinder.Eval(e.Row.DataItem, "Grupo")) = "S" Then
|
|
e.Row.CssClass = "SubTotales2"
|
|
e.Row.Cells(0).Visible = False
|
|
e.Row.Cells(1).Visible = False
|
|
e.Row.Cells(2).Visible = False
|
|
e.Row.Cells(3).ColumnSpan = 3
|
|
Else
|
|
e.Row.Cells(3).Visible = False
|
|
End If
|
|
|
|
If e.Row.DBCampo("CveUsuario") = CveUsuarioPara.ToString Then
|
|
e.Row.Cells(0).Enabled = False
|
|
e.Row.FCCheckBox("ChkPara").Checked = True
|
|
End If
|
|
|
|
|
|
If Nuevo = True AndAlso e.Row.DBCampo("CveUsuario") = UsuarioActual.CveUsuario.ToString Then
|
|
e.Row.Cells(1).Enabled = False
|
|
e.Row.FCCheckBox("ChkCCP").Checked = True
|
|
End If
|
|
|
|
|
|
|
|
If CveEvento > 0 Then
|
|
'viene de BD
|
|
e.Row.FCCheckBox("ChkPara").Enabled = False
|
|
e.Row.FCCheckBox("ChkCCP").Enabled = False
|
|
'si se cumple esta condición que decir que fue selecccionado
|
|
If e.Row.DBCampo("CveEvento") <> "" Then
|
|
e.Row.FCCheckBox("ChkCCP").Checked = True
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
Protected Sub cmdGuardar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdGuardar.Click
|
|
Dim ObjEventos As New ClsOIEventos()
|
|
|
|
Dim Asunto As String = TxtAsunto.Text.Trim
|
|
Descripcion = TxtDescripcion.Text.Trim
|
|
Dim FechaInicio As String = ""
|
|
Dim FechaFin As String = ""
|
|
|
|
If TxtFechaInicio.Text <> String.Empty Then FechaInicio = TxtFechaInicio.Text + " " + TxtHoraInicio.PostedTime
|
|
|
|
If TxtFechaFin.Text <> String.Empty Then FechaFin = TxtFechaFin.Text + " " + TxtHoraFin.PostedTime
|
|
|
|
Dim Attachment As String = String.Empty
|
|
Dim CveUsuarioCCP As Integer = -1
|
|
Dim CveUsuarioPara As Integer = -1
|
|
|
|
Dim CveUsuarioIng As Integer = UsuarioActual.CveUsuario
|
|
Dim CveRevision As Integer = DdlRevision.SelectedValue.ToString.ToEntero
|
|
Dim Archivo As String = TxtArchivo.Text
|
|
Dim CveEmpresa As Integer = UsuarioActual.CveEmpresa
|
|
|
|
|
|
'-----------------------------------------
|
|
Dim CveAgendaTipo As Integer = DdlAgendaTipo.SelectedValue.ToEntero
|
|
Dim Prioridad As Integer
|
|
Dim CveUsuarioDe As Integer = UsuarioActual.CveUsuario
|
|
Dim CveEventoPadre As Integer
|
|
|
|
Dim CveActivoFijo As Integer = -1
|
|
If Request("CveAF") IsNot Nothing AndAlso IsNumeric(Request("CveAF")) AndAlso Request("CveAF").ToEntero > 0 Then
|
|
CveActivoFijo = Request("CveAF").ToEntero
|
|
End If
|
|
|
|
Dim CveIE As Integer = -1
|
|
If Request("CveIE") IsNot Nothing AndAlso IsNumeric(Request("CveIE")) AndAlso Request("CveIE").ToEntero > 0 Then
|
|
CveIE = Request("CveIE").ToEntero
|
|
End If
|
|
|
|
Dim CveProspecto As Integer = -1
|
|
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
|
|
CveProspecto = Request("CveProspecto").ToEntero
|
|
End If
|
|
|
|
Dim CveCliente As Integer = -1
|
|
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
|
|
CveCliente = Request("CveCliente").ToEntero
|
|
End If
|
|
|
|
Dim CveOS As Integer = -1
|
|
If Request("CveOS") IsNot Nothing AndAlso IsNumeric(Request("CveOS")) AndAlso Request("CveOS").ToEntero > 0 Then
|
|
CveOS = Request("CveOS").ToEntero
|
|
End If
|
|
|
|
Dim CveOC As Integer = -1
|
|
If Request("CveOC") IsNot Nothing AndAlso IsNumeric(Request("CveOC")) AndAlso Request("CveOC").ToEntero > 0 Then
|
|
CveOC = Request("CveOC").ToEntero
|
|
End If
|
|
|
|
Dim CvePersonal As Integer = -1
|
|
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
|
|
CvePersonal = Request("CvePersonal").ToEntero
|
|
End If
|
|
|
|
Dim CveProveedor As Integer = -1
|
|
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
|
|
CveProveedor = Request("CveProveedor").ToEntero
|
|
End If
|
|
|
|
Dim CveUsuario As Integer = -1
|
|
If Request("CveUsuario") IsNot Nothing AndAlso IsNumeric(Request("CveUsuario")) AndAlso Request("CveUsuario").ToEntero > 0 Then
|
|
CveUsuario = Request("CveUsuario").ToEntero
|
|
End If
|
|
|
|
'------------------------------------------
|
|
'Recorrro Grid para obtener el usuario PARA
|
|
For Each RowPara As GridViewRow In GVUsuarios.Rows
|
|
If RowPara.FCCheckBox("ChkPara").Checked Then
|
|
CveUsuarioPara = GVUsuarios.DataKeys(RowPara.RowIndex).Values("CveUsuario").ToString.ToEntero
|
|
UsuarioPara = GVUsuarios.DataKeys(RowPara.RowIndex).Values("Nombre").ToString
|
|
Exit For
|
|
End If
|
|
Next
|
|
|
|
Titulo = TxtAsunto.Text.Trim()
|
|
UsuarioDe = UsuarioActual.Nombre
|
|
Prioridad = DdlPrioridad.SelectedValue.ToEntero
|
|
CveRevision = DdlRevision.SelectedValue.ToEntero
|
|
Fecha = Now.ToLongDateString
|
|
|
|
Dim dru As DataRow = GlobalDTUsuarios(CveUsuarioPara).FiltroPrimero("")
|
|
If dru IsNot Nothing Then CorreoPara = dru("Correo").ToString
|
|
|
|
|
|
If CveEvento = -1 Then
|
|
If CveTipoEvento = 1 Then
|
|
If ObjEventos.AddEventoTarea(Asunto, Descripcion, Prioridad, CveUsuarioDe, CveUsuarioPara, FechaInicio.ToDateTime, FechaFin.ToDateTime, -1, 1, CveRevision, Archivo, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveUsuarioIng, CveUsuario, CveEmpresa) Then
|
|
Alert("La Nueva Tarea se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
ElseIf CveTipoEvento = 2 Then
|
|
If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor) Then
|
|
Alert("La Nueva Agenda se guardó correctamente.", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
|
|
End If
|
|
ElseIf CveTipoEvento = 3 Then
|
|
If CveEventoPadre = 0 Then
|
|
If ObjEventos.AddEventoProyecto(Asunto, Descripcion, Prioridad, CveUsuarioDe, CveUsuarioPara, FechaInicio.ToDateTime, FechaFin.ToDateTime, -1, CveRevision, Archivo, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveUsuarioIng, CveUsuario, CveEmpresa) Then
|
|
Alert("El Nuevo Proyecto se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
Else
|
|
If ObjEventos.AddEventoProyecto(Asunto, Descripcion, Prioridad, CveUsuarioDe, CveUsuarioPara, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveEventoPadre, CveRevision, Archivo, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveUsuarioIng, CveUsuario, CveEmpresa) Then
|
|
Alert("El Nuevo Proyecto se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
End If
|
|
ElseIf CveTipoEvento = 4 Then
|
|
If ObjEventos.AddEventoControlVersionesDoctos(Asunto, Descripcion, Archivo, CveUsuarioIng, CveEmpresa) Then
|
|
Alert("La Nueva Versión se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
ElseIf CveTipoEvento = 5 Then
|
|
If ObjEventos.AddEventoMinuta(Asunto, Descripcion, "", CveUsuarioDe, CveUsuarioPara, FechaInicio.ToDateTime, Archivo, CveUsuarioIng, CveEmpresa) Then
|
|
Alert("La Nueva Minuta se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
ElseIf CveTipoEvento = 6 Then
|
|
If ObjEventos.AddEventoBitacora(Descripcion, "", CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveUsuarioIng, CveEmpresa) Then
|
|
Alert("La Nueva Bitacora se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
End If
|
|
End If
|
|
|
|
If CveEvento > 0 Then
|
|
|
|
TipoNotificacion = 1
|
|
|
|
For Each RowCCP As GridViewRow In GVUsuarios.Rows
|
|
If RowCCP.FCCheckBox("ChkCCP").Checked Then
|
|
CveUsuarioPara = GVUsuarios.DataKeys(RowCCP.RowIndex).Values("CveUsuario").ToString.ToEntero
|
|
If ObjEventos.AddEventoUsuario(CveEvento, CveUsuarioPara) Then
|
|
'Genero las claves, nombres y correos aquíen se le enviará correo
|
|
CveUsuarioCCP = RowCCP.DataKey("CveUsuario").ToString().ToEntero()
|
|
If UsuarioActual.CveUsuario <> CveUsuarioCCP Then UsuariosCCP &= RowCCP.DataKey("Nombre") & ", "
|
|
If CveUsuarioCCP <> UsuarioActual.CveUsuario Then CorreosCCP &= RowCCP.DataKey("Correo") & ";"
|
|
End If
|
|
End If
|
|
Next
|
|
Dim Cadena As String = String.Format("location.href='/OI/EventoDetalle.aspx?CveEvento={0}'", CveEvento)
|
|
Select Case CveTipoEvento
|
|
Case 4 : Cadena = "location.href='/OI/RepDocumentos.aspx'"
|
|
End Select
|
|
Alert("El Nuevo Evento se guardó correctamente.", TipoMensaje.MsgInformacion, Cadena)
|
|
MandarMails(1)
|
|
|
|
|
|
End If
|
|
Else
|
|
If ObjEventos.UpdateEvento(Asunto, Descripcion, Prioridad, -1, CveUsuarioPara, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveRevision, Archivo, CveEvento) Then
|
|
'UpAsunto.Update()
|
|
'ViewState("DTEventos") = ObjEventos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
'GlobalDTEventos = ObjEventos.DtResultados
|
|
|
|
' '' '' ''Manda llamar DELETE FROM EventosUsuarios WHERE CveEvento = Evento Actual
|
|
'' '' ''For Each Row As GridViewRow In GVUsuarios.Rows
|
|
'' '' '' If Row.FCCheckBox("ChkCCP").Checked Then
|
|
'' '' '' 'Manda llamar INSERT
|
|
'' '' '' If ObjEventos.a Then
|
|
'' '' '' 'Mandar parametro CveEvento CveUsuario (GVUsuario.DataKeys(Row.RowIndex).Values("CveUsuario").ToString.ToEntero)
|
|
|
|
'' '' '' End If
|
|
'' '' ''Next
|
|
End If
|
|
|
|
|
|
End If
|
|
|
|
|
|
ObjEventos.Dispose()
|
|
End Sub
|
|
Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
|
|
If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
|
|
Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
|
|
If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos")
|
|
File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension)
|
|
Session("FileUpload") = ""
|
|
|
|
If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then
|
|
Dim ObjActivosFijos As New ClsAF
|
|
If ObjActivosFijos.AddActivosFijosImagenes(CveEvento, CveEvento & "_" & ArchConsecutivo & Extension, UsuarioActual.CveUsuario) Then
|
|
'CargarArchivo()
|
|
Else
|
|
File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension)
|
|
End If
|
|
|
|
ObjActivosFijos.Dispose()
|
|
|
|
End If
|
|
End If
|
|
End Sub
|
|
Private Sub CargaRevision()
|
|
DdlRevision.DataSource = GlobalDTOIRevision(UsuarioActual.CveEmpresa)
|
|
DdlRevision.DataBind()
|
|
End Sub
|
|
Private Sub CargaAgendaTipo()
|
|
DdlAgendaTipo.DataSource = GlobalDTOIAgendaTipo
|
|
DdlAgendaTipo.DataBind()
|
|
End Sub
|
|
|
|
'Private Sub CargarArchivo()
|
|
' Dim StrBuilder As New StringBuilder
|
|
' Dim TmpDT As DataTable = Nothing
|
|
' Dim ObjEvento As New ClsActivosFijos
|
|
|
|
' If ObjEvento.GetActivosFijosImagenes(CveEvento) Then
|
|
' TmpDT = ObjEvento.DtResultados
|
|
' Else
|
|
' TmpDT = Nothing
|
|
' End If
|
|
' ObjEvento.Dispose()
|
|
' myGallery.InnerHtml = ""
|
|
' If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
|
|
' For Each Row As DataRow In TmpDT.Rows
|
|
' StrBuilder.Append(Row("URL"))
|
|
' Next
|
|
' myGallery.InnerHtml = StrBuilder.ToString
|
|
' ViewState("ArchConsecutivo") = TmpDT.Rows(0)("ArchConsecutivo").ToString
|
|
' TmpDT.Dispose()
|
|
' RegistraScript("$(function () { $('#myGallery').galleryView(); });")
|
|
' Else
|
|
' ViewState("ArchConsecutivo") = "1"
|
|
' End If
|
|
|
|
'End Sub
|
|
Protected Sub BtnAddObs_Click(sender As Object, e As EventArgs) Handles BtnAddObs.Click
|
|
|
|
Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
|
|
Dim RutaArchivo As String = String.Format("{0}Empresas\{1}\OI\Temp\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Session("Eventos"))
|
|
Dim tCveSeguimiento As Integer
|
|
Dim Archivo As String = ""
|
|
|
|
Dim OI As New ClsOIEventos
|
|
|
|
OI.IniciaTransacSQL()
|
|
If Session("Eventos") IsNot Nothing AndAlso File.Exists(RutaArchivo) Then
|
|
|
|
If Not Directory.Exists(RutaGuardar) Then Directory.CreateDirectory(RutaGuardar)
|
|
|
|
Archivo = Path.GetExtension(Session("Eventos").ToString)
|
|
End If
|
|
|
|
If tCveSeguimiento > 0 Then
|
|
If Archivo <> "" Then
|
|
' If File.Exists(RutaGuardar & Archivo) Then File.Delete(RutaGuardar & Archivo)
|
|
File.Move(RutaArchivo, RutaGuardar & tCveSeguimiento & Path.GetExtension(Archivo))
|
|
Session("Eventos") = ""
|
|
|
|
If ChkRegresaraPendiente.Checked Then
|
|
If Not OI.UpdateEstatusEvento(2, tCveSeguimiento, CveEvento, UsuarioActual.CveUsuario) Then
|
|
OI.RollBack()
|
|
End If
|
|
End If
|
|
|
|
If ChkPublicar.Checked And CveUsuarioPara = UsuarioActual.CveUsuario Then
|
|
|
|
If Not OI.UpdateEstatusEvento(2, tCveSeguimiento, CveEvento, UsuarioActual.CveUsuario) Then
|
|
OI.RollBack()
|
|
End If
|
|
End If
|
|
|
|
|
|
End If
|
|
|
|
If ChkPublicar.Checked And CveUsuarioDe = UsuarioActual.CveUsuario Then
|
|
|
|
If Not OI.UpdateEstatusEvento(3, CveSeguimiento, CveEvento, UsuarioActual.CveUsuario) Then
|
|
OI.RollBack()
|
|
Else
|
|
'hago una copia del archivo del comentario
|
|
'File.Copy(RutaArchivo, RutaGuardar & tCveSeguimiento & Path.GetExtension(Archivo))
|
|
End If
|
|
End If
|
|
|
|
|
|
Fecha = Now.ToLongDateString
|
|
Alert("La observación se guardó correctamente.", TipoMensaje.MsgInformacion)
|
|
TxtOBs.Text = ""
|
|
'registrascript la imagen
|
|
DTComentarios = OI.DtResultados
|
|
GvObservaciones.DataSource = OI.DtResultados
|
|
GvObservaciones.DataBind()
|
|
UPPObs.Update()
|
|
UPPDatosObs.Update()
|
|
MandarMails(2)
|
|
Else
|
|
OI.RollBack()
|
|
End If
|
|
OI.Commit()
|
|
|
|
|
|
OI.Dispose()
|
|
|
|
End Sub
|
|
Protected Sub GvObservaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvObservaciones.RowDataBound
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
If e.Row.DBCampo("Archivo") <> "" Then
|
|
e.Row.FCHyperLink("HplA").NavigateUrl = String.Format("\Empresas\{0}\OI\{1}", e.Row.DBCampo("CveEmpresa"), e.Row.DBCampo("Archivo"))
|
|
End If
|
|
|
|
|
|
End If
|
|
End Sub
|
|
Private Sub MandarMails(ByVal ObjTipo As Object)
|
|
|
|
Dim Tipo As Integer = ObjTipo.ToString().ToEntero()
|
|
|
|
If Prioridad = 1 Then
|
|
StrPrioridad = "<span class='Verde'>Baja</span>"
|
|
ElseIf Prioridad = 2 Then
|
|
StrPrioridad = "<span class='Negro'>Media</span>"
|
|
ElseIf Prioridad = 3 Then
|
|
StrPrioridad = "<span class='Rojo'>Alta</span>"
|
|
Else
|
|
StrPrioridad = "No definida"
|
|
End If
|
|
|
|
Dim OI As New ClsOIEventos
|
|
Dim DT As DataTable = Nothing
|
|
If OI.GetEventosUsuario(CveEvento, UsuarioActual.CveEmpresa) Then
|
|
DT = OI.DtResultados.FiltraParametros("CveEvento > 0")
|
|
End If
|
|
OI.Dispose()
|
|
|
|
Dim Mail As New ClsSisMail()
|
|
|
|
If Nuevo Then
|
|
'Mail.MandaCorreo(EmpresaNotificaciones, CorreoPara, ": Te asignó una tarea " & UsuarioActual.Nombre & " en SIG.", GeneraContenido(CveEvento, Titulo, UsuarioDe, UsuarioPara, UsuariosCCP.ToString, Fecha, StrPrioridad, Descripcion, "", Tipo).ToString)
|
|
Mail.SendMail(EmpresaNotificaciones, CorreoPara, ": Te asignó una tarea " & UsuarioActual.Nombre & " en SIG.", GeneraContenido(CveEvento, Titulo, UsuarioDe, UsuarioPara, UsuariosCCP.ToString, Fecha, StrPrioridad, Descripcion, "", Tipo).ToString)
|
|
|
|
'Manda correo CCP.
|
|
'If CorreosCCP.Length >= 1 Then CorreosCCP = CorreosCCP.Substring(0, CorreosCCP.Length - 1)
|
|
'If CorreosCCP.Length > 1 Then
|
|
' Dim ArrCCP As String() = CorreosCCP.Split(";"c)
|
|
' If ArrCCP.Length > 0 Then
|
|
' Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, Now.ToString(), StrPrioridad, Descripcion, "", 1)
|
|
' For i As Integer = 0 To ArrCCP.Length - 1
|
|
' If ArrCCP(i) <> "" Then
|
|
' ' Mail.Mandacorreo(UsuarioActual.Empresa,, ArrCCP(i), " " & UsuarioActual.Nombre & " le asignó una tarea a " & UsuarioPara & " en SIG.", SB.ToString)
|
|
' End If
|
|
' Next
|
|
' End If
|
|
'End If
|
|
Else
|
|
If DT.Rows.Count > 0 Then
|
|
|
|
Dim Str As String = ""
|
|
|
|
Select Case Tipo
|
|
Case 1 : Str = "El usuario: " & UsuarioActual.Nombre & " registró una tarea: " & Titulo
|
|
Case 2 : Str = "El usuario: " & UsuarioActual.Nombre & " agregó una observación en la tarea: " & Titulo
|
|
Case 3 : Str = "El usuario: " & UsuarioActual.Nombre & " concluyó la tarea: " & Titulo
|
|
Case 4 : Str = "El usuario: " & UsuarioActual.Nombre & "regresó a estatus pendiente la tarea: " & Titulo
|
|
Case 5 : Str = "El usuario: " & UsuarioActual.Nombre & " revisó la tarea: " & Titulo
|
|
End Select
|
|
|
|
For i As Integer = 0 To DT.Rows.Count - 1
|
|
If Not DT.Rows(i)("CveUsuario").ToString.ToEntero.Contiene(UsuarioActual.CveUsuario, CveUsuarioDe, CveUsuarioPara) Then
|
|
End If
|
|
Next
|
|
|
|
End If
|
|
End If
|
|
End Sub
|
|
Private Function GeneraContenido(CveEvento As Integer, ByVal Tarea As String, ByVal De As String, ByVal Para As String, ByVal CCP As String, ByVal Fecha As String, ByVal Prioridad As String, ByVal Descripcion As String, ByVal Imagen As String, ByVal Tipo As Integer) As StringBuilder
|
|
Dim StrSB As New StringBuilder()
|
|
|
|
Dim DireccionURL As String = GlobalDTParametros(SisParametros.URL).Cadena1
|
|
Dim Variables As String = ""
|
|
|
|
StrSB.Append("<html xmlns=""http://www.w3.org/1999/xhtml""> ")
|
|
StrSB.Append("<head> ")
|
|
'StrSB.AppendFormat("<link href=""{0}/Styles/Estilos.css"" rel=""stylesheet"" type=""text/css""> ", DireccionURL)
|
|
StrSB.Append(" <style type=""text/css""> ")
|
|
StrSB.Append(" body ")
|
|
StrSB.Append(" { ")
|
|
StrSB.Append(" margin:0px; ")
|
|
StrSB.Append(" padding:0px 0px 0px 0px; ")
|
|
StrSB.Append(" font-family: Verdana, Arial, Helvetica, sans-serif; ")
|
|
StrSB.Append(" font-size: 10px; ")
|
|
StrSB.Append(" background-color:#F0F0F0; ")
|
|
StrSB.Append(" } ")
|
|
StrSB.Append(" a.Texto ")
|
|
StrSB.Append(" { ")
|
|
StrSB.Append(" font-size:11px; ")
|
|
StrSB.Append(" background-color:#F7F6F3; ")
|
|
StrSB.Append(" text-decoration:none; ")
|
|
StrSB.Append(" font-weight:bold; ")
|
|
StrSB.Append(" } ")
|
|
StrSB.Append(" .Texto ")
|
|
StrSB.Append(" { ")
|
|
StrSB.Append(" background-color:#F7F6F3; color:Black; font-family:Verdana; font-size:10px; text-align:center; vertical-align:middle; height:20px;")
|
|
StrSB.Append(" } ")
|
|
StrSB.Append(" .TextoAlterno ")
|
|
StrSB.Append(" { ")
|
|
StrSB.Append(" background-color:White; color:Black; font-family:Verdana; font-size:10px; text-align:center; ")
|
|
StrSB.Append(" vertical-align:middle; height:20px;")
|
|
StrSB.Append(" } ")
|
|
StrSB.Append(" .BarraIdentidad ")
|
|
StrSB.Append(" { ")
|
|
StrSB.Append(" color:#FFFFFF; ")
|
|
StrSB.Append(" background:#F0F0F0; ")
|
|
StrSB.Append(" font-weight:bold; ")
|
|
StrSB.Append(" font-size:19px; ")
|
|
StrSB.Append(" font-style:oblique; ")
|
|
StrSB.Append(" } ")
|
|
StrSB.Append(" .Titulos ")
|
|
StrSB.Append(" { ")
|
|
StrSB.Append(" background-color: Gray;")
|
|
StrSB.Append(" color:White; ")
|
|
StrSB.Append(" font-family:Verdana; font-size:12px; text-align:center; ")
|
|
StrSB.Append(" vertical-align:middle; font-weight:bold; height:30px; ")
|
|
StrSB.Append(" text-decoration:none; ")
|
|
StrSB.Append(" } ")
|
|
StrSB.Append(" .Verde {color: #00CC00;} ")
|
|
StrSB.Append(" .Negro {color: #000000;} ")
|
|
StrSB.Append(" .Rojo {color: #FF0000;} ")
|
|
StrSB.Append(" </style> ")
|
|
StrSB.Append("</head> ")
|
|
StrSB.Append("<body> ")
|
|
StrSB.Append(" <form> ")
|
|
StrSB.Append(" <div> ")
|
|
StrSB.Append(" <table border=""1"" rules=""all"" style=""border-collapse: collapse""> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td align=""center"" class=""Titulos"" colspan=""2"">SIG</td> ")
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr class=""Titulos""> ")
|
|
|
|
Dim Desc As String = String.Empty
|
|
If Tipo = 1 Then
|
|
Desc = "Notificación de tarea nueva"
|
|
ElseIf Tipo = 2 Then
|
|
Desc = "Notificación de nueva observación"
|
|
ElseIf Tipo = 3 Then
|
|
Desc = "Notificación de tarea concluida"
|
|
ElseIf Tipo = 4 Then
|
|
Desc = "Notificación de tarea devuelta a estatus pendiente"
|
|
ElseIf Tipo = 5 Then
|
|
Desc = "Notificación de tarea finalizada"
|
|
End If
|
|
|
|
StrSB.AppendFormat(" <td align=""center"" colspan=""2"">{0}</td> ", Desc)
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td class=""Titulos"" width=""300""> De</td> ")
|
|
StrSB.AppendFormat(" <td class='Texto' width=""300""> {0}</td> ", De)
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td class=""Titulos"" width=""300""> Para</td> ")
|
|
StrSB.AppendFormat(" <td class='Texto' width=""300""> {0}</td> ", Para)
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td class=""Titulos"" width=""300""> Con Copia Para (CCP)</td> ")
|
|
StrSB.AppendFormat(" <td class='Texto' width=""300""> {0}</td> ", If(CCP.Length > 0, CCP, "-").ToString())
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td class=""Titulos"" width=""300""> Titulo</td> ")
|
|
StrSB.AppendFormat(" <td class='Texto' width=""300""> {0}</td> ", Tarea)
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td class=""Titulos""> Fecha</td> ")
|
|
StrSB.AppendFormat(" <td class='Texto'> {0}</td> ", Fecha)
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td class=""Titulos""> Prioridad</td> ")
|
|
StrSB.AppendFormat(" <td class='Texto'> {0}</td> ", Prioridad)
|
|
StrSB.Append(" </tr> ")
|
|
|
|
If CveTipoEvento = 4 Then 'Control de versiones
|
|
Variables = "/OI/EventosDetalle.aspx?CveEvento=" & CveEvento
|
|
End If
|
|
|
|
'If Imagen <> "" Then
|
|
' StrSB.Append(" <tr> ")
|
|
' StrSB.Append(" <td class=""Titulo""> Imagen</td> ")
|
|
' StrSB.Append(" <td><a class=""Texto"" href=""" & Direccion & "/Imagenes/Tareas/" & Imagen & "/" & Imagen & Attchment & """> Ver imagen</a></td> ")
|
|
' StrSB.Append(" </tr> ")
|
|
'End If
|
|
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td align=""center"" class=""Titulos"" colspan=""2""> Descripción</td> ")
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.AppendFormat(" <td colspan=""2"" class='texto'>{0}</td> ", Descripcion)
|
|
StrSB.Append(" </tr> ")
|
|
|
|
'Observaciones
|
|
Dim DT As DataTable = DTComentarios.FiltraParametros("", "FechaIng DESC")
|
|
|
|
If DT.Rows.Count > 0 Then
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td align=""center"" class=""Titulos"" colspan=""2""> Comentarios</td> ")
|
|
StrSB.Append(" </tr> ")
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.Append(" <td colspan=""2""> ")
|
|
StrSB.Append(" <table border=""1"" rules=""all"" style=""border-collapse: collapse;"" width=""100%""><tr class='texto' style='text-align:center;'><td>Fecha</td><td>Usuario</td><td>Comentario</td></tr> ")
|
|
For i As Integer = 0 To DT.Rows.Count - 1
|
|
|
|
StrSB.AppendFormat(" <tr class='{0}'> ", If(i Mod 2 = 0, "Texto", "TextoAlterno"))
|
|
StrSB.AppendFormat(" <td width=""100px"">{0}</td> ", DT.Rows(i)("FechaIng"))
|
|
StrSB.AppendFormat(" <td width=""150px"">{0}</td> ", DT.Rows(i)("Nombre"))
|
|
StrSB.AppendFormat(" <td>{0}</td> ", DT.Rows(i)("Comentario"))
|
|
StrSB.Append(" </tr> ")
|
|
Next
|
|
StrSB.Append(" </table> ")
|
|
StrSB.Append(" </td> ")
|
|
StrSB.Append(" </tr> ")
|
|
End If
|
|
DT.Dispose()
|
|
|
|
'Liga tarea
|
|
StrSB.Append(" <tr> ")
|
|
StrSB.AppendFormat(" <td align=""left"" class=""Texto"" colspan=""2""> <a class=""Texto"" href=""{0}{1}""> de click para ir al evento</a></td> ", DireccionURL, Variables)
|
|
StrSB.Append(" </tr> ")
|
|
|
|
StrSB.Append(" </table> ")
|
|
StrSB.Append(" </div> ")
|
|
StrSB.Append(" </form> ")
|
|
StrSB.Append("</body> ")
|
|
StrSB.Append("</html> ")
|
|
Return StrSB
|
|
End Function
|
|
Protected Sub cmdRevision_Click(sender As Object, e As EventArgs) Handles cmdRevision.Click
|
|
Dim OI As New ClsOIEventos
|
|
|
|
If OI.UpdateEstatusEvento(1, -1, CveEvento, UsuarioActual.CveUsuario) Then
|
|
GvObservaciones.DataSource = OI.DtResultados
|
|
GvObservaciones.DataBind()
|
|
UPPObs.Update()
|
|
UPPDatosObs.Update()
|
|
End If
|
|
OI.Dispose()
|
|
'Enviar correo
|
|
MandarMails(4)
|
|
|
|
End Sub
|
|
Protected Sub cmdTerminada_Click(sender As Object, e As EventArgs) Handles cmdTerminada.Click
|
|
Dim OI As New ClsOIEventos
|
|
|
|
If OI.UpdateEstatusEvento(2, -1, CveEvento, UsuarioActual.CveUsuario) Then
|
|
GvObservaciones.DataSource = OI.DtResultados
|
|
GvObservaciones.DataBind()
|
|
UPPObs.Update()
|
|
UPPDatosObs.Update()
|
|
End If
|
|
OI.Dispose()
|
|
'Enviar correo
|
|
MandarMails(3)
|
|
End Sub
|
|
Protected Sub cmdRevisada_Click(sender As Object, e As EventArgs) Handles cmdRevisada.Click
|
|
Dim OI As New ClsOIEventos
|
|
|
|
If OI.UpdateEstatusEvento(3, -1, CveEvento, UsuarioActual.CveUsuario) Then
|
|
GvObservaciones.DataSource = OI.DtResultados
|
|
GvObservaciones.DataBind()
|
|
UPPObs.Update()
|
|
UPPDatosObs.Update()
|
|
End If
|
|
OI.Dispose()
|
|
'Enviar correo
|
|
MandarMails(5)
|
|
End Sub
|
|
|
|
|
|
|
|
#Region "Cargar Cve's para agendar"
|
|
Private Sub CargaActivoFijo(CveActivoFijo As Integer)
|
|
Dim ObjClaves As New ClsAF
|
|
|
|
If ObjClaves.GetActivosFijos(CveActivoFijo, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, -1, "", -1) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = ObjClaves.Codigo & " - " & ObjClaves.Descripcion
|
|
End If
|
|
End If
|
|
ObjClaves.Dispose()
|
|
End Sub
|
|
Private Sub CargaIE(CveIE As Integer)
|
|
Dim ObjClaves As New ClsBancos
|
|
|
|
If ObjClaves.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = " Folio:" & ObjClaves.Folio
|
|
End If
|
|
End If
|
|
ObjClaves.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaProspecto(CveProspecto As Integer)
|
|
Dim ObjClaves As New ClsProspectos
|
|
|
|
' If ObjClaves.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
|
If ObjClaves.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = ObjClaves.NombreCompleto & " " & ObjClaves.Descripcion
|
|
End If
|
|
End If
|
|
ObjClaves.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaCliente(CveCliente As Integer)
|
|
Dim ObjClaves As New ClsClientes
|
|
|
|
If ObjClaves.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = ObjClaves.Nombre
|
|
End If
|
|
End If
|
|
ObjClaves.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaOS(CveOS As Integer)
|
|
Dim ObjClaves As New ClsOS
|
|
|
|
If ObjClaves.GetOrdenesServicios(CveOS, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = ObjClaves.Folio & " - " & ObjClaves.Descripcion
|
|
End If
|
|
End If
|
|
ObjClaves.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaOC(CveOC As Integer)
|
|
Dim ObjClaves As New ClsOC
|
|
|
|
If ObjClaves.GetOC(CveOC, UsuarioActual.CveEmpresa) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = ObjClaves.Descripcion & " - " & ObjClaves.Descripcion
|
|
End If
|
|
End If
|
|
ObjClaves.Dispose()
|
|
|
|
End Sub
|
|
Private Sub CargaPersonal(CvePersonal As Integer)
|
|
Dim ObjClaves As New ClsRH
|
|
|
|
If ObjClaves.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = ObjClaves.NombreCompleto
|
|
End If
|
|
End If
|
|
|
|
ObjClaves.Dispose()
|
|
End Sub
|
|
Private Sub CargaProveedor(CveProveedor As Integer)
|
|
|
|
'Dim ObjClaves As New ClsCompProveedores
|
|
' hacerlo con el global dt
|
|
'If ObjClaves.GetProveedores(CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
|
' If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
' LtlAgenda.Text = ObjClaves.CveProveedor & " - " & ObjClaves.NombreComercial
|
|
' End If
|
|
'End If
|
|
|
|
End Sub
|
|
Private Sub CargaUsuario(CveUsuario As Integer)
|
|
Dim ObjClaves As New ClsSisUsuarios
|
|
|
|
If ObjClaves.GetUsuarios(CveUsuario) Then
|
|
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
|
LtlAgenda.Text = ObjClaves.Usuario & " - " & ObjClaves.Nombre
|
|
End If
|
|
End If
|
|
ObjClaves.Dispose()
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub CargaContarto(CveContrato As Integer)
|
|
Dim ObjContrato As New ClsContratos
|
|
|
|
If ObjContrato.GetContratos(CveContrato, -1) Then
|
|
LtlAgenda.Text = ObjContrato.Usuario & " - " & ObjContrato.Nombre
|
|
End If
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
End Class
|