diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 2be1a8152..212594b67 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -112,12 +112,12 @@ Public Class ClsClasificaciones Public Sub Commit() If SqlTransacc IsNot Nothing Then SqlTransacc.Commit() SqlTransacc = Nothing - End Sub - - + End Sub + + #Region "C L A S I F I C A C I O N E S" - - + + Public Function GetClasificaciones(Optional CveEmpresa As Integer = -1, Optional Tipo As Integer = 1) As Boolean Dim Retorno As Boolean = False @@ -134,6 +134,46 @@ Public Class ClsClasificaciones OnError("Ocurrió un error al consultar las Clasificaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + Return Retorno + End Function + + Public Function GetClasificacionesComprobaciones(CveEmpresa As Integer, Optional Opcion As Integer = 1, Optional TipoComprobacion As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_ClasificacionesComprobacionesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@TipoComprobacion", SqlDbType.Int).Value = TipoComprobacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al consultar las Clasificaciones de comprobaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddClasificacionesComprobaciones(CveClasificacion As Integer, CveEmpresa As Integer, TipoComprobacion As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_ClasificacionesComprobacionesAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@TipoComprobacion", SqlDbType.Int).Value = TipoComprobacion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al modificar la clasificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno End Function diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index b1400d88a..5ec8dc12c 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -519,13 +519,14 @@ Public Class ClsClientes 'SqlAdapter.Dispose() Return Retorno End Function - Public Function GetHistorialVentas(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean + Public Function GetHistorialVentas(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional TipoDocto As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClienteHistorialVentas") SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente SqlAdapter.SelectCommand.Parameters.Add("@SelectTop", SqlDbType.Int).Value = SelectTop SqlAdapter.SelectCommand.Parameters.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal + SqlAdapter.SelectCommand.Parameters.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 85846866e..fe4714eff 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -851,14 +851,16 @@ Public Class ClsMovimientos Return Retorno End Function - Public Function GetChequesFYE(CveEmpresa As Integer) As Boolean + Public Function GetChequesFYE(CveEmpresa As Integer, Optional FechaI As DateTime = ModExtensiones.MinFecha, Optional FechaF As DateTime = ModExtensiones.MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_ReporteChequesFYEGet") With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@FechaF", SqlDbType.DateTime).Value = FechaF End With Try @@ -1278,14 +1280,16 @@ Public Class ClsMovimientos Return Retorno End Function - Public Function GetCxPPersonalCajaChica(CveEmpresa As Integer, CvePersonal As Integer, CveCajaChica As Integer, NumeroReembolso As String) As Boolean + Public Function GetCxPPersonalCajaChica(CveEmpresa As Integer, CvePersonal As Integer, CveCajaChica As Integer, NumeroReembolso As String, Optional FechaI As DateTime = ModExtensiones.MinFecha, Optional FechaF As DateTime = ModExtensiones.MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CxPPersonalCajaChica") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveCajaChica", SqlDbType.Int).Value = CveCajaChica - .Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso + .Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@FechaF", SqlDbType.DateTime).Value = FechaF End With Try diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index adbc2cd08..a6056e0b2 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -16,6 +16,37 @@ Public Enum OITipoEventos Soporte = 9 Gastos_Mes = 10 End Enum + +Public Class ObjEventosCorreo + Public Sub New(AsuntoCorreo As String, mailPara As String, ListPara As List(Of String), Folio As Integer, Link As String, Asunto As String, Descripcion As String, Fechai As String, Fechaf As String, Prioridad As String, Tema As String, Actividad As String, Estatus As String) + Me.AsuntoCorreo = AsuntoCorreo + Me.Folio = Folio + Me.Link = Link + Me.Asunto = Asunto + Me.Descripcion = Descripcion + Me.Fechai = Fechai + Me.Fechaf = Fechaf + Me.Prioridad = Prioridad + Me.Tema = Tema + Me.Actividad = Actividad + Me.Estatus = Estatus + Me.ListPara = ListPara + Me.mailPara = mailPara + End Sub + Public Property AsuntoCorreo As String + Public Property Folio As Integer + Public Property Link As String + Public Property Asunto As String + Public Property Descripcion As String + Public Property Fechai As String + Public Property Fechaf As String + Public Property Prioridad As String + Public Property Tema As String + Public Property Actividad As String + Public Property Estatus As String + Public Property mailPara As String + Public Property ListPara As List(Of String) +End Class Public Class ClsOIEventos Implements IDisposable @@ -144,11 +175,11 @@ Public Class ClsOIEventos DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name - .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) + .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString(), HttpContext.Current.Request.QueryString.ToString()) .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output End With SqlAdapter.Fill(Data) - CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero + CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString().ToEntero() Catch ex As Exception OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try @@ -180,13 +211,68 @@ Public Class ClsOIEventos Public Sub Commit() SqlTransacc.Commit() End Sub +#Region "Correo" + Private Function GetDominio() As String + Return HttpContext.Current.Request.Url.ToString().Replace(HttpContext.Current.Request.Url.PathAndQuery, "") + End Function + Public Property objCorreo As ObjEventosCorreo +#End Region #Region "oieventos2.0" - Public Function GetEventos2(cveEvento As Int32, CveEmpresa As Integer) As Boolean + Public Function GetEventosUsuario2(CveEvento As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OI_EventosUsuarios2Get") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Evento Usuario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpUsuarioseventosVisto(CveEvento As Integer, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("UPDATE OI_EventosUsuarios SET Visto=1 WHERE CveEvento =@CveEvento AND CveUsuario=@CveUsuario", CommandType.Text) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Evento Usuario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function GetEventos2(cveEvento As Int32, CveEmpresa As Integer, Optional CveEventoPadre As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_OI_Eventos2Get", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = cveEvento + .Add("@CveEventoPadre", SqlDbType.Int).Value = CveEventoPadre + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetTareaConHijos(cveEvento As Int32, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_GetTareaConHijos", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveEvento", SqlDbType.Int).Value = cveEvento .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -200,11 +286,38 @@ Public Class ClsOIEventos Return retorno End Function + Public Function AddEventoMinuta2(Asunto As String, Descripcion As String, Acuerdos As String, CveUsuarioDe As Integer, CveUsuarioPara As Integer, FechaInicio As DateTime, Archivo As String, Lmiembros As List(Of Integer), chkList As List(Of String), CveUsuarioIng As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + Retorno = AddOI_Eventos2(OITipoEventos.Minuta, Asunto, Descripcion, 3, -1, -1, String.Format("{0:yyyy/MM/dd HH:mm}", FechaInicio), "1900/01/01 00:00", -1, Archivo, Lmiembros, chkList, CveUsuarioIng, CveEmpresa, -1, Acuerdos) + 'Retorno = AddEvento(5, -1, Asunto, Descripcion, 1, -1, -1, FechaInicio, ("01/01/1799").ToDate, -1, -1, "-1", CveUsuarioIng, CveEmpresa, -1, -1, -1, -1, -1, -1, -1, -1) + Return Retorno + End Function Public Function AddOI_Eventos2(cveTipoEvento As OITipoEventos, asunto As String, descripcion As String, prioridad As Int32, cveUsuarioDe As Int32, cveUsuarioPara As Int32, - fechaInicio As String, fechaFin As String, cveRevision As Int32, archivo As String, cveUsuarioIng As Int32, cveEmpresa As Int32) As Boolean + fechaInicio As String, fechaFin As String, cveRevision As Int32, archivo As String, Lmiembros As List(Of Integer), chkList As List(Of String), + cveUsuarioIng As Int32, cveEmpresa As Int32, Optional CveEventoPadre As Integer = -1, Optional Acuerdos As String = Nothing, Optional CveAgendaTipo As Integer = -1) As Boolean Dim retorno As Boolean = False + + Dim xmlMiembros As System.Xml.Linq.XDocument = Nothing + 'xmlMiembros = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("CCPara", Lmiembros.Select(x >= New System.Xml.Linq.XElement("CveUsuario", x))) + If Lmiembros Is Nothing Then + Lmiembros = New List(Of Integer) + End If + If Not cveUsuarioPara.Contiene(Lmiembros.ToArray()) Then + Lmiembros.Add(cveUsuarioPara) + End If + If Not cveUsuarioDe.Contiene(Lmiembros.ToArray()) Then + Lmiembros.Add(cveUsuarioDe) + End If + xmlMiembros = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("CCPara", Lmiembros.[Select](Function(x) New System.Xml.Linq.XElement("CveUsuario", x)))) + + Dim xmlChkList As System.Xml.Linq.XDocument = Nothing + If chkList IsNot Nothing AndAlso chkList.Count > 0 Then + xmlChkList = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("CheckList", chkList.[Select](Function(x) New System.Xml.Linq.XElement("Actividad", x)))) + End If + + DataAdapter("PA_OI_Eventos2Add", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveEvento", SqlDbType.Int).Direction = ParameterDirection.Output @@ -220,39 +333,168 @@ Public Class ClsOIEventos .Add("@cveRevision", SqlDbType.Int).Value = cveRevision .Add("@archivo", SqlDbType.VarChar).Value = archivo .Add("@cveUsuarioIng", SqlDbType.Int).Value = cveUsuarioIng + .Add("@xmlMiembros", SqlDbType.Xml).Value = If(xmlMiembros Is Nothing, DBNull.Value, DirectCast(xmlMiembros.ToString(), Object)) + .Add("@xmlChkList", SqlDbType.Xml).Value = If(xmlChkList Is Nothing, DBNull.Value, DirectCast(xmlChkList.ToString(), Object)) .Add("@cveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@CveEventoPadre", SqlDbType.Int).Value = CveEventoPadre + .Add("@Acuerdos", SqlDbType.VarChar).Value = If(Acuerdos Is Nothing, DBNull.Value, DirectCast(Acuerdos, Object)) + .Add("@CveAgendaTipo", SqlDbType.Int).Value = CveAgendaTipo + '.Add("@mailPara", SqlDbType.VarChar).Direction = ParameterDirection.Output + '.Add("@mailBody", SqlDbType.Xml).Direction = ParameterDirection.Output End With + + Dim separador As String = "" + Dim lPara As New List(Of String) + Dim mailbody As String = "" + Dim mailPara As String = "" + Dim ds As New DataSet() + Dim drow As DataRow = Nothing Try - SqlAdapter.Fill(Data) + + SqlAdapter.Fill(ds) + If ds.Tables.Count > 0 Then + Data = ds.Tables(0) + End If + If ds.Tables.Count > 1 AndAlso ds.Tables(1).Rows.Count > 0 Then + drow = ds.Tables(1).Rows(0) + End If + CveEvento = SqlAdapter.SelectCommand.Parameters("@CveEvento").Value.ToString().ToEntero() Folio = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString().ToEntero() + 'mailbody = SqlAdapter.SelectCommand.Parameters("@mailBody").Value.ToString() + 'mailPara = SqlAdapter.SelectCommand.Parameters("@mailPara").Value.ToString() + + If DtResultados.Rows.Count > 0 Then + For Each item As DataRow In DtResultados.Rows + lPara.Add(item("CveUsuario").ToString()) + mailPara = String.Format("{0}{1}{2}", mailPara, separador, item("Correo").ToString()) + separador = "," + Next + End If retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al agregar el Evento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Try + If retorno AndAlso lPara.Count > 0 AndAlso drow IsNot Nothing Then + 'Notificaciones.AlertaVentana(String.Format("Folio :{1}", GetDominio(), Folio, CveEvento), lPara, "NUEVA TAREA ASIGNADA") + objCorreo = New ObjEventosCorreo("Nueva Tarea asignada", mailPara, lPara, Folio, String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), asunto, descripcion, String.Format("{0:dd/MM/yyyy HH:mm}", fechaInicio.ToDateTime()), String.Format("{0:dd/MM/yyyy HH:mm}", fechaFin.ToDateTime()), drow("Prioridad").ToString(), drow("Tema").ToString(), "", "") + 'mailbody = MailgetBodyNuevatarea(Folio, String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), asunto, descripcion, String.Format("{0:dd/MM/yyyy HH:mm}", fechaInicio.ToDateTime()), String.Format("{0:dd/MM/yyyy HH:mm}", fechaFin.ToDateTime()), drow("Prioridad").ToString(), drow("Tema").ToString()) + 'Dim mailAsunto As String = "Nueva Tarea asignada" ',cveUsuarioPara + 'Dim mailArrayCC As String = "" + 'EnviarCorreo(oempresa, mailAsunto, mailbody, mailPara, mailArrayCC) + End If + Catch ex As Exception + End Try Return retorno End Function - Public Function UpdateEstatusEvento2(CveEventoEstatus As Integer, CveComentario As Integer, CveEvento As Integer, CveUsuario As Integer) As Boolean + Public Function UP_Eventos2(CveEvento As Integer, asunto As String, descripcion As String, prioridad As Int32, fechaInicio As String, fechaFin As String, + cveRevision As Int32, cveUsuarioIng As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_Eventos2Up", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@asunto", SqlDbType.VarChar).Value = asunto + .Add("@descripcion", SqlDbType.VarChar).Value = descripcion + .Add("@prioridad", SqlDbType.Int).Value = prioridad + .Add("@fechaInicio", SqlDbType.VarChar).Value = fechaInicio + .Add("@fechaFin", SqlDbType.VarChar).Value = fechaFin + .Add("@cveRevision", SqlDbType.Int).Value = cveRevision + .Add("@cveUsuarioIng", SqlDbType.Int).Value = cveUsuarioIng + .Add("@cveEmpresa", SqlDbType.Int).Value = cveEmpresa + End With + + Dim separador As String = "" + Dim lPara As New List(Of String) + Dim mailbody As String = "" + Dim mailPara As String = "" + Dim ds As New DataSet() + Dim drow As DataRow = Nothing + Dim CveUsuarioPara As Integer = 0 + Try + SqlAdapter.Fill(ds) + + If ds.Tables.Count > 0 Then + Data = ds.Tables(0) + End If + If ds.Tables.Count > 1 AndAlso ds.Tables(1).Rows.Count > 0 Then + drow = ds.Tables(1).Rows(0) + End If + If DtResultados.Rows.Count > 0 Then + For Each item As DataRow In DtResultados.Rows + lPara.Add(item("CveUsuario").ToString()) + mailPara = String.Format("{0}{1}{2}", mailPara, separador, item("Correo").ToString()) + separador = "," + Next + End If + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el Catálogo de Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + If retorno AndAlso lPara.Count > 0 AndAlso drow IsNot Nothing Then + objCorreo = New ObjEventosCorreo("Tarea Actualizada", mailPara, lPara, Folio, String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), asunto, descripcion, String.Format("{0:dd/MM/yyyy HH:mm}", fechaInicio.ToDateTime()), String.Format("{0:dd/MM/yyyy HH:mm}", fechaFin.ToDateTime()), drow("Prioridad").ToString(), drow("Tema").ToString(), "", "") + 'Notificaciones.AlertaVentana(String.Format("Folio :{1}", GetDominio(), Folio, CveEvento), lPara, "TAREA ACTUALIZADA") + 'mailbody = MailgetBodyActualizartarea(Folio, String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), asunto, descripcion, String.Format("{0:dd/MM/yyyy HH:mm}", fechaInicio.ToDateTime()), String.Format("{0:dd/MM/yyyy HH:mm}", fechaFin.ToDateTime()), drow("Prioridad").ToString(), drow("Tema").ToString()) + 'Dim mailAsunto As String = "Tarea Actualizada" ',cveUsuarioPara + 'Dim mailArrayCC As String = "" + 'EnviarCorreo(oempresa, mailAsunto, mailbody, mailPara, mailArrayCC) + End If + Return retorno + End Function + + + Public Function UpdateEstatusEvento2(CveEventoEstatus As Integer, CveComentario As Integer, CveEvento As Integer, CveUsuario As Integer, cveEmpresa As Int32) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OI_EventosEstatusUpdate2") + Dim separador As String = "" + Dim lPara As New List(Of String) + Dim mailbody As String = "" + Dim mailPara As String = "" + Dim ds As New DataSet() + Dim drow As DataRow = Nothing With SqlAdapter.SelectCommand.Parameters .Add("@pCveEventoEstatus", SqlDbType.Int).Value = CveEventoEstatus .Add("@pCveComentario", SqlDbType.Int).Value = CveComentario .Add("@pCveEvento", SqlDbType.Int).Value = CveEvento .Add("@pCveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa End With Try - SqlAdapter.Fill(Data) + SqlAdapter.Fill(ds) + + If ds.Tables.Count > 0 Then + Data = ds.Tables(0) + End If + If ds.Tables.Count > 1 AndAlso ds.Tables(1).Rows.Count > 0 Then + drow = ds.Tables(1).Rows(0) + End If + If DtResultados.Rows.Count > 0 Then + For Each item As DataRow In DtResultados.Rows + lPara.Add(item("CveUsuario").ToString()) + mailPara = String.Format("{0}{1}{2}", mailPara, separador, item("Correo").ToString()) + separador = "," + Next + End If Retorno = True Catch ex As Exception OnError("Ocurrió un error al actualizar el estatus en el Evento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + If Retorno AndAlso lPara.Count > 0 AndAlso drow IsNot Nothing Then + objCorreo = New ObjEventosCorreo("Tarea Cambio de estatus", mailPara, lPara, drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString(), "", drow("Estatus").ToString()) + 'Notificaciones.AlertaVentana(String.Format("Folio :{1}", GetDominio(), drow("Folio").ToString().ToEntero(), CveEvento), lPara, String.Format("CAMBIÓ ESTADO EN TAREA A '{0}'", drow("Estatus"))) + 'mailbody = MailgetBodyActualizarEstado(drow("Estatus").ToString(), drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString()) + 'Dim mailAsunto As String = "Tarea Cambio de estatus" ',cveUsuarioPara + 'Dim mailArrayCC As String = "" + 'EnviarCorreo(oempresa, mailAsunto, mailbody, mailPara, mailArrayCC) + End If Return Retorno End Function @@ -289,7 +531,7 @@ Public Class ClsOIEventos End Try Return retorno End Function - Public Function Upcheklist(cveEventoCheckList As Int32, cveEvento As Int32, eventoComentario As String, estatus As Boolean, cveUsuario As Int32) As Boolean + Public Function Upcheklist(cveEventoCheckList As Int32, cveEvento As Int32, eventoComentario As String, estatus As Boolean, cveUsuario As Int32, CveEmpresa As Int32) As Boolean Dim retorno As Boolean = False DataAdapter("PA_OI_cheklistUp", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -298,13 +540,47 @@ Public Class ClsOIEventos .Add("@eventoComentario", SqlDbType.VarChar).Value = eventoComentario .Add("@estatus", SqlDbType.Bit).Value = estatus .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With + + Dim separador As String = "" + Dim lPara As New List(Of String) + Dim mailbody As String = "" + Dim mailPara As String = "" + Dim ds As New DataSet() + Dim drow As DataRow = Nothing Try - SqlAdapter.Fill(Data) + + SqlAdapter.Fill(ds) + + If ds.Tables.Count > 0 Then + Data = ds.Tables(0) + End If + If ds.Tables.Count > 1 AndAlso ds.Tables(1).Rows.Count > 0 Then + drow = ds.Tables(1).Rows(0) + End If + If DtResultados.Rows.Count > 0 Then + For Each item As DataRow In DtResultados.Rows + lPara.Add(item("CveUsuario").ToString()) + mailPara = String.Format("{0}{1}{2}", mailPara, separador, item("Correo").ToString()) + separador = "," + Next + End If retorno = True Catch ex As Exception OnError("Ocurrió un error al actualizar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + + + + If retorno AndAlso lPara.Count > 0 AndAlso drow IsNot Nothing Then + objCorreo = New ObjEventosCorreo(String.Format("Actividad {0}", If(estatus, "Terminada", "Pendiente")), mailPara, lPara, drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), cveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString(), String.Format("Actividad {0}", If(estatus, "Terminada", "Pendiente")), "") + 'Notificaciones.AlertaVentana(String.Format("Folio :{1}", GetDominio(), drow("Folio").ToString().ToEntero(), cveEvento), lPara, "TAREA ACTUALIZADA(Nuevo Archivo)") + 'mailbody = MailgetBodyTareaCheckList(String.Format("Actividad {0}", If(estatus, "Terminada", "Pendiente")), drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), cveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString()) + 'Dim mailAsunto As String = String.Format("Actividad {0}", If(estatus, "Terminada", "Pendiente")) + 'Dim mailArrayCC As String = "" + 'EnviarCorreo(oempresa, mailAsunto, mailbody, mailPara, mailArrayCC) + End If Return retorno End Function Public Function Removecheklist(cveEventoCheckList As Int32, cveEvento As Int32, cveUsuario As Int32) As Boolean @@ -325,46 +601,167 @@ Public Class ClsOIEventos End Function #End Region - Public Function AddUPEventoArchivo(CveEvento As Integer, Archivo As String, CveUsuario As Integer) As Boolean + Public Function AddUPEventoArchivo(CveEvento As Integer, Archivo As String, CveUsuario As Integer, cveEmpresa As Int32) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OI_EventosArchivoAddUP") With SqlAdapter.SelectCommand.Parameters .Add("@CveEvento", SqlDbType.Int).Value = CveEvento .Add("@Archivo", SqlDbType.VarChar).Value = Archivo .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa End With + + Dim separador As String = "" + Dim lPara As New List(Of String) + Dim mailbody As String = "" + Dim mailPara As String = "" + Dim ds As New DataSet() + Dim drow As DataRow = Nothing Try - SqlAdapter.Fill(Data) + + SqlAdapter.Fill(ds) + + If ds.Tables.Count > 0 Then + Data = ds.Tables(0) + End If + If ds.Tables.Count > 1 AndAlso ds.Tables(1).Rows.Count > 0 Then + drow = ds.Tables(1).Rows(0) + End If + If DtResultados.Rows.Count > 0 Then + For Each item As DataRow In DtResultados.Rows + lPara.Add(item("CveUsuario").ToString()) + mailPara = String.Format("{0}{1}{2}", mailPara, separador, item("Correo").ToString()) + separador = "," + Next + End If Retorno = True Catch Ex1 As SqlException Retorno = False - Me.OnError("Ocurrió un error al Guardar el comentario del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al Guardar el archivo del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception Retorno = False - OnError("Ocurrió un error al Guardar el Evento Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al Guardar el archivo Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + If Retorno AndAlso lPara.Count > 0 AndAlso drow IsNot Nothing Then + objCorreo = New ObjEventosCorreo("Tarea Archivo actualizado", mailPara, lPara, drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString(), "", "") + 'Notificaciones.AlertaVentana(String.Format("Folio :{1}", GetDominio(), drow("Folio").ToString().ToEntero(), CveEvento), lPara, "TAREA ACTUALIZADA(Nuevo Archivo)") + 'mailbody = MailgetBodyActualizararchivo(drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString()) + 'Dim mailAsunto As String = "Tarea Archivo actualizado" ',cveUsuarioPara + 'Dim mailArrayCC As String = "" + 'EnviarCorreo(oempresa, mailAsunto, mailbody, mailPara, mailArrayCC) + End If Return Retorno End Function - Public Function UPEventoAAvance(CveEvento As Integer, Avance As Decimal, CveUsuario As Integer) As Boolean + Public Function UPEventoAAvance(CveEvento As Integer, Avance As Decimal, CveUsuario As Integer, cveEmpresa As Int32) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OI_EventosAvanceUP") With SqlAdapter.SelectCommand.Parameters .Add("@CveEvento", SqlDbType.Int).Value = CveEvento .Add("@Avance", SqlDbType.Decimal).Value = Avance .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa End With + + Dim separador As String = "" + Dim lPara As New List(Of String) + Dim mailbody As String = "" + Dim mailPara As String = "" + Dim ds As New DataSet() + Dim drow As DataRow = Nothing Try - SqlAdapter.Fill(Data) + SqlAdapter.Fill(ds) + + If ds.Tables.Count > 1 Then + Data = ds.Tables(1) + End If + If ds.Tables.Count > 2 AndAlso ds.Tables(2).Rows.Count > 0 Then + drow = ds.Tables(2).Rows(0) + End If + If DtResultados.Rows.Count > 0 Then + For Each item As DataRow In DtResultados.Rows + lPara.Add(item("CveUsuario").ToString()) + mailPara = String.Format("{0}{1}{2}", mailPara, separador, item("Correo").ToString()) + separador = "," + Next + End If + If ds.Tables.Count > 0 Then + Data = ds.Tables(0) + End If Retorno = True Catch Ex1 As SqlException Retorno = False - Me.OnError("Ocurrió un error al Guardar el comentario del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al Guardar el Avance del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception Retorno = False + OnError("Ocurrió un error al Guardar el Avance Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + If Retorno AndAlso lPara.Count > 0 AndAlso drow IsNot Nothing Then + objCorreo = New ObjEventosCorreo("Tarea cambio Avance", mailPara, lPara, drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString(), "", "") + 'Notificaciones.AlertaVentana(String.Format("Folio :{1}", GetDominio(), drow("Folio").ToString().ToEntero(), CveEvento), lPara, "TAREA ACTUALIZADA(Nuevo Archivo)") + 'mailbody = MailgetBodyActualizarAvance(drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString()) + 'Dim mailAsunto As String = "Tarea cambio Avance" ',cveUsuarioPara + 'Dim mailArrayCC As String = "" + 'EnviarCorreo(oempresa, mailAsunto, mailbody, mailPara, mailArrayCC) + End If + Return Retorno + End Function + + + Public Function AddEventoComentario2(CveEvento As Integer, Comentario As String, Archivo As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer + Dim Retorno As Integer = -1 + DataAdapter("PA_OI_EventosComentarios2Add") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@EventoComentario", SqlDbType.VarChar).Value = Comentario + .Add("@Archivo", SqlDbType.VarChar).Value = Archivo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEventoComentario", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Dim separador As String = "" + Dim lPara As New List(Of String) + Dim mailbody As String = "" + Dim mailPara As String = "" + Dim ds As New DataSet() + Dim drow As DataRow = Nothing + Try + + SqlAdapter.Fill(ds) + + If ds.Tables.Count > 0 Then + Data = ds.Tables(0) + End If + If ds.Tables.Count > 1 AndAlso ds.Tables(1).Rows.Count > 0 Then + drow = ds.Tables(1).Rows(0) + End If + + CveEventoComentario = SqlAdapter.SelectCommand.Parameters("@CveEventoComentario").Value.ToString().ToEntero() + Retorno = CveEventoComentario + If DtResultados.Rows.Count > 0 Then + For Each item As DataRow In DtResultados.Rows + lPara.Add(item("CveUsuario").ToString()) + mailPara = String.Format("{0}{1}{2}", mailPara, separador, item("Correo").ToString()) + separador = "," + Next + End If + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al Guardar el comentario del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception OnError("Ocurrió un error al Guardar el Evento Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + If Retorno > 0 AndAlso lPara.Count > 0 AndAlso drow IsNot Nothing Then + objCorreo = New ObjEventosCorreo("Nuevo comentario en tarea", mailPara, lPara, drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString(), "", "") + 'Notificaciones.AlertaVentana(String.Format("Folio :{1}", GetDominio(), drow("Folio").ToString().ToEntero(), CveEvento), lPara, "TAREA ACTUALIZADA(Nuevo Archivo)") + 'mailbody = MailgetBodyTareaComentario(drow("Folio").ToString().ToEntero(), String.Format("{0}OI/TareaDetalle.aspx?CveEvento={1}", GetDominio(), CveEvento), drow("Asunto").ToString(), drow("Descripcion").ToString(), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaInicio")), String.Format("{0:dd/MM/yyyy HH:mm}", drow("FechaFin")), drow("Prioridad").ToString(), drow("Tema").ToString()) + 'Dim mailAsunto As String = "Nuevo comentario en tarea" ',cveUsuarioPara + 'Dim mailArrayCC As String = "" + 'EnviarCorreo(oempresa, mailAsunto, mailbody, mailPara, mailArrayCC) + End If Return Retorno End Function #End Region @@ -521,65 +918,65 @@ Public Class ClsOIEventos 'If CveEvento > 0 AndAlso Data IsNot Nothing AndAlso Data.Rows.Count > 0 Then If Data.Rows.Count > 0 Then - Me.CveEvento = Data.Rows(0)("CveEvento").ToString.ToEntero - Me.CveTipoEvento = Data.Rows(0)("CveTipoEvento").ToString.ToEntero - Me.Folio = Data.Rows(0)("Folio").ToString.ToEntero - Me.CveAgendaTipo = Data.Rows(0)("CveAgendaTipo").ToString.ToEntero - Me.TipoEvento = Data.Rows(0)("TipoEvento").ToString - Me.Asunto = Data.Rows(0)("Asunto").ToString - Me.Descripcion = Data.Rows(0)("Descripcion").ToString - Me.Prioridad = Data.Rows(0)("Prioridad").ToString - Me.CvePrioridad = Data.Rows(0)("CvePrioridad").ToString.ToEntero - Me.CveUsuarioDe = Data.Rows(0)("CveUsuarioDe").ToString.ToEntero - Me.CorreoDe = Data.Rows(0)("CorreoDe").ToString - Me.UsuarioDe = Data.Rows(0)("UsuarioDe").ToString - Me.CveUsuarioPara = Data.Rows(0)("CveUsuarioPara").ToString.ToEntero - Me.UsuarioPara = Data.Rows(0)("UsuarioPara").ToString - Me.CorreoPara = Data.Rows(0)("CorreoPara").ToString - Me.CveEventoEstatus = Data.Rows(0)("CveEventoEstatus").ToString.ToEntero - Me.EventoEstatus = Data.Rows(0)("EventoEstatus").ToString - Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString.ToDate - Me.FechaFin = Data.Rows(0)("FechaFin").ToString.ToDate - Me.FechaRealTermino = Data.Rows(0)("FechaRealTermino").ToString.ToDate - Me.CveEventoPadre = Data.Rows(0)("CveEventoPadre").ToString.ToEntero - Me.Orden = Data.Rows(0)("Orden").ToString.ToDouble - Me.CveRevision = Data.Rows(0)("CveRevision").ToString.ToEntero - Me.Acuerdos = Data.Rows(0)("Acuerdos").ToString - Me.Revision = Data.Rows(0)("Revision").ToString - 'Me.TipoReferencia = Data.Rows(0)("TipoReferencia").ToString - 'Me.Referencia = Data.Rows(0)("Referencia").ToString - Me.Archivo = Data.Rows(0)("Archivo").ToString - 'Me.CveSeguimiento = Data.Rows(0)("CveSeguimiento").ToString.ToEntero - Me.CveOC = Data.Rows(0)("CveOC").ToString.ToEntero - Me.CveUsuarioIng = Data.Rows(0)("CveUsuarioIng").ToString.ToEntero - Me.UsuarioIng = Data.Rows(0)("UsuarioIng").ToString - Me.RolIngreso = Data.Rows(0)("RolIngreso").ToString.ToEntero - Me.FechaIng = Data.Rows(0)("FechaIng").ToString.ToDate - Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero - Me.Modificada = CBool(Data.Rows(0)("Modificado").ToString) - Me.CveCompra = Data.Rows(0)("CveCompra").ToString.ToEntero - Me.CveVenta = Data.Rows(0)("CveVenta").ToString.ToEntero + Me.CveEvento = Data.Rows(0)("CveEvento").ToString().ToEntero() + Me.CveTipoEvento = Data.Rows(0)("CveTipoEvento").ToString().ToEntero() + Me.Folio = Data.Rows(0)("Folio").ToString().ToEntero() + Me.CveAgendaTipo = Data.Rows(0)("CveAgendaTipo").ToString().ToEntero() + Me.TipoEvento = Data.Rows(0)("TipoEvento").ToString() + Me.Asunto = Data.Rows(0)("Asunto").ToString() + Me.Descripcion = Data.Rows(0)("Descripcion").ToString() + Me.Prioridad = Data.Rows(0)("Prioridad").ToString() + Me.CvePrioridad = Data.Rows(0)("CvePrioridad").ToString().ToEntero() + Me.CveUsuarioDe = Data.Rows(0)("CveUsuarioDe").ToString().ToEntero() + Me.CorreoDe = Data.Rows(0)("CorreoDe").ToString() + Me.UsuarioDe = Data.Rows(0)("UsuarioDe").ToString() + Me.CveUsuarioPara = Data.Rows(0)("CveUsuarioPara").ToString().ToEntero() + Me.UsuarioPara = Data.Rows(0)("UsuarioPara").ToString() + Me.CorreoPara = Data.Rows(0)("CorreoPara").ToString() + Me.CveEventoEstatus = Data.Rows(0)("CveEventoEstatus").ToString().ToEntero() + Me.EventoEstatus = Data.Rows(0)("EventoEstatus").ToString() + Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString().ToDate + Me.FechaFin = Data.Rows(0)("FechaFin").ToString().ToDate + Me.FechaRealTermino = Data.Rows(0)("FechaRealTermino").ToString().ToDate + Me.CveEventoPadre = Data.Rows(0)("CveEventoPadre").ToString().ToEntero() + Me.Orden = Data.Rows(0)("Orden").ToString().ToDouble + Me.CveRevision = Data.Rows(0)("CveRevision").ToString().ToEntero() + Me.Acuerdos = Data.Rows(0)("Acuerdos").ToString() + Me.Revision = Data.Rows(0)("Revision").ToString() + 'Me.TipoReferencia = Data.Rows(0)("TipoReferencia").ToString() + 'Me.Referencia = Data.Rows(0)("Referencia").ToString() + Me.Archivo = Data.Rows(0)("Archivo").ToString() + 'Me.CveSeguimiento = Data.Rows(0)("CveSeguimiento").ToString().ToEntero() + Me.CveOC = Data.Rows(0)("CveOC").ToString().ToEntero() + Me.CveUsuarioIng = Data.Rows(0)("CveUsuarioIng").ToString().ToEntero() + Me.UsuarioIng = Data.Rows(0)("UsuarioIng").ToString() + Me.RolIngreso = Data.Rows(0)("RolIngreso").ToString().ToEntero() + Me.FechaIng = Data.Rows(0)("FechaIng").ToString().ToDate + Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString().ToEntero() + Me.Modificada = CBool(Data.Rows(0)("Modificado").ToString()) + Me.CveCompra = Data.Rows(0)("CveCompra").ToString().ToEntero() + Me.CveVenta = Data.Rows(0)("CveVenta").ToString().ToEntero() - Me.CveUsuarioSop = Data.Rows(0)("CveUsuarioSop").ToString.ToEntero - Me.Persona = Data.Rows(0)("Persona").ToString - Me.Telefono = Data.Rows(0)("Telefono").ToString - Me.Extension = Data.Rows(0)("Extension").ToString - Me.Clasificacion = Data.Rows(0)("Clasificacion").ToString.ToEntero - Me.Email = Data.Rows(0)("Email").ToString - Me.EmpresaSop = Data.Rows(0)("EmpresaSop").ToString - Me.Modulo = Data.Rows(0)("Modulo").ToString - Me.Datos = Data.Rows(0)("Datos").ToString - If Data.Rows(0)("Desarrollo").ToString.Length > 0 Then - Me.Desarrollo = If(Boolean.Parse(Data.Rows(0)("Desarrollo").ToString), 1, 0) + Me.CveUsuarioSop = Data.Rows(0)("CveUsuarioSop").ToString().ToEntero() + Me.Persona = Data.Rows(0)("Persona").ToString() + Me.Telefono = Data.Rows(0)("Telefono").ToString() + Me.Extension = Data.Rows(0)("Extension").ToString() + Me.Clasificacion = Data.Rows(0)("Clasificacion").ToString().ToEntero() + Me.Email = Data.Rows(0)("Email").ToString() + Me.EmpresaSop = Data.Rows(0)("EmpresaSop").ToString() + Me.Modulo = Data.Rows(0)("Modulo").ToString() + Me.Datos = Data.Rows(0)("Datos").ToString() + If Data.Rows(0)("Desarrollo").ToString().Length > 0 Then + Me.Desarrollo = If(Boolean.Parse(Data.Rows(0)("Desarrollo").ToString()), 1, 0) Else Me.Desarrollo = 0 End If - Me.CveEmpresaSop = Data.Rows(0)("CveEmpresaSop").ToString.ToEntero - Me.CveModulo = Data.Rows(0)("CveModulo").ToString.ToEntero + Me.CveEmpresaSop = Data.Rows(0)("CveEmpresaSop").ToString().ToEntero() + Me.CveModulo = Data.Rows(0)("CveModulo").ToString().ToEntero() - Me.Importe = Data.Rows(0)("Importe").ToString.ToDouble + Me.Importe = Data.Rows(0)("Importe").ToString().ToDouble End If Retorno = True @@ -675,7 +1072,7 @@ Public Class ClsOIEventos Try SqlAdapter.Fill(Data) - CveEvento = SqlAdapter.SelectCommand.Parameters("@CveEvento").Value.ToString.ToEntero + CveEvento = SqlAdapter.SelectCommand.Parameters("@CveEvento").Value.ToString().ToEntero() Retorno = True Catch ex As Exception OnError("Ocurrió un error al Guardar el Evento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) @@ -850,6 +1247,33 @@ Public Class ClsOIEventos Return Retorno End Function + Public Function UpEventoMiembros(pCveEvento As Integer, CveUsuarioPara As Integer, Lmiembros As List(Of Integer), CveEmpresa As Integer, CveUsuarioEdito As Integer) As Boolean + Dim Retorno As Boolean = False + Dim xmlMiembros As System.Xml.Linq.XDocument = Nothing + 'xmlMiembros = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("CCPara", Lmiembros.Select(x >= New System.Xml.Linq.XElement("CveUsuario", x))) + If Lmiembros IsNot Nothing AndAlso Lmiembros.Count > 0 Then + If Not CveUsuarioPara.Contiene(Lmiembros.ToArray()) Then + Lmiembros.Add(CveUsuarioPara) + End If + xmlMiembros = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("CCPara", Lmiembros.[Select](Function(x) New System.Xml.Linq.XElement("CveUsuario", x)))) + End If + DataAdapter("PA_OI_EventosMiembrosUp") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = pCveEvento + .Add("@CveUsuarioPara", SqlDbType.Int).Value = CveUsuarioPara + .Add("@xmlMiembros", SqlDbType.Xml).Value = If(xmlMiembros Is Nothing, DBNull.Value, DirectCast(xmlMiembros.ToString(), Object)) + .Add("@CveUsuarioEdito", SqlDbType.Int).Value = CveUsuarioEdito + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al acualizar miembros los miembros del evento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function AddEventoUsuario(pCveEvento As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False @@ -916,12 +1340,12 @@ Public Class ClsOIEventos SqlAdapter.Fill(Data) If CveSeguimiento > 0 AndAlso Data IsNot Nothing AndAlso Data.Rows.Count > 0 Then - Me.CveSeguimiento = Data.Rows(0)("CveEventoComentario").ToString.ToEntero - Me.CveEvento = Data.Rows(0)("CveEvento").ToString.ToEntero - Me.Comentario = Data.Rows(0)("EventoComentario").ToString - Me.Archivo = Data.Rows(0)("Archivo").ToString - Me.FechaIng = Data.Rows(0)("FechaIng").ToString.ToDate - Me.UsuarioDe = Data.Rows(0)("Usuario").ToString + Me.CveSeguimiento = Data.Rows(0)("CveEventoComentario").ToString().ToEntero() + Me.CveEvento = Data.Rows(0)("CveEvento").ToString().ToEntero() + Me.Comentario = Data.Rows(0)("EventoComentario").ToString() + Me.Archivo = Data.Rows(0)("Archivo").ToString() + Me.FechaIng = Data.Rows(0)("FechaIng").ToString().ToDate + Me.UsuarioDe = Data.Rows(0)("Usuario").ToString() End If Retorno = True @@ -949,7 +1373,7 @@ Public Class ClsOIEventos Try SqlAdapter.Fill(Data) - CveEventoComentario = SqlAdapter.SelectCommand.Parameters("@CveEventoComentario").Value.ToString.ToEntero + CveEventoComentario = SqlAdapter.SelectCommand.Parameters("@CveEventoComentario").Value.ToString().ToEntero() Retorno = CveEventoComentario Catch Ex1 As SqlException @@ -1186,36 +1610,36 @@ Public Class ClsOIEventos If Data.Rows.Count > 0 Then - Me.CveEvento = Data.Rows(0)("CveEvento").ToString.ToEntero - Me.CveTipoEvento = Data.Rows(0)("CveTipoEvento").ToString.ToEntero - 'Me.CveAgendaTipo = Data.Rows(0)("CveAgendaTipo").ToString.ToEntero - 'Me.TipoEvento = Data.Rows(0)("EventoTipo").ToString - Me.Asunto = Data.Rows(0)("Asunto").ToString - Me.Descripcion = Data.Rows(0)("Descripcion").ToString - Me.Prioridad = Data.Rows(0)("Prioridad").ToString - Me.CvePrioridad = Data.Rows(0)("CvePrioridad").ToString.ToEntero - Me.CveUsuarioDe = Data.Rows(0)("CveUsuarioDe").ToString.ToEntero - 'Me.CorreoDe = Data.Rows(0)("CorreoDe").ToString - Me.UsuarioDe = Data.Rows(0)("UsuarioDe").ToString - Me.CveUsuarioPara = Data.Rows(0)("CveUsuarioPara").ToString.ToEntero - Me.UsuarioPara = Data.Rows(0)("UsuarioPara").ToString - 'Me.CorreoPara = Data.Rows(0)("CorreoPara").ToString - Me.CveEventoEstatus = Data.Rows(0)("CveEventoEstatus").ToString.ToEntero - Me.EventoEstatus = Data.Rows(0)("EventoEstatus").ToString - Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString.ToDate - Me.FechaFin = Data.Rows(0)("FechaFin").ToString.ToDate - Me.FechaRealTermino = Data.Rows(0)("FechaRealTermino").ToString.ToDate - Me.CveEventoPadre = Data.Rows(0)("CveEventoPadre").ToString.ToEntero - 'Me.Orden = Data.Rows(0)("Orden").ToString.ToEntero - Me.CveRevision = Data.Rows(0)("CveRevision").ToString.ToEntero - Me.Acuerdos = Data.Rows(0)("Acuerdos").ToString - 'Me.Revision = Data.Rows(0)("Revision").ToString - 'Me.TipoReferencia = Data.Rows(0)("TipoReferencia").ToString - 'Me.Referencia = Data.Rows(0)("Referencia").ToString - 'Me.Archivo = Data.Rows(0)("Archivo").ToString - 'Me.CveSeguimiento = Data.Rows(0)("CveSeguimiento").ToString.ToEntero - Me.FechaIng = Data.Rows(0)("FechaIng").ToString.ToDate - Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero + Me.CveEvento = Data.Rows(0)("CveEvento").ToString().ToEntero() + Me.CveTipoEvento = Data.Rows(0)("CveTipoEvento").ToString().ToEntero() + 'Me.CveAgendaTipo = Data.Rows(0)("CveAgendaTipo").ToString().ToEntero() + 'Me.TipoEvento = Data.Rows(0)("EventoTipo").ToString() + Me.Asunto = Data.Rows(0)("Asunto").ToString() + Me.Descripcion = Data.Rows(0)("Descripcion").ToString() + Me.Prioridad = Data.Rows(0)("Prioridad").ToString() + Me.CvePrioridad = Data.Rows(0)("CvePrioridad").ToString().ToEntero() + Me.CveUsuarioDe = Data.Rows(0)("CveUsuarioDe").ToString().ToEntero() + 'Me.CorreoDe = Data.Rows(0)("CorreoDe").ToString() + Me.UsuarioDe = Data.Rows(0)("UsuarioDe").ToString() + Me.CveUsuarioPara = Data.Rows(0)("CveUsuarioPara").ToString().ToEntero() + Me.UsuarioPara = Data.Rows(0)("UsuarioPara").ToString() + 'Me.CorreoPara = Data.Rows(0)("CorreoPara").ToString() + Me.CveEventoEstatus = Data.Rows(0)("CveEventoEstatus").ToString().ToEntero() + Me.EventoEstatus = Data.Rows(0)("EventoEstatus").ToString() + Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString().ToDate + Me.FechaFin = Data.Rows(0)("FechaFin").ToString().ToDate + Me.FechaRealTermino = Data.Rows(0)("FechaRealTermino").ToString().ToDate + Me.CveEventoPadre = Data.Rows(0)("CveEventoPadre").ToString().ToEntero() + 'Me.Orden = Data.Rows(0)("Orden").ToString().ToEntero() + Me.CveRevision = Data.Rows(0)("CveRevision").ToString().ToEntero() + Me.Acuerdos = Data.Rows(0)("Acuerdos").ToString() + 'Me.Revision = Data.Rows(0)("Revision").ToString() + 'Me.TipoReferencia = Data.Rows(0)("TipoReferencia").ToString() + 'Me.Referencia = Data.Rows(0)("Referencia").ToString() + 'Me.Archivo = Data.Rows(0)("Archivo").ToString() + 'Me.CveSeguimiento = Data.Rows(0)("CveSeguimiento").ToString().ToEntero() + Me.FechaIng = Data.Rows(0)("FechaIng").ToString().ToDate + Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString().ToEntero() End If @@ -1275,36 +1699,36 @@ Public Class ClsOIEventos 'If CveEvento > 0 AndAlso Data IsNot Nothing AndAlso Data.Rows.Count > 0 Then If Data.Rows.Count > 0 Then - Me.CveEvento = Data.Rows(0)("CveEvento").ToString.ToEntero - Me.CveTipoEvento = Data.Rows(0)("CveTipoEvento").ToString.ToEntero - Me.CveAgendaTipo = Data.Rows(0)("CveAgendaTipo").ToString.ToEntero - Me.TipoEvento = Data.Rows(0)("TipoEvento").ToString - Me.Asunto = Data.Rows(0)("Asunto").ToString - Me.Descripcion = Data.Rows(0)("Descripcion").ToString - Me.Prioridad = Data.Rows(0)("Prioridad").ToString - Me.CvePrioridad = Data.Rows(0)("CvePrioridad").ToString.ToEntero - Me.CveUsuarioDe = Data.Rows(0)("CveUsuarioDe").ToString.ToEntero - Me.CorreoDe = Data.Rows(0)("CorreoDe").ToString - Me.UsuarioDe = Data.Rows(0)("UsuarioDe").ToString - Me.CveUsuarioPara = Data.Rows(0)("CveUsuarioPara").ToString.ToEntero - Me.UsuarioPara = Data.Rows(0)("UsuarioPara").ToString - Me.CorreoPara = Data.Rows(0)("CorreoPara").ToString - Me.CveEventoEstatus = Data.Rows(0)("CveEventoEstatus").ToString.ToEntero - Me.EventoEstatus = Data.Rows(0)("EventoEstatus").ToString - Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString.ToDate - Me.FechaFin = Data.Rows(0)("FechaFin").ToString.ToDate - Me.FechaRealTermino = Data.Rows(0)("FechaRealTermino").ToString.ToDate - Me.CveEventoPadre = Data.Rows(0)("CveEventoPadre").ToString.ToEntero - Me.Orden = Data.Rows(0)("Orden").ToString.ToEntero - Me.CveRevision = Data.Rows(0)("CveRevision").ToString.ToEntero - Me.Acuerdos = Data.Rows(0)("Acuerdos").ToString - Me.Revision = Data.Rows(0)("Revision").ToString - 'Me.TipoReferencia = Data.Rows(0)("TipoReferencia").ToString - 'Me.Referencia = Data.Rows(0)("Referencia").ToString - Me.Archivo = Data.Rows(0)("Archivo").ToString - 'Me.CveSeguimiento = Data.Rows(0)("CveSeguimiento").ToString.ToEntero - Me.FechaIng = Data.Rows(0)("FechaIng").ToString.ToDate - Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero + Me.CveEvento = Data.Rows(0)("CveEvento").ToString().ToEntero() + Me.CveTipoEvento = Data.Rows(0)("CveTipoEvento").ToString().ToEntero() + Me.CveAgendaTipo = Data.Rows(0)("CveAgendaTipo").ToString().ToEntero() + Me.TipoEvento = Data.Rows(0)("TipoEvento").ToString() + Me.Asunto = Data.Rows(0)("Asunto").ToString() + Me.Descripcion = Data.Rows(0)("Descripcion").ToString() + Me.Prioridad = Data.Rows(0)("Prioridad").ToString() + Me.CvePrioridad = Data.Rows(0)("CvePrioridad").ToString().ToEntero() + Me.CveUsuarioDe = Data.Rows(0)("CveUsuarioDe").ToString().ToEntero() + Me.CorreoDe = Data.Rows(0)("CorreoDe").ToString() + Me.UsuarioDe = Data.Rows(0)("UsuarioDe").ToString() + Me.CveUsuarioPara = Data.Rows(0)("CveUsuarioPara").ToString().ToEntero() + Me.UsuarioPara = Data.Rows(0)("UsuarioPara").ToString() + Me.CorreoPara = Data.Rows(0)("CorreoPara").ToString() + Me.CveEventoEstatus = Data.Rows(0)("CveEventoEstatus").ToString().ToEntero() + Me.EventoEstatus = Data.Rows(0)("EventoEstatus").ToString() + Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString().ToDate + Me.FechaFin = Data.Rows(0)("FechaFin").ToString().ToDate + Me.FechaRealTermino = Data.Rows(0)("FechaRealTermino").ToString().ToDate + Me.CveEventoPadre = Data.Rows(0)("CveEventoPadre").ToString().ToEntero() + Me.Orden = Data.Rows(0)("Orden").ToString().ToEntero() + Me.CveRevision = Data.Rows(0)("CveRevision").ToString().ToEntero() + Me.Acuerdos = Data.Rows(0)("Acuerdos").ToString() + Me.Revision = Data.Rows(0)("Revision").ToString() + 'Me.TipoReferencia = Data.Rows(0)("TipoReferencia").ToString() + 'Me.Referencia = Data.Rows(0)("Referencia").ToString() + Me.Archivo = Data.Rows(0)("Archivo").ToString() + 'Me.CveSeguimiento = Data.Rows(0)("CveSeguimiento").ToString().ToEntero() + Me.FechaIng = Data.Rows(0)("FechaIng").ToString().ToDate + Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString().ToEntero() End If Retorno = True @@ -1556,8 +1980,8 @@ Public Class ClsOIEventos Public Function GetCircular(CveEmpresa As Integer, Optional CveCircular As Integer = -1, Optional FechaI As String = "-1", Optional FechaF As String = "-1", Optional CveUsuario As Integer = -1) As Boolean - FechaI = If(FechaI = "-1", Today.AddYears(-1).ToString, FechaI) - FechaF = If(FechaF = "-1", Today.AddYears(1).ToString, FechaF) + FechaI = If(FechaI = "-1", Today.AddYears(-1).ToString(), FechaI) + FechaF = If(FechaF = "-1", Today.AddYears(1).ToString(), FechaF) Dim Retorno As Boolean = False @@ -1604,7 +2028,7 @@ Public Class ClsOIEventos Try SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@CveCircular").Value.ToString.ToEntero + Retorno = SqlAdapter.SelectCommand.Parameters("@CveCircular").Value.ToString().ToEntero() Catch ex As Exception OnError("Ocurrió un error al agregar el Circular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d2f18f913..7b1c06c79 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3561,6 +3561,8 @@ Public Class ClsPaginas PaginaDict.Add("/Default2.aspx".ToUpper(), -1) PaginaDict.Add("/CargaCuentas.aspx".ToUpper(), -1) PaginaDict.Add("/OI/Tareas.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/RepProyectos.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/Proyecto.aspx".ToUpper(), -1) PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1) PaginaDict.Add("/OS/CatOrdenesServiciosCaracteristicas.aspx".ToUpper(), -1) PaginaDict.Add("/OS/CatOSCaracteristicasOpciones.aspx".ToUpper(), -1) @@ -4140,7 +4142,7 @@ Public Class ClsPaginas PaginaDict.Add("/CRM/PopUpBuscarAcercamiento.aspx".ToUpper(), 1312) PaginaDict.Add("/CRM/RepAcercamientosProcesos.aspx".ToUpper(), 1313) PaginaDict.Add("/CRM/RepAcercamientosRechazos.aspx".ToUpper(), 1314) - PaginaDict.Add("/CRM/RepAcercamientosProcesosDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/CRM/RepAcercamientosProcesosDetalle.aspx".ToUpper(), 758) PaginaDict.Add("/CRM/CatMetas.aspx".ToUpper(), 684) #End Region #Region "CxC" @@ -4183,6 +4185,7 @@ Public Class ClsPaginas 'GENERAL #Region "General" PaginaDict.Add("/General/CatClasificaciones.aspx".ToUpper(), 425) + PaginaDict.Add("/General/CatClasificacionesComprobaciones.aspx".ToUpper(), 1308) PaginaDict.Add("/General/CatPSCaracteristicas.aspx".ToUpper(), 101) PaginaDict.Add("/General/CatCategorias.aspx".ToUpper(), 233) PaginaDict.Add("/General/SaldosIniciales.aspx".ToUpper(), 526) @@ -4422,11 +4425,13 @@ Public Class ClsPaginas PaginaDict.Add("/OI/Normatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/RepNormatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/Minutas.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/MinutaDetalle.aspx".ToUpper(), -1) PaginaDict.Add("/OI/RepDocumentos.aspx".ToUpper(), -1) PaginaDict.Add("/OI/EventoComentario.aspx".ToUpper(), -1) PaginaDict.Add("/OI/RepEventos.aspx".ToUpper(), -1) PaginaDict.Add("/OI/RepTareas.aspx".ToUpper(), 293) + PaginaDict.Add("/OI/RepTareas2.aspx".ToUpper(), 293) PaginaDict.Add("/OI/RepMinutas.aspx".ToUpper(), 338) PaginaDict.Add("/OI/PopUpAgenda.aspx".ToUpper(), -1) PaginaDict.Add("/OI/RepSoporteADS.aspx".ToUpper(), 456) diff --git a/App_Code/ClsSisMail.vb b/App_Code/ClsSisMail.vb index c6be325b7..25d14fd9e 100644 --- a/App_Code/ClsSisMail.vb +++ b/App_Code/ClsSisMail.vb @@ -68,8 +68,8 @@ Public Class ClsSisMail Dim Correo As New System.Net.Mail.MailMessage Dim Mensaje As String = String.Empty - Dim ArrayPara() As String = ObjMail.Para.Split(";"c) - Dim ArrayCCP() As String = ObjMail.CCP.Split(";"c) + Dim ArrayPara() As String = ObjMail.Para.Replace(",", ";").Split(";"c) + Dim ArrayCCP() As String = ObjMail.CCP.Replace(",", ";").Split(";"c) '"sgd.facturacion@adsistemas.mx" If ObjMail.De = String.Empty Then diff --git a/App_Code/Notificaciones.vb b/App_Code/Notificaciones.vb index 998dc6149..8efed087d 100644 --- a/App_Code/Notificaciones.vb +++ b/App_Code/Notificaciones.vb @@ -26,9 +26,17 @@ Public Class Notificaciones End Function + + Public Shared Sub AlertaVentana(Message As String, Para As String, Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) + Dim lPara As New List(Of String) + lPara.Add(Para) + AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo) + End Sub Public Shared Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) - Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients - Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds) + If (Para IsNot Nothing) AndAlso Para.Count > 0 Then + Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients + Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds) + End If End Sub 'Public Shared Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 6b81beb8a..c4c0f3fcb 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -365,7 +365,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim i As Integer = 0 While i < objInv.DtResultados.Columns.Count - If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then + If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion", "CveClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then objInv.DtResultados.Columns.RemoveAt(i) Else i = i + 1 @@ -460,8 +460,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable Try - DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion"}) - + DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion", "CveClasificacion"}) Catch ex As Exception DtPSRetorno = Nothing End Try @@ -469,7 +468,61 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End If DTPS = Nothing End If + + + + + + If (usuario.TienePermisoProceso(300) Or usuario.TienePermisoProceso(301)) And (DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0) Then + + Dim ObjClasificaciones As New ClsClasificaciones() + Dim DTClasificacionesComprobaciones As DataTable + + Dim DTTmp As DataTable = DtPSRetorno.Clone + + + If ObjClasificaciones.GetClasificacionesComprobaciones(usuario.CveEmpresa) Then + + If usuario.TienePermisoProceso(300) And usuario.TienePermisoProceso(301) Then + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados + ElseIf usuario.TienePermisoProceso(300) Then 'TipoComprobacion 1 Biaticos + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 1") + Else 'TipoComprobacion 2 Compreobacines + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 2") + End If + + For Each pRow As DataRow In DtPSRetorno.Rows + + For Each drow As DataRow In DTClasificacionesComprobaciones.Rows + If pRow("CveClasificacion").ToString.ToEntero = drow("CveClasificacion").ToString.ToEntero Then + + Dim nRow As DataRow = DTTmp.NewRow + nRow("CvePS") = pRow("CvePS") + nRow("PSCodigo") = pRow("PSCodigo") + nRow("PSCodigoClasificacion") = pRow("PSCodigoClasificacion") + nRow("CveClasificacion") = pRow("CveClasificacion") + DTTmp.Rows.Add(nRow) + + + End If + Next + + Next + + DtPSRetorno = DTTmp.Copy + + Else + 'no regresar datos herror al consultar + DtPSRetorno.Clear() + End If + + End If + + + If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then + + DtPSRetorno.Columns("CvePS").ColumnName = "id" DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text" If PSCodigoDescripcion = "PSCodigo" Then @@ -477,8 +530,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Else DtPSRetorno.Columns().Remove("PSCodigo") End If + retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString context.Response.Write(retorno) + Else context.Response.Write("[]") End If diff --git a/Bin/APP_Code_CSharp.dll b/Bin/APP_Code_CSharp.dll index 1f82d6c78..1f9036671 100644 Binary files a/Bin/APP_Code_CSharp.dll and b/Bin/APP_Code_CSharp.dll differ diff --git a/Bin/APP_Code_CSharp.pdb b/Bin/APP_Code_CSharp.pdb index 69feb9bde..3698a8127 100644 Binary files a/Bin/APP_Code_CSharp.pdb and b/Bin/APP_Code_CSharp.pdb differ diff --git a/CRM/CatEtapasProceso.aspx.cs b/CRM/CatEtapasProceso.aspx.cs index 64ba4adf0..87b190204 100644 --- a/CRM/CatEtapasProceso.aspx.cs +++ b/CRM/CatEtapasProceso.aspx.cs @@ -48,6 +48,7 @@ public partial class CRM_CatEtapasProceso : ClsPaginas ViewState["DTProcesos"] = value; } } + private int CveEtapaProceso { get @@ -114,6 +115,7 @@ public partial class CRM_CatEtapasProceso : ClsPaginas GVDatos.DataBind(); UPDatos.Update(); } + protected void limpiarCamposModal() { if (EsEditar == 1) @@ -170,7 +172,6 @@ public partial class CRM_CatEtapasProceso : ClsPaginas EsEditar = 0; limpiarCamposModal(); DivOrden.Visible = false; - DdlTipoProceso.SelectedValueExist(CveTipoProcesoSeleccionado); DdlTipoEtapa.SelectedValueExist(CveTipoEtapaSeleccionada); @@ -189,7 +190,6 @@ public partial class CRM_CatEtapasProceso : ClsPaginas GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); CveEtapaProceso = GvRow.DataKey("CveEtapaProceso").ToEntero(); - DdlTipoProceso.SelectedValueExist(GvRow.DataKey("CveTipoProceso")); DdlTipoEtapa.SelectedValueExist(GvRow.DataKey("CveTipoEtapa")); @@ -206,6 +206,18 @@ public partial class CRM_CatEtapasProceso : ClsPaginas this.RegistraScript("$('#DivModal').modal();"); } + private bool validarInicialTerminadoCancelado(int CveTipoEtapa) + { + if (CveTipoEtapa == 2) + { + return true; + }else + { + DataTable aux = TmpDT.FiltraParametros(String.Format("CveTipoEtapa = {0}",CveTipoEtapa)); + return !(aux.Rows.Count >= 2); + } + } + protected void BtnGuardar_Click(object sender, EventArgs e) { ClsCRM ObjCRM = new ClsCRM(); @@ -220,22 +232,27 @@ public partial class CRM_CatEtapasProceso : ClsPaginas Boolean Estatus = ChkEstatus.Checked; int CveUsuarioIng = UsuarioActual.CveUsuario; - - if (EsEditar == 0) + if (validarInicialTerminadoCancelado(CveTipoEtapa)) { - if (ObjCRM.AddEtapaProceso(EtapaProceso, Descripcion, CveTipoEtapa, Orden, CveTipoProceso, UsuarioActual.CveEmpresa, CveUsuarioIng)) + if (EsEditar == 0) { - Alert(String.Format("La Etapa fue creada correctamente para el proceso {0}.", DdlTipoProceso.SelectedItem), ModExtensiones.TipoMensaje.MsgInformacion); + if (ObjCRM.AddEtapaProceso(EtapaProceso, Descripcion, CveTipoEtapa, Orden, CveTipoProceso, UsuarioActual.CveEmpresa, CveUsuarioIng)) + { + Alert(String.Format("La Etapa fue creada correctamente para el proceso {0}.", DdlTipoProceso.SelectedItem), ModExtensiones.TipoMensaje.MsgInformacion); + } } - } - else - { - Orden = Estatus ? DdlOrden.SelectedValue.ToEntero() : -1; + else + { + Orden = Estatus ? DdlOrden.SelectedValue.ToEntero() : -1; - if (ObjCRM.UpdateEtapaProceso(EtapaProceso, Descripcion, Estatus, CveTipoEtapa, Orden, CveEtapaProceso)) - { - Alert("La Etapa fue actualizada correctamente.", ModExtensiones.TipoMensaje.MsgInformacion); + if (ObjCRM.UpdateEtapaProceso(EtapaProceso, Descripcion, Estatus, CveTipoEtapa, Orden, CveEtapaProceso)) + { + Alert("La Etapa fue actualizada correctamente.", ModExtensiones.TipoMensaje.MsgInformacion); + } } + }else + { + Alert(String.Format("No se pueden tener 2 etapas de tipo {0}",DdlTipoEtapa.SelectedItem),ModExtensiones.TipoMensaje.MsgAdvertencia); } // PRECARGAMOS LA SIGUIENTE ETAPA A AGREGAR CON LOS MISMA DATOS DE LA ETAPA QUE SE INSERTO @@ -245,7 +262,6 @@ public partial class CRM_CatEtapasProceso : ClsPaginas ObjCRM.Dispose(); limpiarCamposModal(); this.RegistraScript("$('#DivModal').modal('hide');"); - CargaDatos(-1); DdlFiltroProceso.SelectedValueExist("-1"); } diff --git a/CRM/CatMediosCaptacion.aspx b/CRM/CatMediosCaptacion.aspx index 60d82a951..753505485 100644 --- a/CRM/CatMediosCaptacion.aspx +++ b/CRM/CatMediosCaptacion.aspx @@ -41,6 +41,11 @@ + + + + + @@ -52,11 +57,6 @@ - - - - - diff --git a/CRM/CatMediosCaptacion.aspx.cs b/CRM/CatMediosCaptacion.aspx.cs index fac8b05b1..42c14f659 100644 --- a/CRM/CatMediosCaptacion.aspx.cs +++ b/CRM/CatMediosCaptacion.aspx.cs @@ -48,13 +48,25 @@ public partial class CRM_CatMediosCaptacion : ClsPaginas ViewState["CveMedioCaptacion"] = value; } } + private DataTable DTProcesos + { + get + { + return (DataTable)ViewState["DTProcesos"]; + } + + set + { + ViewState["DTProcesos"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { - CargaDatos(); CargarModalDatos(); + CargaDatos(); } } @@ -79,6 +91,7 @@ public partial class CRM_CatMediosCaptacion : ClsPaginas if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa)) { DdlTipoProceso.DataSource = ObjCRM.DtResultados; + DTProcesos = ObjCRM.DtResultados; } ObjCRM.Dispose(); DdlTipoProceso.DataBind(); @@ -143,6 +156,22 @@ public partial class CRM_CatMediosCaptacion : ClsPaginas { e.Row.FCLabel("lblEstatus").CssClass = "label label-sm label-danger"; } + + foreach (DataRow proceso in DTProcesos.Rows) + { + int index = DTProcesos.Rows.IndexOf(proceso); + + if (proceso["CveTipoProceso"].ToEntero() == e.Row.DataKey("CveTipoProceso").ToEntero()) + { + if ((index % 7) == 0) e.Row.Cells[2].CssClass = "bg-green-haze bg-font-green-haze"; + if ((index % 7) == 1) e.Row.Cells[2].CssClass = "bg-red-pink bg-font-red-pink"; + if ((index % 7) == 2) e.Row.Cells[2].CssClass = "bg-blue bg-font-blue"; + if ((index % 7) == 3) e.Row.Cells[2].CssClass = "bg-purple-soft bg-font-purple-soft"; + if ((index % 7) == 4) e.Row.Cells[2].CssClass = "bg-yellow bg-font-yellow"; + if ((index % 7) == 5) e.Row.Cells[2].CssClass = "bg-yellow-casablanca bg-font-yellow-casablanca"; + if ((index % 7) == 6) e.Row.Cells[2].CssClass = "bg-grey-steel bg-font-grey-steel"; + } + } } } diff --git a/CRM/CatProbabilidadAcercamiento.aspx b/CRM/CatProbabilidadAcercamiento.aspx index a9c296f6f..fed9a26a3 100644 --- a/CRM/CatProbabilidadAcercamiento.aspx +++ b/CRM/CatProbabilidadAcercamiento.aspx @@ -23,8 +23,8 @@ - - + + @@ -42,33 +42,28 @@ CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true" GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVDatos_RowDeleting" OnRowDataBound="GVDatos_RowDataBound"> - + <%-- --%> - <%-- + - + - --%> - + + - + - - - - - @@ -106,7 +101,7 @@

- +
- - - - - Compra - - - - - - Proveedor - -
- -
-
-
- - Fecha Compra - - - - - - Proyecto - - - - - - # R - + + + + + + Compra + + + + + + Proveedor + +
+ +
+
+
+ + Fecha Compra + + + + + + Proyecto + + + + + + # R +   - - - - Monto Compra (Saldo Orig.) - + + + + + Monto Compra (Saldo Orig.) +   - - - - Abonado - + + + + + Abonado +   - - - - Saldo - + + + + + Saldo +   - - - - - Excedente - + + + + + + Excedente +   - - - - - - Auxiliar - - - - - - CveCompra - - - - - - CveProveedor - - - - - - IdCtaContProveedores - - - - - -
-
- - - - - + + +
+
+ + + Auxiliar + + + + + + CveCompra + + + + + + CveProveedor + + + + + + IdCtaContProveedores + + + + + +
+
+ + + + + - - + + + diff --git a/Compras/RepRembolsoComprobaciones.aspx.vb b/Compras/RepRembolsoComprobaciones.aspx.vb index 77316d8e8..20803e964 100644 --- a/Compras/RepRembolsoComprobaciones.aspx.vb +++ b/Compras/RepRembolsoComprobaciones.aspx.vb @@ -238,6 +238,7 @@ Partial Class Compras_RepRembolsoComprobaciones #Region " CARGA DATOS " Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click CargaCxP() + UPFiltros.Update() End Sub Private Sub CargaDatos(tCveIE As Integer) Dim ObjIE As New ClsBancos() @@ -257,7 +258,10 @@ Partial Class Compras_RepRembolsoComprobaciones GvCxP.Visible = True - ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim)) + Dim FechaI As DateTime = If(String.IsNullOrEmpty(txtFechaI.Text.Trim()), ModExtensiones.MinFecha, txtFechaI.Text.ToDateTime()) + Dim FechaF As DateTime = If(String.IsNullOrEmpty(txtFechaF.Text.Trim()), ModExtensiones.MaxFecha, txtFechaF.Text.ToDateTime()) + + ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim), FechaI:=FechaI, FechaF:=FechaF) DtDatos = ObjMovtos.DtResultados GvCxP.DataSource = DtDatos @@ -341,6 +345,8 @@ Partial Class Compras_RepRembolsoComprobaciones params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString)) + params.Add(New ReportParameter("FechaInicio", txtFechaI.Text)) + params.Add(New ReportParameter("FechaFin", txtFechaF.Text)) params.Add(New ReportParameter("CajaChica", If(DdlCajaChica.SelectedValue.ToEntero > 0, "Caja chica: " & DdlCajaChica.SelectedItem.Text, "Funcionario/Empleado: " & DdlPersonal.SelectedItem.Text))) diff --git a/Empresas/72/Formatos/Reembolso.rdlc b/Empresas/72/Formatos/Reembolso.rdlc index 91c6883b3..e761b4240 100644 --- a/Empresas/72/Formatos/Reembolso.rdlc +++ b/Empresas/72/Formatos/Reembolso.rdlc @@ -1376,7 +1376,7 @@ 11.24353in - 4.88309cm + 5.51809cm true true @@ -1789,6 +1789,92 @@ 2pt + + true + true + + + + + Fecha Inicio: + + + + =Parameters!FechaInicio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Fin: + + + + =Parameters!FechaFin.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + - - - - - - Textbox14 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Proveedor - - - - - - - Textbox16 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox12 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Proyecto - - - - - - - Textbox24 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - # R - - - - - - - Textbox26 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Original $ - - - - - - - Textbox3 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Abonado $ - - - - - - - Textbox28 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Saldo $ - - - - - - - Textbox30 - - - - - - - - - LightGrey - 2pt - 2pt - 2pt - - - - - - - - 0.38833cm - - - - - true - - - - - =Fields!SerieFolio.Value - - - - - - - SerieFolio - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Proveedor.Value - - - - - - - RazonSocial - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FechaCompra.Value - - - - - - - RazonSocial - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SubProyecto.Value - - - - - - - SubProyecto - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!NumeroReembolso.Value - - - - - - - NumeroReembolso - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Original.Value - - - - - - - Original - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Abonado.Value - - - - - - - Abonado - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Saldo.Value - - - - - - - Saldo - - - =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.49417cm - - - - - true - true - - - - - Total de Facturas: - - - - - - - Textbox77 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =IIf(First(Fields!Proveedor.Value, "DataSet1") = "", COUNT(Fields!SerieFolio.Value, "DataSet1")-1, COUNT(Fields!SerieFolio.Value, "DataSet1")) - - - - - - - Textbox73 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - Textbox74 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - Textbox75 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - Textbox76 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Total Abonado: $ - - - - - - - Textbox5 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!Abonado.Value) - - - - - - - Textbox22 - - - 2pt - 2pt - 2pt - 2pt - - - true - - - - - - true - true - - - - - - - - - - - - Textbox79 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - - - Before - - - - true - DataSet1 - 0.17639cm - 0.07091cm - 1.34436cm - 20.89059cm - - - - CornflowerBlue - - - CornflowerBlue - - - CornflowerBlue - - - CornflowerBlue - - - - - 0.127cm - 0cm - 20.66109cm - 1 - - - - - - 0.64039in - - - - - 8.25256in - - - 4.30332cm - true - true - - - External - =Parameters!LogoPath.Value - FitProportional - 0.30903cm - 0.127cm - 2.25453cm - 4.18606cm - - - - - - true - true - - - - - =Parameters!NombreEmpresa.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE DE REMBOLSOS / COMPROBACIONES - - - - - - - - - - - - - - - - Textbox2 - 1.00428cm - 5.352cm - 0.66174cm - 11.63523cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!cuentaRetiro.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CajaChica.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!folio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!fecha.Value - - - - - - - Textbox4 - 3.24443cm - 16.34707cm - 0.49417cm - 4.41841cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!importe.Value - - - - - - - Textbox4 - 3.80915cm - 16.38234cm - 0.49417cm - 4.38314cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Importe: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - 0.57501cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.21166cm - 18.69961cm - 0.36335cm - 2.06587cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - - - - Textbox8 - 0.21166cm - 0.07091cm - 0.36335cm - 1.60042cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - - Textbox9 - 0.21166cm - 1.61524cm - 0.36335cm - 5.14936cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - Textbox10 - 0.21166cm - 7.92524cm - 0.36335cm - 2.92333cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaImpresion.Value - - - - - - - Textbox11 - 0.21166cm - 10.83446cm - 0.36335cm - 4.32745cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - 0.10583cm - 0.07091cm - 0cm - 20.71718cm - 5 - - - - - - - - - - 29.7cm - 21cm - 0cm - 0cm - 0.5cm - 0.5cm - 0.13cm - + + + + + + Textbox14 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Proveedor + + + + + + + Textbox16 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Proyecto + + + + + + + Textbox24 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + # R + + + + + + + Textbox26 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Original $ + + + + + + + Textbox3 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Abonado $ + + + + + + + Textbox28 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Saldo $ + + + + + + + Textbox30 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + + + + + + + + 0.38833cm + + + + + true + + + + + =Fields!SerieFolio.Value + + + + + + + SerieFolio + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Proveedor.Value + + + + + + + RazonSocial + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FechaCompra.Value + + + + + + + RazonSocial + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubProyecto.Value + + + + + + + SubProyecto + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!NumeroReembolso.Value + + + + + + + NumeroReembolso + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Original.Value + + + + + + + Original + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Abonado.Value + + + + + + + Abonado + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Saldo.Value + + + + + + + Saldo + + + =IIF(Fields!SerieFolio.Value = "TOTAL", "#67809F", "No color") + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.49417cm + + + + + true + true + + + + + Total de Facturas: + + + + + + + Textbox77 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(First(Fields!Proveedor.Value, "DataSet1") = "", COUNT(Fields!SerieFolio.Value, "DataSet1")-1, COUNT(Fields!SerieFolio.Value, "DataSet1")) + + + + + + + Textbox73 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox74 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox75 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox76 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total Abonado: $ + + + + + + + Textbox5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!Abonado.Value) + + + + + + + Textbox22 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox79 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + + + Before + + + + true + DataSet1 + 0.17639cm + 0.07091cm + 1.34436cm + 20.89059cm + + + + CornflowerBlue + + + CornflowerBlue + + + CornflowerBlue + + + CornflowerBlue + + + + + 0.127cm + 0cm + 20.66109cm + 1 + + + + + + 0.64039in + + + + + 8.25256in + + + 4.96478cm + true + true + + + External + =Parameters!LogoPath.Value + FitProportional + 0.30903cm + 0.127cm + 2.25453cm + 4.18606cm + + + + + + true + true + + + + + =Parameters!NombreEmpresa.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE REMBOLSOS / COMPROBACIONES + + + + + + + + + + + + + + + + Textbox2 + 1.00428cm + 5.352cm + 0.66174cm + 11.63523cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!cuentaRetiro.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CajaChica.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!folio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!fecha.Value + + + + + + + Textbox4 + 3.24443cm + 16.34707cm + 0.49417cm + 4.41841cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!importe.Value + + + + + + + Textbox4 + 3.80915cm + 16.38234cm + 0.49417cm + 4.38314cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Importe: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Inicio: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaInicio.Value + + + + + + + Textbox4 + 4.36478cm + 2.77813cm + 0.49417cm + 4.9674cm + 13 + + =Microsoft.VisualBasic.Interaction.IIf(Parameters!FechaInicio.Value = "", True, False) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Fin: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaFin.Value + + + + + + + Textbox4 + 4.3774cm + 9.99399cm + 0.49417cm + 4.41841cm + 15 + + =Microsoft.VisualBasic.Interaction.IIf(Parameters!FechaFin.Value = "", true, false) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.57501cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.21166cm + 18.69961cm + 0.36335cm + 2.06587cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + + Textbox8 + 0.21166cm + 0.07091cm + 0.36335cm + 1.60042cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + + Textbox9 + 0.21166cm + 1.61524cm + 0.36335cm + 5.14936cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + + Textbox10 + 0.21166cm + 7.92524cm + 0.36335cm + 2.92333cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaImpresion.Value + + + + + + + Textbox11 + 0.21166cm + 10.83446cm + 0.36335cm + 4.32745cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.10583cm + 0.07091cm + 0cm + 20.71718cm + 5 + + + + + + + + + + 29.7cm + 21cm + 0cm + 0cm + 0.5cm + 0.5cm + 0.13cm + + + + + + Minuta: + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + Datos Minuta +
+
+ +
+
+
+
+ + + +
+
+ + + +
+
+ + +
+
+

Moderador:

+
+
+ +
+
+
+
+

Participantes:

+
+
+ +
+
+
+
+ + +
+ Guardar + Enviar Minuta + Terminar y Enviar Minuta +
+
+
+
+ +
+
+
+ +
+
+ + Archivo +
+
+
+
+
+
+ +
+
+
+ +
+ +
+ +
+
+
+
+
+
+ + +
+
+ + Miembros +
+
+ +
+
+
+
+ + +
+
+ + +
+ <%--
+ + +
--%> + + +
+ + +
+ + + + + + + + + + + + + + Usuario + + + + + + Rol + + + + + + +
+
+
+
+ + + + + + + + + +
+
+ + Acuerdos +
+
+ +
+
+
+ Guardar +
+
+
+
+
+ +
+
+
+ <%----%> + + +
+
+
+ + Agregar + <%--Agregar--%> +
+
+ + + + + + + + + + + <%--
--%>
+                                                                    
+                                                                         
+                                                                    
+                                                                    <%--
--%> +
+
+ + + <%----%> + + + + + + + +
+
+
+ +
+ <%----%> + +
+
+
+
+
+ +
+
+ + + + +
+
+ + Tarea nueva +
+
+ +
+
+
+ Agregar +
+
+
+
+
+
+
+ + + +
+
+ + + +
+ +
+
+ + +
+
+ +
+
+
+
+
+ + + + <%----%> + +
+
+
+
+ + + + <%----%> + +
+
+
+
+
+
+ + + + + + + + Prioridad: + +
+
+
+
+ + + + Para: +
+
+
+
+
+ +
+ + +
+ + + + + + CCP
+ + +
+ + + +
+ + Usuario + + + + + + Rol + + + + +
+
+
+
+ + <%--//OIE.[CveEvento], OIE.[CveTipoEvento], OIE.[Folio], OIE.[Asunto], OIE.[Descripcion], OIE.[Prioridad], OIE.[CveUsuarioDe], OIE.[CveUsuarioPara], + //OIE.[CveEventoEstatus], OIE.[FechaInicio], OIE.[FechaFin], OIE.[FechaRealTermino], OIE.[CveRevision], OIE.[Archivo], OIE.[FechaIng], + //OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance]--%> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+ + Agenda nueva +
+
+ +
+
+
+ Agregar +
+
+
+
+
+
+
+ + + +
+
+ + + +
+ +
+
+ + +
+
+
+
+
+ + + + <%----%> + +
+
+
+
+ + + + + + + + Agenda Tipo: +
+ +
+ +
+
+ + + + + + + + Prioridad: + +
+
+
+
+ + + + Para: +
+
+
+
+
+
+
+ +
+ + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + +
+
+
+ + +
+ + +
+
+ Agregar +
+
+ + + + + + + + + <%----%> + + + + + + + + + + <%----%> + + + + + + + + +
+
+
+
+
+
+
+
+
+ +
+ + + + + + diff --git a/OI/MinutaDetalle.aspx.cs b/OI/MinutaDetalle.aspx.cs new file mode 100644 index 000000000..edcce172c --- /dev/null +++ b/OI/MinutaDetalle.aspx.cs @@ -0,0 +1,1170 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class OI_MinutaDetalle : ClsPaginas +{ + #region Propiedades + public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = value; } } + public int Folio { get { return ViewState["Folio"] != null ? ViewState["Folio"].ToString().ToEntero() : 0; } set { ViewState["Folio"] = value; } } + public decimal Avance { get { return ViewState["Avance"] != null ? ViewState["Avance"].ToString().ToEntero() : 0; } set { ViewState["Avance"] = value; } } + public int CveUsuarioPara { get { return ViewState["CveUsuarioPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioPara"] = value; } } + public int CveUsuarioDe { get { return ViewState["CveUsuarioDe"].ToString().ToEntero(); } set { ViewState["CveUsuarioDe"] = value; } } + public List LCveUsuarioCCP { get { if (ViewState["LCveUsuarioCCP"] == null) { ViewState["LCveUsuarioCCP"] = new List(); } return (List)ViewState["LCveUsuarioCCP"]; } set { ViewState["LCveUsuarioCCP"] = value; } } + public List LcveuserVisto { get { if (ViewState["LcveuserVisto"] == null) { ViewState["LcveuserVisto"] = new List(); } return (List)ViewState["LcveuserVisto"]; } set { ViewState["LcveuserVisto"] = value; } } + + public bool EsNuevo { get { return Convert.ToBoolean(ViewState["EsNuevo"]); } set { ViewState["EsNuevo"] = value; } } + public System.Data.DataTable CheckListNew { get { return ViewState["CheckListNew"] != null ? (System.Data.DataTable)ViewState["CheckListNew"] : null; } set { ViewState["CheckListNew"] = value; } } + public int chklistitemindex { get { return ViewState["chklistitemindex"] != null ? ViewState["chklistitemindex"].ToString().ToEntero() : 0; } set { ViewState["chklistitemindex"] = value; } } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + chklistitemindex = 0; + if (!IsPostBack) + { + EsNuevo = true; + DdlRoles.DataSource = get_GlobalDTRoles(UsuarioActual.CveEmpresa); + DdlRoles.DataBind(); + DdlRoles.Items.Insert(0, new ListItem("Todos", "-1")); + DdlSucursales.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa); + DdlSucursales.DataBind(); + DdlSucursales.Items.Insert(0, new ListItem("Todos", "-1")); + GVUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus =1 ", "Rol ASC"); + GVUsuariosB.DataSource = GVUsuarios.DataSource; + DdlTareaPara.DataSource = GVUsuarios.DataSource; + DdlTareaPara.DataBind(); + DdlAgendaPara.DataSource = GVUsuarios.DataSource; + DdlAgendaPara.DataBind(); + GVUsuarios.DataBind(); + GVUsuariosB.DataBind(); + + if (Request["CveEvento"] != null) + { + RCveEvento = Request["CveEvento"].ToString().ToEntero(); + } + if (RCveEvento > 0) + { + Tab.Visible = true; + EsNuevo = false; + LnkGuardar.Visible = false; + using (ClsOIEventos oieve = new ClsOIEventos()) + { + oieve.UpUsuarioseventosVisto(RCveEvento, UsuarioActual.CveUsuario); + } + LoadMinuata(); + } + else + { + Tab.Visible = false; + HypArchivo.Visible = false; + GVcheklist.Columns[0].Visible = false; + #region "carga check list new " + + CheckListNew = new System.Data.DataTable(); + //CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng + CheckListNew.Columns.Add("CveEventoCheckList", typeof(int)); + CheckListNew.Columns.Add("CveEvento", typeof(int)); + CheckListNew.Columns.Add("CveTipoEvento", typeof(int)); + CheckListNew.Columns.Add("EventoComentario", typeof(String)); + CheckListNew.Columns.Add("Estatus", typeof(bool)); + CheckListNew.Columns.Add("CveUsuario", typeof(int)); + CheckListNew.Columns.Add("Usuario", typeof(string)); + CheckListNew.Columns.Add("FechaIng", typeof(DateTime)); + #endregion + } + + } + + } + + public void LoadMinuata() + { + GVcheklist.DataSource = new System.Data.DataTable(); + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + if (ObjOI_E.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0) + { + portletUserNew.Visible = false; + pnlmiembrosvista.Visible = true; + TabTareas.Visible = true; + TabAgendas.Visible = true; + TabArchivos.Visible = true; + LnkTerminar_EnviarMinuta.Visible = true; + LnkEnviarMinuta.Visible = false; + TxtAsunto.Enabled = false; + TxtDescripcion.Enabled = false; + //LnkUpFileVisible = true; + //LnkUpUsuariosVisible = true; + System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0]; + + Folio = drow["Folio"].ToString().ToEntero(); + Avance = drow["Avance"].ToString().ToDecimal(); + + TxtAsunto.Text = drow["Asunto"].ToString(); + TxtDescripcion.Text = drow["Descripcion"].ToString(); + TxtAcuerdos.Text = drow["Acuerdos"].ToString().Replace("<", "< "); + //txtFechaI.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaInicio"]); + //txtFechaF.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaFin"]); + //DdlTema.SelectedValueExist(drow["CveRevision"].ToString()); + //DdlEventoEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString()); + //DDlEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString()); + HypArchivo.Text = string.Format("{0}
", drow["Archivo"].ToString()); + HypArchivo.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString())); + TxtArchivo.Visible = (drow["Archivo"].ToString().Length == 0); + portletArchivo.Visible = !TxtArchivo.Visible; + //LnkUpFile.Text = (portletArchivo.Visible ? " Actualizar archivo" : " Agregar archivo"); + //Literal3.Text = portletArchivo.Visible ? "Actualizar archivo" : "Agregar archivo"; + //BtnActualizarArchivo.Text = portletArchivo.Visible ? "Actualizar" : "Agregar"; + int CveUsuarioIng = drow["CveUsuarioIng"].ToString().ToEntero(); + CveUsuarioDe = drow["CveUsuarioDe"].ToString().ToEntero(); + CveUsuarioPara = drow["CveUsuarioPara"].ToString().ToEntero(); + int CveEventoEstatus = drow["CveEventoEstatus"].ToString().ToEntero(); + if (CveEventoEstatus ==4) + { + LnkEnviarMinuta.Visible = true; + LnkSaveAcuerdos.Visible = false; + LnkAgregarAgenda.Visible = false; + LnkTerminar_EnviarMinuta.Visible = false; + LnkEnviarMinuta.Visible = true; + LnkAgregarTarea.Visible = false; + } + hdnCveEventoEstatus.Value = CveEventoEstatus.ToString(); + hdnCveEvento.Value = RCveEvento.ToString(); + //TxtAvance.Text = string.Format("{0:##0}", drow["Avance"]); + //TxtUsuarioreg.Text = string.Format("{0}", drow["NombreRegistro"]); + //TxtFechaIng.Text = string.Format("{0:dd/MM/yyyy}", drow["FechaIng"]); + //OIE.[CveEvento], OIE.[CveTipoEvento], OIE.[Folio], OIE.[Asunto], OIE.[Descripcion], OIE.[Prioridad], OIE.[CveUsuarioDe], OIE.[CveUsuarioPara], + //OIE.[CveEventoEstatus], OIE.[FechaInicio], OIE.[FechaFin], OIE.[FechaRealTermino], OIE.[CveRevision], OIE.[Archivo], OIE.[FechaIng], + //OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance] + + StringBuilder StrDeUser = new StringBuilder(); + StringBuilder StrCCPara = new StringBuilder(); + ltlTituloPage.Text = drow["Asunto"].ToString(); + if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa)) + { + LCveUsuarioCCP.Clear(); + foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Select("CveEvento >0")) + { + int CveUsuario = item["CveUsuario"].ToString().ToEntero(); + LCveUsuarioCCP.Add(CveUsuario); + + string palomitavisto = ""; + string palomitasinver = ""; + if (item["Visto"].ToString().ToEntero() == 1) + { + LcveuserVisto.Add(CveUsuario); + palomitavisto = palomitasinver; + palomitasinver = ""; + } + string user = string.Format("{3}{2}\"{0}\"", item["Nombre"].ToString(), item["Correo"].ToString(), palomitavisto, palomitasinver); + if (CveUsuarioIng == CveUsuario) + { + StrDeUser.Append(user); + } + else + { + StrCCPara.Append(user); + } + } + LtlDeUser.Text = StrDeUser.ToString(); + LtlCCPara.Text = StrCCPara.ToString(); + } + + foreach (GridViewRow gvRow in GVUsuariosB.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox ChkOk = gvRow.FCCheckBox("ChkOk"); + if (CveUsuario.Contiene(LCveUsuarioCCP.ToArray())) + { + ChkOk.Checked = true; + } + } + } + + if (ObjOI_E.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = ObjOI_E.DtResultados; + if (ObjOI_E.DtResultados.Rows.Count > 0) + { + portletChekList.Visible = true; + } + } + cargaActividades(ObjOI_E); + } + } + cargarAgenda(); + GVcheklist.DataBind(); + } + + #region "Acuerdos" + + private void cargaActividades(ClsOIEventos ObjOI) + { + GvActividades.DataSource = null; + if (ObjOI.GetEventosComentarios(RCveEvento)) + { + GvActividades.DataSource = ObjOI.DtResultados; + } + GvActividades.DataBind(); + UpActividades.Update(); + } + protected void GvActividades_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + HyperLink HplA = e.Row.FCHyperLink("HplA"); + string archivoname = e.Row.DBCampo("Archivo"); + string CveComentario = e.Row.DBCampo("CveEventoComentario"); + HplA.Visible = archivoname != ""; + if (HplA.Visible) + { + HplA.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, archivoname)), ModExtensiones.Encripta(archivoname)); + } + + } + //Visible='<%# Eval("Archivo").ToString() != "" %>' data-archivo ='<%# string.Format("",Eval("CveEventoComentario").ToString()) %>' + //string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString())) + } + protected void LnkAgregarchklistitem_Click(object sender, EventArgs e) + { + if (RCveEvento > 0) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Addcheklist(RCveEvento, TxtActividad.Text, UsuarioActual.CveUsuario)) + { + Alert("Se agregó el acuerdo", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + + } + else + { + System.Data.DataRow drow = CheckListNew.NewRow(); + drow["CveEventoCheckList"] = chklistitemindex++; + drow["EventoComentario"] = TxtActividad.Text; + drow["Estatus"] = false; + //CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng + CheckListNew.Rows.Add(drow); + GVcheklist.DataSource = CheckListNew; + GVcheklist.DataBind(); + } + TxtActividad.Text = ""; + } + protected void ChkEstatus_CheckedChanged(object sender, EventArgs e) + { + CheckBox chk = (CheckBox)sender; + GridViewRow gvrow = (GridViewRow)chk.NamingContainer; + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Upcheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), gvrow.DataKey("EventoComentario"), chk.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + Alert("Se actualizó el estatus del acuerdo", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + protected void LnkEliminarchek_Click(object sender, EventArgs e) + { + GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer; + + if (EsNuevo) + { + CheckListNew = CheckListNew.FiltraParametros(string.Format("CveEventoCheckList <> {0}", gvrow.DataKey("CveEventoCheckList"))); + GVcheklist.DataSource = CheckListNew; + GVcheklist.DataBind(); + } + else + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Removecheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), UsuarioActual.CveUsuario)) + { + Alert("Se ha eliminadó el acuerdo", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + } + protected void LnkSinfuncion_Click(object sender, EventArgs e) + { + + } + #endregion + protected void GVUsuarios_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + string CveRol = e.Row.DBCampo("CveRol"); + string CveSubProyecto = e.Row.DBCampo("CveSubProyecto"); + e.Row.CssClass = "items"; + e.Row.Attributes.Add("data-rol", CveRol); + e.Row.Attributes.Add("data-sucursal", CveRol); + } + + } + + protected void LnkGuardar_Click(object sender, EventArgs e) + { + string asunto = TxtAsunto.Text; + string descripcion = TxtDescripcion.Text; + string acuerdos = TxtAcuerdos.Text.Replace("< ", "<"); + int cveusuarioDe = -1; + int cveusuarioPara = -1; + if (EsNuevo) + { + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + int Folio = -1; + int CveEvento = -1; + foreach (Archivo item in TxtArchivo.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + bool Continuar = true; + + + List lMiembros = new List(); + + lMiembros.Add(UsuarioActual.CveUsuario); + foreach (GridViewRow gvRow in GVUsuarios.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox ChkOk = gvRow.FCCheckBox("ChkOk"); + if (ChkOk.Checked) + { + lMiembros.Add(CveUsuario); + //cveUsuarioDe = CveUsuario; + } + } + } + List chkList = new List(); + if (CheckListNew != null) + { + foreach (System.Data.DataRow item in CheckListNew.Rows) + { + chkList.Add(item["EventoComentario"].ToString()); + } + + } + using (ClsOIEventos oieve = new ClsOIEventos()) + { + oieve.IniciaTransacSQL(); + Continuar = oieve.AddEventoMinuta2(asunto, descripcion, acuerdos, cveusuarioDe, cveusuarioPara, DateTime.Now, archivoname, lMiembros, chkList, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + CveEvento = oieve.CveEvento; + Folio = oieve.Folio; + + if (Continuar) + { + oieve.Commit(); + + } + else + { + oieve.RollBack(); + Continuar = false; + } + } + + if (Continuar && CveEvento > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + this.Alert("Se ha agregadó la nueva minuta", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/MinutaDetalle.aspx?CveEvento={0}\");", CveEvento)); + } + + } + } + + private void cargarAgenda() + { + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + if (ObjOI_E.GetEventos2(-1, UsuarioActual.CveEmpresa, RCveEvento) && ObjOI_E.DtResultados.Rows.Count > 0) + { + System.Data.DataTable dt = ObjOI_E.DtResultados; + GVTareas.DataSource = dt.FiltraParametros(string.Format("CveTipoEvento ={0}", (int)OITipoEventos.Tarea)); + GvAgenda.DataSource = dt.FiltraParametros(string.Format("CveTipoEvento ={0}", (int)OITipoEventos.Agenda)); + GVTareas.DataBind(); + GvAgenda.DataBind(); + } + } + } + protected void LnkAgregarTarea_Click(object sender, EventArgs e) + { + if (RCveEvento > 0) + { + string errorMessage = ""; + + int cveUsuarioDe = UsuarioActual.CveUsuario; + List listaCCP = new List(); + + foreach (GridViewRow gvRow in GVUsuariosB.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + CheckBox ChkOk = gvRow.FCCheckBox("ChkOk"); + if (ChkOk.Checked) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + listaCCP.Add(CveUsuario); + } + } + } + int cveUsuarioPara = DdlTareaPara.SelectedValue.ToEntero(); + + OITipoEventos cveTipoEvento = OITipoEventos.Tarea; + string asunto = TxtTareaAsunto.Text; + string descripcion = TxtTareaDescripcion.Text; + int prioridad = DdlTareaPrioridad.SelectedValue.ToEntero(); + string fechaInicio = ""; + if (txtTareaFechaI.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtTareaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "No se ingresó una fecha de inicio valida"; + + } + else + { + fechaInicio = txtTareaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); + } + } + else + { + fechaInicio = txtTareaFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + string fechaFin = ""; + if (txtTareaFechaF.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtTareaFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "No se ingresó una fecha fin valida"; + + } + else + { + fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtTareaFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")); + } + } + else + { + fechaFin = txtTareaFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + int cveRevision = -1; + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in TxtTareaArchivo.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + + + int cveUsuarioIng = UsuarioActual.CveUsuario; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + int Folio = -1; + int CveEvento = -1; + + if (cveUsuarioDe <= 0) + { + errorMessage = "No se selecciono el miembro 'C C Para'"; + } + + if (cveUsuarioPara <= 0) + { + errorMessage = "No se selecciono el miembro 'Para'"; + + } + if (errorMessage.Length == 0) + { + + List chkList = new List(); + //if (CheckListNew != null) + //{ + // foreach (System.Data.DataRow item in CheckListNew.Rows) + // { + // chkList.Add(item["EventoComentario"].ToString()); + // } + + //} + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEvento); + CveEvento = objOI.CveEvento; + Folio = objOI.Folio; + if (CveEvento == 0) + { + Continuar = false; + } + if (Continuar) + { + objOI.Commit(); + + } + else + { + objOI.RollBack(); + Continuar = false; + } + } + if (Continuar && CveEvento > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + cargarAgenda(); + this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion); + TxtTareaAsunto.Text = ""; + TxtTareaDescripcion.Text = ""; + txtTareaFechaI.Text = ""; + txtTareaFechaF.Text = ""; + //this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("window.open(\"/OI/TareaDetalle.aspx?CveEvento={0}\", \"_blank\");", CveEvento)); + } + } + } + } + + protected void LnkAgregarAgenda_Click(object sender, EventArgs e) + { + + if (RCveEvento > 0) + { + string errorMessage = ""; + + int cveUsuarioDe = UsuarioActual.CveUsuario; + List listaCCP = new List(); + int cveUsuarioPara = DdlAgendaPara.SelectedValue.ToEntero(); + + OITipoEventos cveTipoEvento = OITipoEventos.Agenda; + string asunto = TxtAgendaAsunto.Text; + string descripcion = TxtAgendaDescripcion.Text; + int prioridad = DdlAgendaPrioridad.SelectedValue.ToEntero(); + int cveAgendaTipo = DdlAgendaTipo.SelectedValue.ToEntero(); + string fechaInicio = ""; + if (txtAgendaFechaI.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtAgendaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "No se ingresó una fecha de inicio valida"; + + } + else + { + fechaInicio = txtAgendaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); + } + } + else + { + fechaInicio = txtAgendaFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + string fechaFin = "1900/01/01 00:00"; + int cveRevision = -1; + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in TxtAgendaArchivo.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + + + int cveUsuarioIng = UsuarioActual.CveUsuario; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + int Folio = -1; + int CveEvento = -1; + + if (cveUsuarioDe <= 0) + { + errorMessage = "No se selecciono el miembro 'C C Para'"; + } + + if (cveUsuarioPara <= 0) + { + errorMessage = "No se selecciono el miembro 'Para'"; + + } + if (errorMessage.Length == 0) + { + + List chkList = new List(); + //if (CheckListNew != null) + //{ + // foreach (System.Data.DataRow item in CheckListNew.Rows) + // { + // chkList.Add(item["EventoComentario"].ToString()); + // } + + //} + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEvento, null, cveAgendaTipo); + CveEvento = objOI.CveEvento; + Folio = objOI.Folio; + if (CveEvento == 0) + { + Continuar = false; + } + if (Continuar) + { + objOI.Commit(); + + } + else + { + objOI.RollBack(); + Continuar = false; + } + } + if (Continuar && CveEvento > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + this.Alert("Se ha agregadó la nueva agenda"); + TxtAgendaAsunto.Text = ""; + TxtAgendaDescripcion.Text = ""; + txtAgendaFechaI.Text = ""; + txtAgendaFechaF.Text = ""; + cargarAgenda(); + //this.Alert("Se ha agregadó la nueva agenda", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("window.open(\"/OI/TareaDetalle.aspx?CveEvento={0}\", \"_blank\");", CveEvento)); + } + } + } + + } + + protected void BtnAgregarComentario_Click(object sender, EventArgs e) + { + + string Comentario = TxtComentario.Text; + int CveComentario = 0; + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in Txtfilecomentario.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + using (ClsOIEventos objoi = new ClsOIEventos()) + { + CveComentario = objoi.AddEventoComentario2(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + if (CveComentario > 0) { cargaActividades(objoi); } + } + Txtfilecomentario.Text = ""; + if (CveComentario > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}{2}", ruta, CveComentario, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + //this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregar)); + this.Alert("Comentario agregadó", ModExtensiones.TipoMensaje.ToastInformacion); + //this.Alert("Se ha agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento)); + } + TxtComentario.Text = ""; + } + + + protected void LnkTerminarMinuta_Click(object sender, EventArgs e) + { + // Cambiar el estatus a Terminada para inabilitarla y que no se pueda modificar + ClsOIEventos objOI = new ClsOIEventos(); + int tCveSeguimiento; + bool HuboError = false; + + objOI.IniciaTransacSQL(); + + tCveSeguimiento = objOI.AddEventoComentario2(RCveEvento, "Termino Minuta", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + + if (tCveSeguimiento > 0) + { + if (!objOI.UpdateEstatusEvento2(4, tCveSeguimiento, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + HuboError = true; + } + else + HuboError = true; + + + // 'Envia minuta si es modificada + + + + if (HuboError == false) + { + Alert("La minuta se termino con exito.", ModExtensiones.TipoMensaje.MsgInformacion); + objOI.Commit(); + } + else + { + Alert("Ocurrió un error al terminar la minuta. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError); + objOI.RollBack(); + } + + objOI.Dispose(); + + + if (HuboError == false) + { + if (!EnviarMinuta()) + HuboError = true; + Alert("La minuta se termino con exito.", ModExtensiones.TipoMensaje.MsgInformacion); + } + + LnkEnviarMinuta.Visible = true; + //CargaDatos(); + } + + protected void LnkEnviarMinuta_Click(object sender, EventArgs e) + { + EnviarMinuta(); + Alert("La minuta se envió con exito.", ModExtensiones.TipoMensaje.MsgInformacion); + } + + #region "enviarminuta" + + private bool EnviarMinuta() + { + var Retorno = false; + StringBuilder Body; + + try + { + Body = GeneraContenido(RCveEvento); + string ArrayCC = ""; + //ViewState("Para") = GlobalDTUsuarios(CveUsuarioIng)(0)("correo").ToString; + //ViewState("Asunto") = string.Format("SIG - Minuta {0}", TxtAsunto.Text); + //ViewState("Body") = Body; + //System.Threading.Thread Hilo = new System.Threading.Thread(MandaCorreo); + //Hilo.Start(); + + + ClsSisMail Mail = new ClsSisMail(); + Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString(), TxtAsunto.Text, Body.ToString(), CCP: ArrayCC); + Alert("Se Envió por correo la Minuta", ModExtensiones.TipoMensaje.MsgInformacion); + Retorno = true; + } + catch (Exception ex) + { + this.OnError("Ocurrió error al mandar MAIL", ex); + } + + return Retorno; + } + + + private StringBuilder GeneraContenido(int CveEvento) + { + StringBuilder StrSB = new StringBuilder(); + + string DireccionURL = "";// GlobalDTParametros(SisParametros.URL).Cadena1; + string Variables = ""; + + string Tarea; + string De; + string Para; + // Dim CCP As String + string Fecha; + string Prioridad; + string Descripcion; + int Tipo; + + ClsOIEventos objEvento = new ClsOIEventos(); + + if (objEvento.GetEvento(CveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + Tarea = objEvento.Asunto; + De = objEvento.UsuarioDe; + Para = objEvento.UsuarioPara; + Fecha = objEvento.FechaIng.ToString("dd/MM/yyyy"); + Prioridad = objEvento.Prioridad; + Descripcion = objEvento.Descripcion; + Tipo = objEvento.CveTipoEvento; + + + StrSB.Append(" "); + StrSB.Append(" "); + // StrSB.AppendFormat(" ", DireccionURL) + StrSB.Append(" "); + StrSB.Append(" "); + + + StrSB.Append(""); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append("
"); + StrSB.Append("
"); + StrSB.Append(" Minuta"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.AppendFormat(" ", DireccionURL, "/OI/MinutaDetalle.aspx?CveEvento=", CveEvento, objEvento.Asunto); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.AppendFormat(" ", objEvento.Descripcion); + StrSB.Append(" "); + + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.AppendFormat(" ", objEvento.Acuerdos.Replace("<", "<").Replace(">", ">")); + StrSB.Append(" "); + + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + + StrSB.Append(" "); + StrSB.AppendFormat(" ", objEvento.FechaIng.ToString("dd/MM/yyyy HH:mm")); + StrSB.AppendFormat(" ", objEvento.DtResultados.Rows[0]["UsuariosCCP"]); + // StrSB.AppendFormat(" ", If(Not objEvento.Archivo Is Nothing AndAlso objEvento.Archivo <> "", String.Format("Ver archivo adjunto", DireccionURL, objEvento.CveEmpresa, objEvento.Archivo), "Sin archivo adjunto")) + StrSB.AppendFormat(" ", objEvento.Archivo != null && objEvento.Archivo != "" ? "Con archivo adjunto" : "Sin archivo adjunto"); + StrSB.Append(" "); + + StrSB.Append("
ASUNTO:
{3}
DESCRIPCION:
{0}
ACUERDOS:
{0}
FECHA:PARTICIPANTES:ARCHIVO:
{0}{0}{0}{0}
"); + StrSB.Append("
"); + StrSB.Append("
 
"); + StrSB.Append("
"); + StrSB.Append("

TAREAS

"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append("
"); + + if (objEvento.GetEventos(-1, 1, -1, "-1", "-1", -1, -1, -1, -1, -1, CveEvento, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + if (objEvento.DtResultados.Rows.Count == 0) + { + StrSB.Append("
"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append("
MINUTA SIN TAREAS
"); + StrSB.Append("
"); + } + else + { + StrSB.Append("
"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + // StrSB.Append("
AsuntoDescripcionParaInicioFinEstatus
") + // StrSB.Append("
") + // StrSB.Append(" ") + + int i = 0; + foreach (System.Data.DataRow RowTarea in objEvento.DtResultados.FiltraParametros("", "FechaIng Desc").Rows) + { + StrSB.AppendFormat(" ", i % 2 == 0 ? "Texto" : "TextoAlterno"); + StrSB.AppendFormat(" ", RowTarea["Asunto"]); + StrSB.AppendFormat(" ", RowTarea["Descripcion"]); + StrSB.AppendFormat(" ", RowTarea["UsuarioPara"]); + StrSB.AppendFormat(" ", RowTarea["FechaInicio"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm")); + StrSB.AppendFormat(" ", RowTarea["FechaFin"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm")); + StrSB.AppendFormat(" ", DireccionURL, RowTarea["CveEvento"], RowTarea["EventoEstatus"]); + StrSB.Append(" "); + i = i + 1; + } + + StrSB.Append("
 {0} {0} {0}{0}{0}{2}
"); + StrSB.Append("
"); + } + } + + StrSB.Append("
"); + StrSB.Append("
"); + StrSB.Append("
 
"); + StrSB.Append("
"); + StrSB.Append("

AGENDAS

"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append("
"); + + + + + if (objEvento.GetEventos(-1, 2, -1, "-1", "-1", -1, -1, -1, -1, -1, CveEvento, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + if (objEvento.DtResultados.Rows.Count == 0) + { + StrSB.Append("
"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append("
MINUTA SIN AGENDAS
"); + StrSB.Append("
"); + } + else + { + StrSB.Append("
"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + int i = 0; + foreach (System.Data.DataRow RowAgenda in objEvento.DtResultados.FiltraParametros("", "FechaIng Desc").Rows) + { + StrSB.AppendFormat(" ", i % 2 == 0 ? "Texto" : "TextoAlterno"); + StrSB.AppendFormat(" ", RowAgenda["Asunto"]); + StrSB.AppendFormat(" ", RowAgenda["Descripcion"]); + StrSB.AppendFormat(" ", RowAgenda["UsuarioPara"]); + StrSB.AppendFormat(" ", RowAgenda["FechaInicio"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm")); + StrSB.AppendFormat(" ", RowAgenda["AgendaTipo"]); + StrSB.AppendFormat(" ", RowAgenda["EventoEstatus"]); + StrSB.Append(" "); + i = i + 1; + } + StrSB.Append("
AsuntoDescripcionParaFechaTipo AgendaEstatus
 {0} {0} {0}{0}{0}{0}
"); + StrSB.Append("
"); + } + } + + + + StrSB.Append("
"); + StrSB.Append("
"); + StrSB.Append("
 
"); + StrSB.Append("
"); + StrSB.Append("

ARCHIVOS

"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append("
"); + + + + + if (objEvento.GetEventosComentarios(CveEvento)) + { + if (objEvento.DtResultados.Rows.Count == 0) + { + StrSB.Append("
"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append("
MINUTA SIN ARCHIVOS
"); + StrSB.Append("
"); + } + else + { + StrSB.Append("
"); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + StrSB.Append(" "); + int i = 0; + foreach (System.Data.DataRow RowArchivo in objEvento.DtResultados.FiltraParametros("", "FechaIng Desc").Rows) + { + StrSB.AppendFormat(" ", i % 2 == 0 ? "Texto" : "TextoAlterno"); + StrSB.AppendFormat(" ", RowArchivo["EventoComentario"]); + if (RowArchivo["Archivo"].ToString() != "") + StrSB.AppendFormat(" ", "Si"); + else + StrSB.AppendFormat(" ", "No"); + StrSB.Append(" "); + i = i + 1; + } + StrSB.Append("
DescripcionAdjunto
 {0} {0} {0}
"); + StrSB.Append("
"); + } + } + + + + StrSB.Append("
"); + StrSB.Append("
"); + StrSB.Append("
"); + StrSB.Append(""); + + + + StrSB.Append(" "); + } + + return StrSB; + } + #endregion + + protected void LnkSaveAcuerdos_Click(object sender, EventArgs e) + { + using (ClsOIEventos ObjEventos =new ClsOIEventos()) { + ObjEventos.UpdateEventoMinuta(TxtAsunto.Text, TxtDescripcion.Text, TxtAcuerdos.Text.Replace("< ", "<"), new DateTime(1999, 1, 1), "-1", RCveEvento); + } + } +} \ No newline at end of file diff --git a/OI/Proyecto.aspx b/OI/Proyecto.aspx new file mode 100644 index 000000000..e682dac94 --- /dev/null +++ b/OI/Proyecto.aspx @@ -0,0 +1,491 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Proyecto.aspx.cs" Inherits="OI_Proyecto" %> + + + + + + + <%----%> + + + + Proyecto: + + + + + + +
  • + Agregar Proyecto +
  • + +
    +
    +
    + + + + <%--
    --%> + + + + +
    + + Formato:   + + + + + +
    + +     |     + Mostrar:   + + +
    +
    +
    + + +
    +
    + + <%----%> +
    + + + + + + <%----%> + + + + + diff --git a/OI/Proyecto.aspx.cs b/OI/Proyecto.aspx.cs new file mode 100644 index 000000000..035c07a72 --- /dev/null +++ b/OI/Proyecto.aspx.cs @@ -0,0 +1,215 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +public partial class OI_Proyecto : ClsPaginas +{ + + #region Propiedades + public const string iddivAgregarProyecto = "iddivAgregarProyecto"; + public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = value; } } + public int RCveEventoB { get { return ViewState["RCveEventoB"] != null ? ViewState["RCveEventoB"].ToString().ToEntero() : 0; } set { ViewState["RCveEventoB"] = value; } } + public int Folio { get { return ViewState["Folio"] != null ? ViewState["Folio"].ToString().ToEntero() : 0; } set { ViewState["Folio"] = value; } } + public decimal Avance { get { return ViewState["Avance"] != null ? ViewState["Avance"].ToString().ToEntero() : 0; } set { ViewState["Avance"] = value; } } + public int CveUsuarioPara { get { return ViewState["CveUsuarioPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioPara"] = value; } } + public int CveUsuarioDe { get { return ViewState["CveUsuarioDe"].ToString().ToEntero(); } set { ViewState["CveUsuarioDe"] = value; } } + public List LCveUsuarioCCP { get { if (ViewState["LCveUsuarioCCP"] == null) { ViewState["LCveUsuarioCCP"] = new List(); } return (List)ViewState["LCveUsuarioCCP"]; } set { ViewState["LCveUsuarioCCP"] = value; } } + public List LcveuserVisto { get { if (ViewState["LcveuserVisto"] == null) { ViewState["LcveuserVisto"] = new List(); } return (List)ViewState["LcveuserVisto"]; } set { ViewState["LcveuserVisto"] = value; } } + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (Request["CveEvento"] != null) + { + RCveEvento = Request["CveEvento"].ToString().ToEntero(); + } + if(RCveEvento > 0) + { + loadEvento(); + } + + DdlPara.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus =1 ", "Rol ASC"); ; + DdlPara.DataBind(); + + DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlTema.DataBind(); + DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + + } + public void loadEvento() + { + string separator = ""; + StringBuilder str = new StringBuilder(); + str.AppendLine("datosGant=["); + using (ClsOIEventos oieve = new ClsOIEventos()) + { + if (oieve.GetTareaConHijos(RCveEvento,UsuarioActual.CveEmpresa)) + { + foreach (System.Data.DataRow dr in oieve.DtResultados.Select("Nivel > 0")) + { + str.AppendLine(string.Format("{0}{{id: {1}, text: \"{2}\", start_date: \"{3:yyyy/MM/dd}\", end_date: \"{4:yyyy/MM/dd}\", parent: {5}, progress:{6}, open: true }}", + separator,dr["CveEvento"], dr["Asunto"].ToString().Replace("\\", "\\\\").Replace("\"", "\\\""), dr["FechaInicio"], dr["FechaFin"], (dr["Nivel"].ToString().ToEntero()<=1?0: dr["CveEventoPadre"].ToString().ToEntero()), dr["Avance"].ToString().ToDecimal()/100)); + separator = ","; + + } + } + } + str.AppendLine("];loadGant();"); + this.RegistraScript(str.ToString()); + UpContenido.Update(); + //{ id: 2, text: "Direccion: evaluación de mercado", start_date: "2020/04/29 00:00", end_date: "2020/05/02 00:00",/*duration: 3,*/ parent: 1, progress: 0.25 } + } + + protected void LnkNewProyecto_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarProyecto)); + RCveEventoB = RCveEvento; + } + + protected void btnguardarProyecto_Click(object sender, EventArgs e) + { + string errorMessage = ""; + + int cveUsuarioDe = UsuarioActual.CveUsuario; + List listaCCP = new List(); + int cveUsuarioPara = DdlPara.SelectedValue.ToEntero(); + + OITipoEventos cveTipoEvento = OITipoEventos.Proyecto; + string asunto = TxtAsunto.Text; + string descripcion = TxtDescripcion.Text; + int prioridad = DdlPrioridad.SelectedValue.ToEntero(); + string fechaInicio = ""; + if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "No se ingresó una fecha de inicio valida"; + + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); + } + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + string fechaFin = ""; + if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "No se ingresó una fecha fin valida"; + + } + else + { + fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")); + } + } + else + { + fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + int cveRevision = DdlTema.SelectedValue.ToEntero(); + string archivoname = ""; + string rutaarchivoOri = ""; + //string ArchivoExtencion = ""; + //foreach (Archivo item in TxtArchivo.getfiles().Archivos) + //{ + // archivoname = item.filenameO; + // ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + // rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + //} + + + int cveUsuarioIng = UsuarioActual.CveUsuario; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + int Folio = -1; + int CveEvento = -1; + + if (cveUsuarioDe <= 0) + { + errorMessage = "No se selecciono el miembro 'C C Para'"; + } + + if (cveUsuarioPara <= 0) + { + errorMessage = "No se selecciono el miembro 'Para'"; + + } + if (errorMessage.Length == 0) + { + + List chkList = new List(); + + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEventoB); + + CveEvento = objOI.CveEvento; + Folio = objOI.Folio; + if (CveEvento == 0) + { + Continuar = false; + } + if (Continuar) + { + objOI.Commit(); + //ObjEventosCorreo o = objOI.objCorreo; + //string mailbody = MailgetBodyNuevatarea(o.Folio, o.Link, o.Asunto, o.Descripcion, o.Fechai, o.Fechaf, o.Prioridad, o.Tema); + //EnviarCorreo(UsuarioActual.Empresa, o.AsuntoCorreo, mailbody, o.mailPara, ""); + } + else + { + objOI.RollBack(); + Continuar = false; + } + } + if (Continuar && CveEvento > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + //this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/Proyecto.aspx?CveEvento={0}\");", CveEvento)); + loadEvento(); + TxtAsunto.Text = ""; + TxtDescripcion.Text = ""; + txtFechaF.Text = ""; + txtFechaI.Text = ""; + } + } + + } + + + + protected void BtnopenmodalClickGant_Click(object sender, EventArgs e) + { + + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarProyecto)); + RCveEventoB = txtCveEvento.Text.ToEntero(); + } +} \ No newline at end of file diff --git a/OI/RepMinutas.aspx b/OI/RepMinutas.aspx index 4185ec46d..4490d418e 100644 --- a/OI/RepMinutas.aspx +++ b/OI/RepMinutas.aspx @@ -6,7 +6,7 @@
  • - Crear Minuta + Crear Minuta
  • diff --git a/OI/RepMinutas.aspx.vb b/OI/RepMinutas.aspx.vb index 291199234..c63326e75 100644 --- a/OI/RepMinutas.aspx.vb +++ b/OI/RepMinutas.aspx.vb @@ -51,9 +51,9 @@ Partial Class OI_RepMinutas 'e.Row.Cells(1).Width = Unit.Pixel(200) 'Asunto 'e.Row.Cells(2).Width = Unit.Pixel(550) 'Descripcion 'e.Row.Cells(3).Width = Unit.Pixel(70) 'TareasTotal - - e.Row.FCLiteral("LtlFechaInicio").Text = String.Format("{1}", e.Row.DBCampo("CveEvento"), e.Row.DBCampo("FechaInicio").ToDateTime.ToString("dd/MM/yyyy")) - e.Row.FCLiteral("LtlAsunto").Text = String.Format("{1}", e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) + + e.Row.FCLiteral("LtlFechaInicio").Text = String.Format("{1}", e.Row.DBCampo("CveEvento"), e.Row.DBCampo("FechaInicio").ToDateTime.ToString("dd/MM/yyyy")) + e.Row.FCLiteral("LtlAsunto").Text = String.Format("{1}", e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) End If End Sub diff --git a/OI/RepProyectos.aspx b/OI/RepProyectos.aspx new file mode 100644 index 000000000..05fe28076 --- /dev/null +++ b/OI/RepProyectos.aspx @@ -0,0 +1,239 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepProyectos.aspx.cs" Inherits="OI_RepProyectos" %> + + + + + + + + Proyectos + + + + + + + +
  • + Agregar Proyecto +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + <%# string.Format("
    {1}
    ",Eval("Avance"),Eval("Avance","%{0:##0.##}") , + (Convert.ToDecimal(Eval("Avance").ToString())>70? "green-sharp":(Convert.ToDecimal(Eval("Avance").ToString())>35?"yellow-saffron":"red-haze"))) + %> +
    + <%--yellow-saffron--%> + <%--green-sharp--%> + <%--red-haze--%> + <%-- --%> +
    +
    +
    +
    + + +
    +
    +
    + + + + diff --git a/OI/RepProyectos.aspx.cs b/OI/RepProyectos.aspx.cs new file mode 100644 index 000000000..4cb9cc150 --- /dev/null +++ b/OI/RepProyectos.aspx.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class OI_RepProyectos : ClsPaginas +{ + #region Propiedades + public const string iddivAgregarProyecto = "iddivAgregarProyecto"; + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + DdlPara.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus =1 ", "Rol ASC"); ; + DdlPara.DataBind(); + + DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlTema.DataBind(); + DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); + cargar(); + } + } + + public void cargar() + { + + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + if (ObjOI_E.GetEventos2(-1, UsuarioActual.CveEmpresa, -1) && ObjOI_E.DtResultados.Rows.Count > 0) + { + System.Data.DataTable dt = ObjOI_E.DtResultados; + GvProyecto.DataSource = dt.FiltraParametros(string.Format("CveTipoEvento ={0} AND (CveUsuarioDe ={1} OR CveUsuarioPara={1} ) AND (CveEventoPadre IS NULL OR CveEventoPadre <= 0)", (int)OITipoEventos.Proyecto, UsuarioActual.CveUsuario)); + GvProyecto.DataBind(); + } + } + UpContenido.Update(); + } + protected void LnkNewProyecto_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarProyecto)); + } + + protected void btnguardarProyecto_Click(object sender, EventArgs e) + { + string errorMessage = ""; + + int cveUsuarioDe = UsuarioActual.CveUsuario; + List listaCCP = new List(); + int cveUsuarioPara = DdlPara.SelectedValue.ToEntero(); + + OITipoEventos cveTipoEvento = OITipoEventos.Proyecto; + string asunto = TxtAsunto.Text; + string descripcion = TxtDescripcion.Text; + int prioridad = DdlPrioridad.SelectedValue.ToEntero(); + string fechaInicio = ""; + if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "No se ingresó una fecha de inicio valida"; + + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); + } + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + string fechaFin = ""; + if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "No se ingresó una fecha fin valida"; + + } + else + { + fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")); + } + } + else + { + fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + int cveRevision = DdlTema.SelectedValue.ToEntero(); + string archivoname = ""; + string rutaarchivoOri = ""; + //string ArchivoExtencion = ""; + //foreach (Archivo item in TxtArchivo.getfiles().Archivos) + //{ + // archivoname = item.filenameO; + // ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + // rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + //} + + + int cveUsuarioIng = UsuarioActual.CveUsuario; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + int Folio = -1; + int CveEvento = -1; + + if (cveUsuarioDe <= 0) + { + errorMessage = "No se selecciono el miembro 'C C Para'"; + } + + if (cveUsuarioPara <= 0) + { + errorMessage = "No se selecciono el miembro 'Para'"; + + } + if (errorMessage.Length == 0) + { + + List chkList = new List(); + + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa); + + CveEvento = objOI.CveEvento; + Folio = objOI.Folio; + if (CveEvento == 0) + { + Continuar = false; + } + if (Continuar) + { + objOI.Commit(); + //ObjEventosCorreo o = objOI.objCorreo; + //string mailbody = MailgetBodyNuevatarea(o.Folio, o.Link, o.Asunto, o.Descripcion, o.Fechai, o.Fechaf, o.Prioridad, o.Tema); + //EnviarCorreo(UsuarioActual.Empresa, o.AsuntoCorreo, mailbody, o.mailPara, ""); + } + else + { + objOI.RollBack(); + Continuar = false; + } + } + if (Continuar && CveEvento > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + //this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/Proyecto.aspx?CveEvento={0}\");", CveEvento)); + this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion); + + cargar(); + TxtAsunto.Text = ""; + TxtDescripcion.Text = ""; + txtFechaF.Text = ""; + txtFechaI.Text = ""; + } + } + + } +} \ No newline at end of file diff --git a/OI/RepTareas.aspx b/OI/RepTareas.aspx index 4eb21bc4e..bf1d9f034 100644 --- a/OI/RepTareas.aspx +++ b/OI/RepTareas.aspx @@ -13,7 +13,7 @@
  • - Nueva Tarea + Nueva Tarea
  • @@ -27,7 +27,7 @@ - + - - + + + + + + + + + + + + + +
    Fecha Inicio:Fecha Inicio de:
    @@ -42,7 +42,7 @@
    Fecha Fin: + Fecha Inicio a:
    @@ -64,7 +64,7 @@
    Revisión:Tema: @@ -78,6 +78,38 @@
    Fecha Fin de: +
    + + + + +
    + + +
    Fecha Fin A: + +
    + + + + +
    + + +
    @@ -86,10 +118,101 @@
    + + +
    +
    +
    +
    +
    +

    + + +

    + Me asignaron +
    +
    + +
    +
    +
    +
    + + 56% Avance + +
    +
    +
    Avance
    +
    57%
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    + + + +

    + CCP +
    +
    + +
    +
    +
    +
    + + 76% Avance + +
    +
    +
    Avance
    +
    76%
    +
    +
    +
    +
    +
    +
    +
    +
    +

    + + + +

    + Asigne +
    +
    + +
    +
    +
    +
    + + 85% Avance + +
    +
    +
    Avance
    +
    85%
    +
    +
    +
    +
    +
    + +
    +
    -
    + @@ -113,15 +236,15 @@ - +
    - " style="display: inline-block;margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info" > + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
    - - + --%> - --%> + + + <%-- + --%> @@ -175,17 +316,17 @@ - + --%>
    + Folio @@ -139,27 +262,45 @@ + <%-- Comentario - Prioridad + <%-- + + Tema + + + + + Fecha Inicio + + + + + Fecha Fin + + + Orden - - Revisión + Tema + <%-- Empresa -
    - + @@ -204,21 +345,36 @@ - + <%-- - + --%> - + <%-- + + + + --%> + + + + + + + + + + + <%-- - + --%> @@ -234,11 +390,11 @@ - + <%-- - + --%> @@ -261,7 +417,7 @@ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - +
    - --%> + + @@ -314,9 +482,9 @@
    @@ -290,13 +446,25 @@ + <%-- + + + Fecha Inicio + + + + + Fecha Fin + + - +
    - + - + @@ -343,10 +511,20 @@ - + <%-- + --%> + + + + + + + + + @@ -385,7 +563,7 @@ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - +
    - + --%> + + +
    @@ -408,14 +586,27 @@ Prioridad + <%-- Orden - + + Fecha Inicio + + + + + Fecha Fin + + + - Revisión + Tema @@ -433,9 +624,9 @@
    - + - + @@ -457,10 +648,20 @@ - + <%-- + --%> + + + + + + + + + @@ -554,7 +755,7 @@ } function settamaños() { var tamaño = $(window).height() - 350; - $('#<%= UPDatosOIEventosTareasAsignaron.ClientID() %>').css({ "max-height": tamaño+"px"}); + $('#<%= UPDatosOIEventosTareasAsignaron.ClientID() %>').css({ "max-height": tamaño + "px" }); $('#<%= UPDatosOIEventosTareasCCP.ClientID() %>').css({ "max-height": tamaño + "px" }); $('#<%= UPDatosOIEventosTareasAsigne.ClientID() %>').css({ "max-height": tamaño + "px" }); } diff --git a/OI/RepTareas.aspx.vb b/OI/RepTareas.aspx.vb index 8359ad047..50d6ff229 100644 --- a/OI/RepTareas.aspx.vb +++ b/OI/RepTareas.aspx.vb @@ -45,10 +45,10 @@ Partial Class OI_RepTareas Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then - If UsuarioActual.CveRol = 1 Then - ThEmpresa.Visible = True - GvDatosOIEventosTareasAsignaron.Columns(9).Visible = True - End If + 'If UsuarioActual.CveRol = 1 Then + ' ThEmpresa.Visible = True + ' GvDatosOIEventosTareasAsignaron.Columns(9).Visible = True + 'End If 'ORDEN ASIGNADAS ViewState("Orden0") = "" @@ -66,6 +66,7 @@ Partial Class OI_RepTareas CargaDatosOIEventosTareasAsigne() CargaDatosOIEventosTareasCCP() End If + UpGrafica.Update() End Sub Private Sub CargaFiltros() @@ -108,7 +109,7 @@ Partial Class OI_RepTareas If ObjProspectos.GetRepEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, CveEventoEstatus, DdlRevision.SelectedValue.ToEntero, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaI, FechaF, TipoReporte:=TipoReporte) Then DTOIEventosTareas = ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioPara = {0} AND CveTipoEvento IN (1,3)", UsuarioActual.CveUsuario)) - + ltlGrafMEasiginaron.Text = DTOIEventosTareas.Rows.Count.ToString() 'BURBUJITAS - BADGE If DTOIEventosTareas.FiltraParametros("EventoEstatus = 'Pendiente'").Rows.Count > 0 Then LtBurbujitaAsignaronPendientes.Text = String.Format("{0}", DTOIEventosTareas.FiltraParametros("EventoEstatus = 'Pendiente'").Rows.Count) @@ -150,8 +151,8 @@ Partial Class OI_RepTareas Protected Sub GvDatosOIEventosTareasAsignaron_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosOIEventosTareasAsignaron.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.FCLiteral("LtlUsuarioDe").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioDe")) - e.Row.FCLiteral("LtlAsunto").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) + e.Row.FCLiteral("LtlUsuarioDe").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioDe")) + e.Row.FCLiteral("LtlAsunto").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) e.Row.Attributes.Add("onclick", String.Format("Previo({0});", e.Row.DBCampo("CveEvento"))) e.Row.Attributes.Add("onmouseover", "this.style.background='silver';this.style.cursor='pointer';") @@ -175,7 +176,7 @@ Partial Class OI_RepTareas If ObjProspectos.GetEventosUsuarioCCP(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, DdlRevision.SelectedValue.ToEntero, FechaI, FechaF, CveEventoEstatus) Then DTOIEventosTareasCCP = ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioIng = {0} And CveTipoEvento In (1,3)", UsuarioActual.CveUsuario)) - + ltlgrafCcp.Text = DTOIEventosTareasCCP.Rows.Count.ToString() 'BURBUJITAS - BADGE If DTOIEventosTareasCCP.FiltraParametros("EventoEstatus = 'Pendiente'").Rows.Count > 0 Then LtBurbujitaCCPPendientes.Text = String.Format("{0}", DTOIEventosTareasCCP.FiltraParametros("EventoEstatus = 'Pendiente'").Rows.Count) @@ -216,9 +217,9 @@ Partial Class OI_RepTareas End Sub Protected Sub GvDatosOIEventosTareasCCP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosOIEventosTareasCCP.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.FCLiteral("LtlUsuarioDe").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioDe")) - e.Row.FCLiteral("LtlUsuarioPara").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioDe")) - e.Row.FCLiteral("LtlAsunto").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) + e.Row.FCLiteral("LtlUsuarioDe").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioDe")) + e.Row.FCLiteral("LtlUsuarioPara").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioDe")) + e.Row.FCLiteral("LtlAsunto").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) e.Row.Attributes.Add("onclick", String.Format("Previo({0});", e.Row.DBCampo("CveEvento"))) e.Row.Attributes.Add("onmouseover", "this.style.background='silver';this.style.cursor='pointer';") @@ -242,7 +243,7 @@ Partial Class OI_RepTareas If ObjProspectos.GetRepEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, CveEventoEstatus, DdlRevision.SelectedValue.ToEntero, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaI, FechaF, TipoReporte:=TipoReporte) Then DTOIEventosTareasAsigne = ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioIng = {0} And CveTipoEvento In (1,3)", UsuarioActual.CveUsuario)) - + ltlgrafAsigne.Text = DTOIEventosTareasAsigne.Rows.Count.ToString() 'BURBUJITAS - BADGE If DTOIEventosTareasAsigne.FiltraParametros("EventoEstatus = 'Pendiente'").Rows.Count > 0 Then LtBurbujitaAsignePendientes.Text = String.Format("{0}", DTOIEventosTareasAsigne.FiltraParametros("EventoEstatus = 'Pendiente'").Rows.Count) @@ -282,8 +283,8 @@ Partial Class OI_RepTareas End Sub Protected Sub GvDatosOIEventosTareasAsigne_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosOIEventosTareasAsigne.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.FCLiteral("LtlUsuarioPara").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioPara")) - e.Row.FCLiteral("LtlAsunto").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) + e.Row.FCLiteral("LtlUsuarioPara").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("UsuarioPara")) + e.Row.FCLiteral("LtlAsunto").Text = String.Format("{2}", e.Row.DBCampo("CveTipoEvento"), e.Row.DBCampo("CveEvento"), e.Row.DBCampo("Asunto")) e.Row.Attributes.Add("onclick", String.Format("Previo({0});", e.Row.DBCampo("CveEvento"))) e.Row.Attributes.Add("onmouseover", "this.style.background='silver';this.style.cursor='pointer';") @@ -393,4 +394,7 @@ Partial Class OI_RepTareas + Protected Sub LinkButton1_Click(sender As Object, e As EventArgs) + + End Sub End Class diff --git a/OI/RepTareas2.aspx b/OI/RepTareas2.aspx index b49be0b16..212a12e0c 100644 --- a/OI/RepTareas2.aspx +++ b/OI/RepTareas2.aspx @@ -1,384 +1,80 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepTareas2.aspx.cs" Inherits="OI_RepTareas2" %> - + - - + - + - + - -
  • - Agregar Tarea -
  • + - + - - - - -