diff --git a/App_Code/BundleConfig.vb b/App_Code/BundleConfig.vb index 96ebcff7a..e3da720f1 100644 --- a/App_Code/BundleConfig.vb +++ b/App_Code/BundleConfig.vb @@ -51,6 +51,7 @@ Public Class BundleConfig "~/Metronic/assets/admin/layout/scripts/demo.js", "~/Metronic/assets/admin/pages/scripts/table-advanced.js", "~/Metronic/assets/admin/pages/scripts/ui-alert-dialog-api.js", + "~/Metronic/assets/global/plugins/icheck/icheck.min.js", "~/Metronic/assets/global/plugins/dropzone/dropzone.js", "~/Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js", "~/Scripts/custom.js" @@ -76,6 +77,7 @@ Public Class BundleConfig "~/Metronic/assets/layouts/global/scripts/quick-nav.min.js", "~/Metronic/assets/admin/pages/scripts/table-advanced.js", "~/Metronic/assets/admin/pages/scripts/ui-alert-dialog-api.js", + "~/Metronic/assets/global/plugins/icheck/icheck.min.js", "~/Metronic/assets/global/plugins/dropzone/dropzone.js", "~/Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js", "~/Scripts/custom.js" @@ -198,6 +200,7 @@ Public Class BundleConfig "~/Metronic/assets/global/plugins/datatables/extensions/Scroller/css/dataTables.scroller.min.css", "~/Metronic/assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css", "~/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css", + "~/Metronic/assets/global/plugins/icheck/skins/all.css", "~/Styles/thickbox.css", "~/Metronic/assets/global/css/components.css", "~/Metronic/assets/global/css/plugins.css", @@ -221,6 +224,7 @@ Public Class BundleConfig "~/Metronic/assets/global/plugins/datatables2/extensions/KeyTable/css/keyTable.dataTables.min.css", "~/Metronic/assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css", "~/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css", + "~/Metronic/assets/global/plugins/icheck/skins/all.css", "~/Styles/thickbox.css", "~/Metronic/assets/global/css/components.css", "~/Metronic/assets/global/css/plugins.css", diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 72436f388..2be1a8152 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -346,6 +346,8 @@ Public Class ClsClasificaciones Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") Then Alert("Ya existe una clasificación con el mismo nombre: " & Clasificacion & ".", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("TR_ClasificacionesUpCuenta") Then + Alert("No se puede registrar una prepóliza en un periodo cerrado. " & Clasificacion & ".", TipoMensaje.MsgAdvertencia) Else Me.OnError("Ocurrió un error al guardar los cambios en la Clasificación", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 1cfd182a5..1f94c267d 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -3861,6 +3861,7 @@ Public Class ClsContabilidad Return Retorno End Function + Public Function GetAnexoCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, OpcionCuentas As Integer, CveSubProyecto As String, CveEmpresa As Integer, Optional TipoMovtos As Integer = -1, Optional SAT As Integer = 0) As Boolean Dim Retorno = False diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 4404872e7..adbc2cd08 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -4,7 +4,18 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports Extensiones - +Public Enum OITipoEventos + Tarea = 1 + Agenda = 2 + Proyecto = 3 + Control_de_Versiones_de_Doctos = 4 + Minuta = 5 + Bitacora = 6 + Scrum = 7 + ISO = 8 + Soporte = 9 + Gastos_Mes = 10 +End Enum Public Class ClsOIEventos Implements IDisposable @@ -171,7 +182,192 @@ Public Class ClsOIEventos End Sub +#Region "oieventos2.0" + Public Function GetEventos2(cveEvento As Int32, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_Eventos2Get", CommandType.StoredProcedure) + 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 Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + 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 + Dim retorno As Boolean = False + DataAdapter("PA_OI_Eventos2Add", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@Folio", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@cveTipoEvento", SqlDbType.Int).Value = cveTipoEvento + .Add("@asunto", SqlDbType.VarChar).Value = asunto + .Add("@descripcion", SqlDbType.VarChar).Value = descripcion + .Add("@prioridad", SqlDbType.Int).Value = prioridad + .Add("@cveUsuarioDe", SqlDbType.Int).Value = cveUsuarioDe + .Add("@cveUsuarioPara", SqlDbType.Int).Value = cveUsuarioPara + .Add("@fechaInicio", SqlDbType.VarChar).Value = fechaInicio + .Add("@fechaFin", SqlDbType.VarChar).Value = fechaFin + .Add("@cveRevision", SqlDbType.Int).Value = cveRevision + .Add("@archivo", SqlDbType.VarChar).Value = archivo + .Add("@cveUsuarioIng", SqlDbType.Int).Value = cveUsuarioIng + .Add("@cveEmpresa", SqlDbType.Int).Value = cveEmpresa + End With + Try + SqlAdapter.Fill(Data) + CveEvento = SqlAdapter.SelectCommand.Parameters("@CveEvento").Value.ToString().ToEntero() + Folio = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString().ToEntero() + 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 UpdateEstatusEvento2(CveEventoEstatus As Integer, CveComentario As Integer, CveEvento As Integer, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_EventosEstatusUpdate2") + + 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 + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus en el Evento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + +#Region "CRUD_cheklist" + Public Function Getcheklist(cveEvento As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Addcheklist(cveEvento As Int32, eventoComentario As String, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@eventoComentario", SqlDbType.VarChar).Value = eventoComentario + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + 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 + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistUp", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEventoCheckList", SqlDbType.Int).Value = cveEventoCheckList + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@eventoComentario", SqlDbType.VarChar).Value = eventoComentario + .Add("@estatus", SqlDbType.Bit).Value = estatus + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Removecheklist(cveEventoCheckList As Int32, cveEvento As Int32, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistRemove", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEventoCheckList", SqlDbType.Int).Value = cveEventoCheckList + .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 eliminar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function +#End Region + + Public Function AddUPEventoArchivo(CveEvento As Integer, Archivo As String, CveUsuario As Integer) 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 + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Retorno = False + Me.OnError("Ocurrió un error al Guardar el comentario 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) + End Try + + Return Retorno + End Function + Public Function UPEventoAAvance(CveEvento As Integer, Avance As Decimal, CveUsuario As Integer) 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 + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Retorno = False + Me.OnError("Ocurrió un error al Guardar el comentario 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) + End Try + + Return Retorno + End Function +#End Region diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index f2783bffd..f833f851d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -34,6 +34,18 @@ Public Class ClsPaginas Public Shared Property EmpresaNotificaciones() As Empresa + + + Public ReadOnly Property EsProduccion As Boolean + Get + If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then + Return False + Else + Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1") + End If + End Get + End Property + #Region "Propiedades" Public Shared ReadOnly Property UrlSitio As String @@ -3978,6 +3990,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepTopClientesVentas.aspx".ToUpper(), 755) PaginaDict.Add("/OI/Circular.aspx".ToUpper(), 756) PaginaDict.Add("/OI/CircularDetalle.aspx".ToUpper(), 757) + PaginaDict.Add("/OI/CircularDetalleB.aspx".ToUpper(), 757) #End Region @@ -4405,6 +4418,7 @@ Public Class ClsPaginas 'OI #Region "OI" PaginaDict.Add("/OI/EventoDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/TareaDetalle.aspx".ToUpper(), -1) PaginaDict.Add("/OI/Normatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/RepNormatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/Minutas.aspx".ToUpper(), -1) @@ -5146,80 +5160,111 @@ Public Class ClsPaginas 'limpio ReportViwer Dim sw As New System.Diagnostics.Stopwatch() sw.Start() - Dim bdir As String = AppDomain.CurrentDomain.BaseDirectory - RutaReporte.Replace("/", "\") - If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then - RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) - End If - Dim CveUsuario As Integer = 0 - Dim CveEmpresa As Integer = 0 - If Context.Session("UsuarioSIG") IsNot Nothing Then - CveUsuario = UsuarioActual.CveUsuario - CveEmpresa = UsuarioActual.CveEmpresa - - End If Dim Bytes As Byte() = Nothing - Dim wsreport As New WSRDLC.WebServiceSoapClient - Dim params As New List(Of WSRDLC.ReportParameter) - Dim ds As New DataSet - For Each rpds As ReportDataSource In DataSource - Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) - If dt Is Nothing Then - dt = New DataTable - Else - dt = dt.Copy() + If EsProduccion Then + + Dim bdir As String = AppDomain.CurrentDomain.BaseDirectory + RutaReporte.Replace("/", "\") + If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then + RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) End If - dt.TableName = rpds.Name - ds.Tables.Add(dt) - Next - For Each rpds As ReportParameter In Parametros - Dim param As New WSRDLC.ReportParameter - param.Name = rpds.Name - param.Values = {rpds.Values(0)} - params.Add(param) - Next - Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) - 'Dim ruta = wsreport.StreamPDF(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) - 'If File.Exists(ruta) Then - ' Bytes = File.ReadAllBytes(ruta) - ' File.Delete(ruta) - 'End If - 'Dim setup As AppDomainSetup = New AppDomainSetup - 'With setup - ' .ApplicationBase = Environment.CurrentDirectory - ' .LoaderOptimization = LoaderOptimization.MultiDomainHost - 'End With - 'setup.SetCompatibilitySwitches({"NetFx40_LegacySecurityPolicy"}) - 'Dim _casPolicyEnabledDomain As AppDomain = AppDomain.CreateDomain("Full Trust", Nothing, setup) - 'Dim fllreport As ADSReportLib.FullTrustReportviewer = Nothing - 'Try + Dim CveUsuario As Integer = 0 + Dim CveEmpresa As Integer = 0 + If Context.Session("UsuarioSIG") IsNot Nothing Then + CveUsuario = UsuarioActual.CveUsuario + CveEmpresa = UsuarioActual.CveEmpresa + End If + Dim wsreport As New WSRDLC.WebServiceSoapClient + Dim params As New List(Of WSRDLC.ReportParameter) + Dim ds As New DataSet + For Each rpds As ReportDataSource In DataSource + Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) + If dt Is Nothing Then + dt = New DataTable() + Else + dt = dt.Copy() + End If + dt.TableName = rpds.Name + ds.Tables.Add(dt) + Next + For Each rpds As ReportParameter In Parametros + Dim param As New WSRDLC.ReportParameter + param.Name = rpds.Name + param.Values = {rpds.Values(0)} + params.Add(param) + Next + Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) + Else + If IsNothing(MR) Then MR = New ReportViewer + Try + ' MasterReporteador.LocalReport.DataSources.Clear() + For Each RDS As ReportDataSource In DataSource + MR.LocalReport.DataSources.Add(RDS) + Next - ' fllreport = CType(_casPolicyEnabledDomain.CreateInstanceFromAndUnwrap(GetType(ADSReportLib.FullTrustReportviewer).Assembly.CodeBase, GetType(ADSReportLib.FullTrustReportviewer).FullName), ADSReportLib.FullTrustReportviewer) + MR.LocalReport.ReportPath = RutaReporte + MR.ProcessingMode = ProcessingMode.Local + MR.LocalReport.EnableExternalImages = True + MR.LocalReport.SetParameters(Parametros) + MR.LocalReport.Refresh() + Dim Warnings As Warning() = Nothing + Dim StreamIds As String() = Nothing + Dim MimeType As String = Nothing + Dim Encoding As String = Nothing + Dim Extension As String = Nothing + Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings) + Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + Catch ex As Exception + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + End Try + MR.Dispose() + 'Dim ruta = wsreport.StreamPDF(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) + 'If File.Exists(ruta) Then + ' Bytes = File.ReadAllBytes(ruta) + ' File.Delete(ruta) + 'End If + 'Dim setup As AppDomainSetup = New AppDomainSetup + 'With setup + ' .ApplicationBase = Environment.CurrentDirectory + ' .LoaderOptimization = LoaderOptimization.MultiDomainHost + 'End With + 'setup.SetCompatibilitySwitches({"NetFx40_LegacySecurityPolicy"}) + 'Dim _casPolicyEnabledDomain As AppDomain = AppDomain.CreateDomain("Full Trust", Nothing, setup) + 'Dim fllreport As ADSReportLib.FullTrustReportviewer = Nothing + 'Try - ' fllreport.Initialize("DisplayName", RutaReporte, Parametros.AsEnumerable(), New List(Of String()), True) - ' For Each RDS As ReportDataSource In DataSource - ' fllreport.AddDataSources(RDS.Name, DirectCast(RDS.Value, DataTable)) - ' Next - ' Dim Warnings As Warning() = Nothing - ' Dim StreamIds As String() = Nothing - ' Dim MimeType As String = Nothing - ' Dim Encoding As String = Nothing - ' Dim Extension As String = Nothing - ' Bytes = fllreport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds) - ' fllreport = Nothing - 'Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException - ' GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") - ' 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 - ' 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") - 'Catch ex As Exception - ' GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") - ' 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 - ' 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") - 'Finally - ' AppDomain.Unload(_casPolicyEnabledDomain) - 'End Try - 'If fllreport IsNot Nothing Then fllreport.liberarecursos() + ' fllreport = CType(_casPolicyEnabledDomain.CreateInstanceFromAndUnwrap(GetType(ADSReportLib.FullTrustReportviewer).Assembly.CodeBase, GetType(ADSReportLib.FullTrustReportviewer).FullName), ADSReportLib.FullTrustReportviewer) + ' fllreport.Initialize("DisplayName", RutaReporte, Parametros.AsEnumerable(), New List(Of String()), True) + ' For Each RDS As ReportDataSource In DataSource + ' fllreport.AddDataSources(RDS.Name, DirectCast(RDS.Value, DataTable)) + ' Next + ' Dim Warnings As Warning() = Nothing + ' Dim StreamIds As String() = Nothing + ' Dim MimeType As String = Nothing + ' Dim Encoding As String = Nothing + ' Dim Extension As String = Nothing + ' Bytes = fllreport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds) + ' fllreport = Nothing + 'Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException + ' GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + ' 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + ' 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + 'Catch ex As Exception + ' GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + ' 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + ' 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + 'Finally + ' AppDomain.Unload(_casPolicyEnabledDomain) + 'End Try + 'If fllreport IsNot Nothing Then fllreport.liberarecursos() + + End If sw.Stop() If sw.Elapsed.TotalSeconds > 1 Then GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 0a0c9935b..ed22628cc 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -569,6 +569,14 @@ Namespace Extensiones Else Return Nothing End If + End Function + + + + Public Function ToDateTimeExcat(Str As String, Optional format As String = "dd/MM/yyyy HH:mm") As DateTime + Dim fecha As DateTime = New DateTime() + DateTime.TryParseExact(Str, format, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, fecha) + Return fecha End Function diff --git a/CRM/CatEtapasProceso.aspx b/CRM/CatEtapasProceso.aspx index 3baa490c2..7143b56a1 100644 --- a/CRM/CatEtapasProceso.aspx +++ b/CRM/CatEtapasProceso.aspx @@ -15,6 +15,12 @@
  • Agregar Etapas de Proceso
  • +
  • + PDF +
  • +
  • + Excel +
  • diff --git a/CRM/CatEtapasProceso.aspx.cs b/CRM/CatEtapasProceso.aspx.cs index 6bcb487ca..64ba4adf0 100644 --- a/CRM/CatEtapasProceso.aspx.cs +++ b/CRM/CatEtapasProceso.aspx.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; +using Microsoft.Reporting.WebForms; using Extensiones; @@ -317,4 +318,36 @@ public partial class CRM_CatEtapasProceso : ClsPaginas CargaDatos(DdlFiltroProceso.SelectedValue.ToEntero()); } #endregion + + protected void LnkImprimir_Click(object sender,EventArgs e) + { + Imprimir("PDF"); + } + + protected void LnkImprimirExcel_Click(object sender, EventArgs e) + { + Imprimir("EXCEL"); + } + + private void Imprimir(string formato) + { + System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); + + List param = new List(); + + param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); + if (Image.Exists) + { + param.Add(new ReportParameter("LogoPath", logouri)); + } + else + { + param.Add(new ReportParameter("LogoPath", "")); + } + param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString())); + + ImprimirPDF("Empresas/Grales/Formatos/RepCatEtapasProceso.rdlc", TmpDT, param, "Report Cat Etapas Proceso", formato); + } } \ No newline at end of file diff --git a/CRM/CatProbabilidadAcercamiento.aspx b/CRM/CatProbabilidadAcercamiento.aspx index e2978bb2b..9e7699641 100644 --- a/CRM/CatProbabilidadAcercamiento.aspx +++ b/CRM/CatProbabilidadAcercamiento.aspx @@ -15,6 +15,12 @@
  • Agregar Probabilidad de Acercamiento
  • +
  • + PDF +
  • +
  • + Excel +
  • @@ -32,11 +38,12 @@ CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true" GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVDatos_RowDeleting" OnRowDataBound="GVDatos_RowDataBound"> - + + <%-- - + --%> <%-- diff --git a/CRM/CatProbabilidadAcercamiento.aspx.cs b/CRM/CatProbabilidadAcercamiento.aspx.cs index 9b9d51d3d..218417bfb 100644 --- a/CRM/CatProbabilidadAcercamiento.aspx.cs +++ b/CRM/CatProbabilidadAcercamiento.aspx.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; +using Microsoft.Reporting.WebForms; using Extensiones; @@ -195,4 +196,35 @@ public partial class CRM_CatProbabilidadAcercamiento : ClsPaginas } } #endregion + protected void LnkImprimir_Click(object sender, EventArgs e) + { + Imprimir("PDF"); + } + + protected void LnkImprimirExcel_Click(object sender, EventArgs e) + { + Imprimir("EXCEL"); + } + + private void Imprimir(string formato) + { + System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); + + List param = new List(); + + param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); + if (Image.Exists) + { + param.Add(new ReportParameter("LogoPath", logouri)); + } + else + { + param.Add(new ReportParameter("LogoPath", "")); + } + param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString())); + + ImprimirPDF("Empresas/Grales/Formatos/RepCatProbabilidadAcercamiento", TmpDT, param, "Report Cat Etapas Proceso", formato); + } } \ No newline at end of file diff --git a/CRM/CatTipoProceso.aspx b/CRM/CatTipoProceso.aspx index cab84064b..42989a142 100644 --- a/CRM/CatTipoProceso.aspx +++ b/CRM/CatTipoProceso.aspx @@ -15,6 +15,12 @@
  • Agregar Tipo de Proceso
  • +
  • + PDF +
  • +
  • + Excel +
  • diff --git a/CRM/CatTipoProceso.aspx.cs b/CRM/CatTipoProceso.aspx.cs index 63c987665..4d8c68f10 100644 --- a/CRM/CatTipoProceso.aspx.cs +++ b/CRM/CatTipoProceso.aspx.cs @@ -5,7 +5,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; - +using Microsoft.Reporting.WebForms; using Extensiones; public partial class CRM_CatTipoProceso : ClsPaginas @@ -183,4 +183,36 @@ public partial class CRM_CatTipoProceso : ClsPaginas } #endregion + + protected void LnkImprimir_Click(object sender, EventArgs e) + { + Imprimir("PDF"); + } + + protected void LnkImprimirExcel_Click(object sender, EventArgs e) + { + Imprimir("EXCEL"); + } + + private void Imprimir(string formato) + { + System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); + + List param = new List(); + + param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); + if (Image.Exists) + { + param.Add(new ReportParameter("LogoPath", logouri)); + } + else + { + param.Add(new ReportParameter("LogoPath", "")); + } + param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString())); + + ImprimirPDF("Empresas/Grales/Formatos/RepCatTipoProceso.rdlc", TmpDT, param, "Report Cat Tipo Proceso", formato, RDSName: "DataSet1"); + } } \ No newline at end of file diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 3e3673985..e68d731a6 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -302,7 +302,13 @@ public partial class CRM_EmpresaCRM : ClsPaginas } if (!ObjBitacora.AddEventoBitacora(Mensaje, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { HuboError = true; + }else + { + string asunto = String.Format("Se registró la empresa {0} con datos RFC: {1}, Vendedor: {2}", NombreEmpresa, RFC, Vendedor); + mandarCorreo(asunto, Mensaje); + } } } } @@ -316,10 +322,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas if ((CveEncuestaAplicada != 0) && ObjCRM.UpdateEmpresCRM(NombreEmpresa, RFC, CveMedioCaptacion, CveEmpresaCRM, CveVendedorActualizar, UsuarioActual.CveUsuario, CveSubProyecto: CveSubProyecto, Correo: Correo)) { - //if (ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) - //{ - HuboError = false; - //} + if (!ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { + HuboError = true; + }else + { + string asunto = String.Format("Se actualizó la empresa {0}",NombreEmpresa); + string mensaje = String.Format("Se actualizó la empresa {0} con RFC {1} por el usuario {2}", NombreEmpresa, RFC,UsuarioActual.Nombre); + mandarCorreo(asunto, mensaje); + } } } @@ -856,6 +867,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjBitacora.AddEventoBitacora(String.Format("Se registró un Contacto con Nombre: {0}{1}{2}{3}", NombreContacto, TelefonoOficina, Celular, Correo), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { + string asunto = "Se registró un Contacto"; + string mensaje = String.Format("Se registró un Contacto con Nombre: {0}{1}{2}{3}. Realzado por el usuario {4}", NombreContacto, TelefonoOficina, Celular, Correo,UsuarioActual.Nombre); + mandarCorreo(asunto, mensaje); HuboError = false; Alert("El Contacto fue creado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion); } @@ -933,7 +947,12 @@ public partial class CRM_EmpresaCRM : ClsPaginas Alert("El Contacto ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion); if (ObjBitacora.AddEventoBitacora(String.Format("Se eliminó el contacto {0}", NombreContacto), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { + string asunto = "Se eliminó el contacto"; + string mensaje = String.Format("Se eliminó el contacto {0} por el usuario {1}", NombreContacto,UsuarioActual.Nombre); + mandarCorreo(asunto, mensaje); ObjCRM.Commit(); + } } else { @@ -1079,6 +1098,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjEventos.AddEventoAgenda(DdlTipoAgenda.SelectedValue.ToEntero(), TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridadAgenda.SelectedValue.ToEntero(), FechaInicio, FechaInicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM, CveContactoCRM: DdlContactoAgenda.SelectedValue.ToEntero())) { + mandarCorreo(TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text); limpiarModalAgendar(); RegistraScript("$('#ModalAgenda').modal('hide')"); Alert("El Evento se agendó correctamente", ModExtensiones.TipoMensaje.MsgInformacion); @@ -1389,6 +1409,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas { if (ObjBitacora.AddEventoBitacora(String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoPrincipal, CveEtapaProcesoCRM: CveEtapaProcesoActual)) { + string asunto = String.Format("Se registró el Acercamiento {0}",NombreAcercamiento); + string mensaje = String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text); + mandarCorreo(asunto, mensaje); HuboError = false; } } @@ -1471,4 +1494,17 @@ public partial class CRM_EmpresaCRM : ClsPaginas } } #endregion + private void mandarCorreo(string Asunto, string body) + { + DataTable Usuarios = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa); + int CveUsuario = Usuarios.FiltroPrimeroValor("CveUsuario",String.Format("CveVendedor = {0}",DdlVendedor.SelectedValue)).ToEntero(); + if (CveUsuario != UsuarioActual.CveUsuario) + { + string correoVendedor = Usuarios.FiltroPrimeroValor("Correo", String.Format("CveUsuario = {0}", CveUsuario)); + ClsSisMail Mail = new ClsSisMail(); + List LSRutasMail = new List(); + //ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail(); + Mail.SendMail(ClsPaginas.EmpresaNotificaciones, correoVendedor, Asunto,body); + } + } } \ No newline at end of file diff --git a/CRM/RepAcercamientosProcesos.aspx b/CRM/RepAcercamientosProcesos.aspx index 20b4d8e37..86033c53b 100644 --- a/CRM/RepAcercamientosProcesos.aspx +++ b/CRM/RepAcercamientosProcesos.aspx @@ -34,7 +34,7 @@
  • - Ver Grafica +
  • @@ -86,6 +86,7 @@ + @@ -98,6 +99,7 @@ + diff --git a/CRM/RepAcercamientosProcesos.aspx.cs b/CRM/RepAcercamientosProcesos.aspx.cs index 420dff2cd..b37b05f13 100644 --- a/CRM/RepAcercamientosProcesos.aspx.cs +++ b/CRM/RepAcercamientosProcesos.aspx.cs @@ -107,6 +107,14 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas DdlMedioCaptacion.SelectedValue = "-1"; DdlProbabilidad.SelectedValue = "-1"; DdlTipoProceso.SelectedIndex = 0; + + int n; + string CveProbabilidadAcercamiento = Request["CveProbabilidadAcercamiento"]; + bool isNumeric = int.TryParse(CveProbabilidadAcercamiento, out n); + if (isNumeric) + { + DdlProbabilidad.SelectedValue = CveProbabilidadAcercamiento; + } upDatosRepA.Update(); } protected void cargarDatos() diff --git a/CRM/RepAcercamientosRechazos.aspx b/CRM/RepAcercamientosRechazos.aspx index 380159036..92c87d3e6 100644 --- a/CRM/RepAcercamientosRechazos.aspx +++ b/CRM/RepAcercamientosRechazos.aspx @@ -34,7 +34,7 @@
  • - Ver Grafica +
  • @@ -86,6 +86,7 @@ + @@ -98,6 +99,7 @@ + diff --git a/Contabilidad2/RepBalanceGeneralHorizontal.aspx b/Contabilidad2/RepBalanceGeneralHorizontal.aspx index d43ed39fe..54d5f2b59 100644 --- a/Contabilidad2/RepBalanceGeneralHorizontal.aspx +++ b/Contabilidad2/RepBalanceGeneralHorizontal.aspx @@ -722,7 +722,7 @@ - + @@ -828,11 +828,11 @@ <%-- --%> - + - +
    @@ -1053,17 +1053,18 @@ --%> <%----%> - + - + - +

    + @@ -1119,7 +1120,7 @@
    - + @@ -1273,20 +1274,26 @@ - <%-- + - + - --%> + <%----%> + + + + + + <%----%> diff --git a/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb b/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb index 27be0dd30..97763f31b 100644 --- a/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb +++ b/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb @@ -430,9 +430,12 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue - GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString - - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero + GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString + + + + + Dim CveSubProyecto As Integer = If(DdlSubproyecto.SelectedValue.ToEntero = -1, -2, DdlSubproyecto.SelectedValue.ToEntero) If ObjConta.GetSituacionFinanciera2("01/01/1900".ToDate, FechaF.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, TipoReporte) Then DtDatos = ObjConta.DtResultados @@ -838,7 +841,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("{0}l", vbCrLf), ""))) params.Add(New ReportParameter("pFechaFin", FechaF)) params.Add(New ReportParameter("periodo", String.Format("de {0} {1}", DdlPeriodo.SelectedItem.ToString, DdlEjercicio.SelectedItem.ToString))) - ImprimirPDF(reportpath, DtDatos, params, fileName, Formato) + 'ImprimirPDF(reportpath, DtDatos, params, fileName, Formato) End Sub @@ -852,7 +855,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal FechaIMes = $"01/01/1900" FechaFMes = $"31/12/{DdlEjercicio.SelectedValue}" - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero + Dim CveSubProyecto As Integer = If(DdlSubproyecto.SelectedValue.ToEntero = -1, -2, DdlSubproyecto.SelectedValue.ToEntero) 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjConta As New ClsContabilidad @@ -1243,7 +1246,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal RowAF.Item("Noviembre") = DT_ACTIVO.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") RowAF.Item("Diciembre") = DT_ACTIVO.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - RowAF.Item("Nombre") = "Resultados del Ejercicio:" + RowAF.Item("Nombre") = "TOTALES" RowAF.Item("CtaMayor") = -1 RowAF.Item("ImporteAcumulado") = DT_ACTIVO.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") ' TotalAnterior.ToString DT_TOTALES.Rows.Add(RowAF) @@ -1365,7 +1368,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal FechaIMes = $"01/01/1900" FechaFMes = $"31/12/{DdlEjercicio.SelectedValue}" - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero + Dim CveSubProyecto As Integer = If(DdlSubproyecto.SelectedValue.ToEntero = -1, -2, DdlSubproyecto.SelectedValue.ToEntero) Dim ObjConta As New ClsContabilidad @@ -1504,7 +1507,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_ACTIVO_FIJO.SUM($"[{DT_ACTIVO_FIJO.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL ACTIVO NO CIRCULANTE" Row.Item("ImporteActual") = DT_ACTIVO_FIJO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 Row.Item("ImporteAcumulado") = DT_ACTIVO_FIJO.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") @@ -1512,7 +1515,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("CtaMayor") = -1 DT_ACTIVO_FIJO.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL ACTIVO NO CIRCULANTE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1531,15 +1534,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_ACTIVO_DIFERIDO.SUM($"[{DT_ACTIVO_DIFERIDO.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL ACTIVO DIFERIDO" + Row.Item("ImporteActual") = DT_ACTIVO_DIFERIDO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_ACTIVO_DIFERIDO.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_ACTIVO_DIFERIDO.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL ACTIVO DIFERIDO" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1557,15 +1560,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_PASIVO_CIRCULANTE.SUM($"[{DT_PASIVO_CIRCULANTE.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL PASIVO CIRCULANTE" + Row.Item("ImporteActual") = DT_PASIVO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_PASIVO_CIRCULANTE.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_PASIVO_CIRCULANTE.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL PASIVO CIRCULANTE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1583,15 +1586,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_PASIVO_NO_CIRCULANTE.SUM($"[{DT_PASIVO_NO_CIRCULANTE.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL PASIVO NO CIRCULANTE" + Row.Item("ImporteActual") = DT_PASIVO_NO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_PASIVO_NO_CIRCULANTE.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_PASIVO_NO_CIRCULANTE.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL PASIVO NO CIRCULANTE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1609,15 +1612,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_CAPITAL_CONTABLE.SUM($"[{DT_CAPITAL_CONTABLE.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL CAPITAL CONTABLE" + Row.Item("ImporteActual") = DT_CAPITAL_CONTABLE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_CAPITAL_CONTABLE.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_CAPITAL_CONTABLE.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL CAPITAL CONTABLE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1646,7 +1649,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Next Row.Item("Nombre") = "TOTAL ACTIVO" - Row.Item("ImporteActual") = DT_ACTIVO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("ImporteActual") = DT_ACTIVO.SUM("ImporteActual", "NOT CtaMayor in (-1,3,4)") Row.Item("PorcentajeActual") = 100.0 Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") Row.Item("PorcentajeAcumulado") = 100.0 @@ -1693,7 +1696,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal If DT_TOTALES.Rows.Count > 0 Then - Row = DTTotalesAnualH.NewRow + Row = DT_TOTALES.NewRow IndexData = 11 @@ -1701,11 +1704,13 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_ACTIVO.SUM($"[{DT_ACTIVO.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") - DT_PASIVO.SUM($"[{DT_PASIVO.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"[{DT_CAPITAL_CONTABLE.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") Next - Row.Item("Nombre") = "Resultados del Ejercicio" + Row.Item("Nombre") = "TOTALES" + Row.Item("CtaMayor") = -1 + Row.Item("ImporteActual") = DT_ACTIVO.SUM($"ImporteActual", "Not CtaMayor in (-1,3,4)") - DT_PASIVO.SUM($"ImporteActual", "Not CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"ImporteActual", "Not CtaMayor in (-1,3,4)") Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DT_PASIVO.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DTTotalesAnualH.Rows.Add(Row) + DT_TOTALES.Rows.Add(Row) End If @@ -1934,6 +1939,8 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO_CIRCULANTE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP + DT_ACTIVO_CIRCULANTE.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" @@ -1965,6 +1972,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO_FIJO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO_FIJO.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_ACTIVO_FIJO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO NO CIRCULANTE" @@ -1996,6 +2004,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO_DIFERIDO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO_DIFERIDO.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_ACTIVO_DIFERIDO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO DIFERIDO" @@ -2027,6 +2036,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_PASIVO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_PASIVO_CIRCULANTE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_PASIVO_CIRCULANTE.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL PASIVO CIRCULANTE" @@ -2064,6 +2074,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteActual") = 0.00 Row.Item("ImporteAcumulado") = 0.00 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_PASIVO_NO_CIRCULANTE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_PASIVO_NO_CIRCULANTE.Rows.Add(Row) End If @@ -2090,6 +2101,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_CAPITAL_CONTABLE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_CAPITAL_CONTABLE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_CAPITAL_CONTABLE.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL CAPITAL CONTABLE" @@ -2129,6 +2141,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM("ImporteActual", "NOT CtaMayor in (-1,3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO.SUM("SinSP", "NOT CtaMayor in (-1,3,4)") 'Sin SP DT_ACTIVO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO" @@ -2160,6 +2173,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_PASIVO.SUM("ImporteActual", "NOT CtaMayor in (-1,3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_PASIVO.SUM("SinSP", "NOT CtaMayor in (-1,3,4)") 'Sin SP DT_PASIVO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL PASIVO" @@ -2192,6 +2206,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") Row.Item("CtaMayor") = -2 + Row.Item("SinSP") = DT_TOTALES.SUM("SinSP", "NOT CtaMayor in (-1,3,4)") 'Sin SP DT_TOTALES.Rows.Add(Row) @@ -2245,13 +2260,13 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Dim CveSubProyectoIntermo As String = CType(GvIngresosSubProyectoH.Columns(IndiceInicio), BoundField).DataField Dim Importe As String = e.Row.Cells(IndiceInicio).Text - - e.Row.Cells(IndiceInicio).Text = $"{Importe}" Next IndiceInicio e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/1900&ER=1&CveSubProyecto={-1}" + e.Row.FCHyperLink("HLSinSP").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/1900&ER=1&CveSubProyecto=0" + End If If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx b/Contabilidad2/RepEstadoResultadosHorizontal.aspx index 80ddf6def..f4afe80d8 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx @@ -1,21 +1,21 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" %> - - - - - - - - - - - - - - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" %> + + + + + + + + + + + + + + + + +
    @@ -38,7 +38,7 @@
    - +
    @@ -80,8 +80,8 @@
    -
    - + + @@ -1010,11 +1010,11 @@ - - - - - -
    - - + + + + + +
    + + diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index ca6ada751..00b8b801b 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -2462,7 +2462,29 @@ - Tipo de Comprobante:I Ingreso,Moneda: + Tipo de Comprobante:I + + + + =UCase(Parameters!TipoDocumento.Value) + + + + ,Moneda: + + + Circular + + + + + + + + + + + + + +
    +
    +

    Para

    +
    +
    + + Jorge caudillo(jcaudillo@adsistemas.mx); + Julian Moreno(Julianmoreno@adsistemas.mx); + +
    +
    + +
    +
    +

    Correos Adicionales:

    +
    +
    + +
    +
    +
    +
    +

    Asunto

    +
    +
    + +
    +
    + + +
    +
    +

    Adjuntar Archivos:

    + +
    +
    + +
    +
    + + + +
    +
    + +
    + + + + diff --git a/OI/CircularDetalleB.aspx.cs b/OI/CircularDetalleB.aspx.cs new file mode 100644 index 000000000..3a554f4db --- /dev/null +++ b/OI/CircularDetalleB.aspx.cs @@ -0,0 +1,61 @@ +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_CircularDetalleB : ClsPaginas +{ + public const string iddivAgregarPara = "iddivAgregarPara"; + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + cargarFiltroUsuarios(); + } + } + private void cargarFiltroUsuarios() + { + 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); + GVUsuarios.DataBind(); + UpUsuarios.Update(); + } + + 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 LnkAgregar_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarPara)); + } + + protected void BtnUpPara_Click(object sender, EventArgs e) + { + + } + + protected void BtnUpMiembros_Click(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/OI/TareaDetalle.aspx b/OI/TareaDetalle.aspx new file mode 100644 index 000000000..71e087e71 --- /dev/null +++ b/OI/TareaDetalle.aspx @@ -0,0 +1,919 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TareaDetalle.aspx.cs" Inherits="OI_TareaDetalle" %> + + + + + + + + + + + + + + + + + + + + + + + + +
  • + Agregar CheckList
  • +
  • + Cambiar Estatus
  • +
  • + Agregar Comentario
  • +
  • + Agregar Tema
  • +
  • + Agregar Archivo
  • +
  • + Actualizar Usuarios
  • + +
    +
    +
    + + + + + +
    +
    + +
    +
    + + Tarea +
    +
    + +
    +
    +
    +
    + + + +
    +
    + + + +
    + + +
    +
    +

    De

    +
    +
    + +
    +
    +
    +
    +

    Para

    +
    +
    + +
    +
    + +
    +
    +

    C. C. Para

    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + <%----%> + +
    +
    +
    +
    + + + + <%----%> + +
    +
    +
    +
    +
    +
    + + + + + + + + Prioridad: + +
    +
    +
    +
    + + + + Tema: +
    +
    +
    + +
    +
    +
    +
    + + + + +
    +
    + + CheckList +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + Agregar + <%--Agregar--%> +
    +
    + + + + + + + + + + + <%--
    --%>
    +                                                    
    +                                                         
    +                                                    
    +                                                    <%--
    --%> +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + Estatus +
    +
    + +
    +
    +
    + + + + +
    + + + Estatus: +
    +
    + Avance: + +
    + + +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + + Archivo +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    + + +
    +
    + + Miembros +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    + + + + + Para + + + <%----%> + + + + + + + C. C. Para +
    + + +
    + + + +
    + + Usuario + + + + + + Rol + + + + +
    +
    +
    +
    +
    +
    + +
    + Guardar +
    +
    + +
    +
    + + Registro de actividades +
    +
    + +
    +
    + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + + + diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs new file mode 100644 index 000000000..a17ffd4f0 --- /dev/null +++ b/OI/TareaDetalle.aspx.cs @@ -0,0 +1,825 @@ +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_TareaDetalle : ClsPaginas +{ + #region Propiedades + public const string iddivAgregarPara = "iddivAgregarPara"; + public const string iddivAgregar = "divModalAgregarActividad"; + public const string iddivAgregarArchivo = "divModalAgregarArchivo"; + public const string iddivAgregarTema = "divModalAgregartema"; + public const string iddivCambiarEstatus = "divModalCambiarEstatus"; + 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 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) + { + if (!IsPostBack) + { + EsNuevo = true; + CveUsuarioPara = 0; + //System.Xml.Linq.XDocument document = new System.Xml.Linq.XDocument(new System.Xml.Linq.XElement("root", LCveUsuarioCCP.Select(x => new System.Xml.Linq.XElement("item", x)))); + CveUsuarioDe = 0; + if (Request["Archivo"] != null) + { + string strArchivo = string.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ModExtensiones.Decripta(Request["Archivo"].ToString())); + if (System.IO.File.Exists(strArchivo)) + { + try + { + string filename = ModExtensiones.Decripta(Request["filename"].ToString()); + + System.IO.FileInfo file = new System.IO.FileInfo(strArchivo); + string mimeType = "text/plain"; + try { mimeType = MimeMapping.GetMimeMapping(strArchivo); } + catch (Exception) { } + // Response.Write(path) + Response.Clear(); + Response.ClearHeaders(); + Response.ClearContent(); + Response.AddHeader("Content-Disposition", $"attachment; filename= {Uri.EscapeDataString(filename)}"); + Response.AddHeader("Content-Length", file.Length.ToString()); + Response.ContentType = mimeType; + Response.Flush(); + Response.TransmitFile(file.FullName); + Response.End(); + } + catch (Exception) + { + this.RegistraScript("window.close();"); + } + } + else + { + this.RegistraScript("window.close();"); + } + } + else + { + + CargaTemas(); + CargaEstatus(); + cargaUsuarios(); + if (Request["CveEvento"] != null) + { + RCveEvento = Request["CveEvento"].ToString().ToEntero(); + } + if (RCveEvento > 0) + { + EsNuevo = false; + LoadTarea(); + } + else + { + portletEstatus.Visible = false; + LtlTitulo.Text = "Tarea Nueva"; + TxtArchivo.Visible = true; + CveUsuarioDe = UsuarioActual.CveUsuario; + } + SetUsuarios(); + HypArchivo.Visible = !TxtArchivo.Visible; + } + } + } + private void CargaTemas() + { + DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlTema.DataBind(); + DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); + + } + private void CargaEstatus() + { + + DdlEventoEstatus.DataSource = GlobalDTOIEstatusEventos;//get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DDlEstatus.DataSource = DdlEventoEstatus.DataSource; + DdlEventoEstatus.DataBind(); + DDlEstatus.DataBind(); + DdlEventoEstatus.Enabled = false; + //DdlEventoEstatus.Items.Insert(0, new ListItem("Seleccione", "-1")); + + } + private void cargaUsuarios() + { + string FiltroAD = ""; + + + 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); + GVUsuarios.DataBind(); + UpUsuarios.Update(); + + + GVUsuarios.DataSource = get_GlobalDTUsuarios().FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1 {1}", UsuarioActual.CveEmpresa, FiltroAD), "Rol ASC"); + GVUsuariosB.DataSource = GVUsuarios.DataSource; + GVUsuarios.DataBind(); + GVUsuariosB.DataBind(); + } + + protected void GVUsuariosB_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 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); + } + + } + private void cargaActividades(ClsOIEventos ObjOI) + { + GvActividades.DataSource = null; + if (ObjOI.GetEventosComentarios(RCveEvento)) + { + GvActividades.DataSource = ObjOI.DtResultados; + } + GvActividades.DataBind(); + UpActividades.Update(); + } + private void SetUsuarios() + { + StringBuilder StrPara = new StringBuilder(); + StringBuilder StrDeUser = new StringBuilder(); + StringBuilder StrCCPara = new StringBuilder(); + foreach (GridViewRow gvRow in GVUsuariosB.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkpara = gvRow.FCCheckBox("ChkPara"); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + chkpara.Checked = false; + chkCCpara.Checked = false; + + if (EsNuevo) + { + chkpara.Enabled = true; + chkCCpara.Enabled = true; + if (CveUsuario == CveUsuarioDe) + { + chkCCpara.Enabled = false; + } + } + else + { + + chkpara.Enabled = false; + chkCCpara.Enabled = false; + } + + if ((CveUsuario == CveUsuarioPara) || (CveUsuario == CveUsuarioDe)) + { + if (CveUsuario == CveUsuarioPara) + { + chkpara.Checked = true; + StrPara.AppendFormat("\"{0}\"", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString()); + } + if (CveUsuario == CveUsuarioDe) + { + chkCCpara.Checked = true; + StrDeUser.AppendFormat("\"{0}\"", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString()); + } + } + else if (CveUsuario.Contiene(LCveUsuarioCCP.ToArray())) + { + chkCCpara.Checked = true; + StrCCPara.AppendFormat("\"{0}\"; ", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString()); + } + } + } + LtlPara.Text = StrPara.ToString(); + LtlDeUser.Text = StrDeUser.ToString(); + LtlCCPara.Text = StrCCPara.ToString(); + + + foreach (GridViewRow gvRow in GVUsuarios.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkpara = gvRow.FCCheckBox("ChkPara"); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + chkpara.Checked = false; + chkCCpara.Checked = false; + + + if ((CveUsuario == CveUsuarioPara) || (CveUsuario == CveUsuarioDe)) + { + if (CveUsuario == CveUsuarioPara) + { + chkpara.Checked = true; + } + if (CveUsuario == CveUsuarioDe) + { + chkCCpara.Checked = true; + } + } + else if (CveUsuario.Contiene(LCveUsuarioCCP.ToArray())) + { + chkCCpara.Checked = true; + } + } + } + } + + public void LoadTarea() + { + 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) + { + PnlUsuarios.Visible = true; + portletMiembros.Visible = false; + LnkUpFile.Visible = 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(); + DdlPrioridad.SelectedValueExist(drow["Prioridad"].ToString()); + 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"; + CveUsuarioDe = drow["CveUsuarioDe"].ToString().ToEntero(); + CveUsuarioPara = drow["CveUsuarioPara"].ToString().ToEntero(); + 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] + + LtlTitulo.Text = drow["Titulo"].ToString(); + if (ObjOI_E.GetEventosUsuario(RCveEvento, UsuarioActual.CveEmpresa)) + { + LCveUsuarioCCP.Clear(); + foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Select("CveEvento >0")) + { + LCveUsuarioCCP.Add(item["CveUsuario"].ToString().ToEntero()); + } + } + if (ObjOI_E.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = ObjOI_E.DtResultados; + if (ObjOI_E.DtResultados.Rows.Count > 0) + { + portletChekList.Visible = true; + LnkAgregarCheckList.Visible = false; + } + } + cargaActividades(ObjOI_E); + } + } + GVcheklist.DataBind(); + } + + protected void LnkGuardar_Click(object sender, EventArgs e) + { + if (EsNuevo) + { + string errorMessage = ""; + int cveUsuarioDe = UsuarioActual.CveUsuario; + List listaCCP = new List(); + int cveUsuarioPara = -1; + + foreach (GridViewRow gvRow in GVUsuariosB.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkpara = gvRow.FCCheckBox("ChkPara"); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + if (chkpara.Checked) + { + cveUsuarioPara = CveUsuario; + } + if (chkCCpara.Checked) + { + listaCCP.Add(CveUsuario); + //cveUsuarioDe = CveUsuario; + } + } + } + if (!cveUsuarioDe.Contiene(listaCCP.ToArray())) + { + listaCCP.Add(cveUsuarioDe); + } + if (!cveUsuarioPara.Contiene(listaCCP.ToArray())) + { + listaCCP.Add(cveUsuarioPara); + } + OITipoEventos cveTipoEvento = OITipoEventos.Tarea; + 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) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, cveUsuarioIng, cveEmpresa); + CveEvento = objOI.CveEvento; + Folio = objOI.Folio; + if (CveEvento == 0) + { + Continuar = false; + } + if (Continuar && CheckListNew != null) + { + foreach (System.Data.DataRow item in CheckListNew.Rows) + { + if (Continuar) + { + Continuar = objOI.Addcheklist(CveEvento, item["EventoComentario"].ToString(), UsuarioActual.CveUsuario); + + } + + } + } + if (Continuar) + { + foreach (int item in listaCCP) + { + if (Continuar) + { + Continuar = objOI.AddEventoUsuario(CveEvento, item); + + } + + } + } + 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 tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento)); + } + } + else + { + this.Alert(errorMessage, ModExtensiones.TipoMensaje.MsgAdvertencia); + + } + } + } + + 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ó la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + } + protected void LnkAgregarCheckList_Click(object sender, EventArgs e) + { + portletChekList.Visible = true; + LnkAgregarCheckList.Visible = false; + if (RCveEvento > 0) + { + + } + else + { + GVcheklist.Columns[0].Visible = false; + 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)); + + } + UpChkList.Update(); + } + 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 ha agregó la actividad", 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)) + { + Alert("Se actualizó el estatus de la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + protected void LnkEditarCheck_Click(object sender, EventArgs e) + { + + } + + protected void BtnCambiarEstatus_Click(object sender, EventArgs e) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + + + if (objOI.UpdateEstatusEvento2(DDlEstatus.SelectedValue.ToEntero(), -1, RCveEvento, UsuarioActual.CveUsuario)) + { + //CargaEstatusEventos(DdlEventoEstatus.SelectedValue.ToEntero); + + //if (DdlEventoEstatus.SelectedValue.ToEntero == 3 | DdlEventoEstatus.SelectedValue.ToEntero == 1) + // EnviarCorreoCambioEstatus(false); + //CargaDatos(); + string mensaje = string.Format("Se cambio el Estatus de \"{0}\" a \"{1}\"", DdlEventoEstatus.SelectedItem.Text, DDlEstatus.SelectedItem.Text); + DdlEventoEstatus.SelectedValueExist(DDlEstatus.SelectedValue); + UpEstatus.Update(); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivCambiarEstatus)); + Alert(mensaje, ModExtensiones.TipoMensaje.ToastInformacion); + cargaActividades(objOI); + } + + } + + } + + protected void LnkcambiarEstatus_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivCambiarEstatus)); + } + + + + protected void LnkSinfuncion_Click(object sender, EventArgs e) + { + + } + + protected void LnkAgregarTema_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarTema)); + } + + protected void BtnAgregarTema_Click(object sender, EventArgs e) + { + + using (ClsOIEventos objoi = new ClsOIEventos()) + { + if (objoi.AddRevisionesEventos(TxtTema.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + Alert("Tema agregada con éxito.", ModExtensiones.TipoMensaje.MsgInformacion); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarTema)); + TxtTema.Text = ""; + set_GlobalDTOIRevision(-1, objoi.DtResultados); + CargaTemas(); + UpContenido.Update(); + } + else { Alert("Ocurrió un error al agregar la revisión. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError); } + + } + } + + protected void LnkAgregarActividad_Click(object sender, EventArgs e) + { + + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregar)); + } + + 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.AddEventoComentario(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario); + 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)); + } + + } + + 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 LnkUpFile_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarArchivo)); + + } + + protected void BtnActualizarArchivo_Click(object sender, EventArgs e) + { + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in txtActualizarArchivo.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); + } + 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); + } + string rutafin = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + int index = 0; + while (System.IO.File.Exists(rutafin)) + { + archivoname = string.Format("{0}{1}", index++, archivoname); + rutafin = string.Format("{0}{1}", ruta, archivoname); + } + System.IO.File.Move(rutaarchivoOri, rutafin); + bool continuar = false; + using (ClsOIEventos objoi = new ClsOIEventos()) + { + continuar = objoi.AddUPEventoArchivo(RCveEvento, archivoname, UsuarioActual.CveUsuario); + + } + if (continuar) + { + LoadTarea(); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarArchivo)); + this.Alert("Archivo Actualizadó", ModExtensiones.TipoMensaje.ToastInformacion); + } + UpContenido.Update(); + UpAcciones.Update(); + } + + protected void BtnUpAvance_Click(object sender, EventArgs e) + { + + bool continuar = false; + using (ClsOIEventos objoi = new ClsOIEventos()) + { + continuar = objoi.UPEventoAAvance(RCveEvento, TxtAvance.Text.ToDecimal(), UsuarioActual.CveUsuario); + if (continuar) + { + if (objoi.DtResultados.Rows.Count > 0) + { + LtlTitulo.Text = objoi.DtResultados.Rows[0]["Titulo"].ToString(); + } + cargaActividades(objoi); + } + } + if (continuar) + { + this.Alert("Avance Actualizadó", ModExtensiones.TipoMensaje.ToastInformacion); + + } + UpTitulo.Update(); + } + + protected void LnkAddTtemaB_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarTema)); + } + + protected void LnkUpUsuarios_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarPara)); + } + + protected void BtnUpMiembros_Click(object sender, EventArgs e) + { + + } + +} \ No newline at end of file diff --git a/RH/MiPerfil.aspx.vb b/RH/MiPerfil.aspx.vb index 8af718431..93b917727 100644 --- a/RH/MiPerfil.aspx.vb +++ b/RH/MiPerfil.aspx.vb @@ -1119,11 +1119,12 @@ Partial Class RH_MiPerfil continuar = False End If End If + Dim CorreoSupervisor As String = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, DdlSupervisor.SelectedValue.ToEntero).FiltroPrimeroValor("Correo") objRH.Dispose() If continuar Then CargaVacaciones() CargaVacacionesResumenPeriodoActual() - VacacionesMandaCorreoSupervisor("Vacaciones " & UsuarioActual.Nombre, "antonio.gonzalez@adssistemas.mx", VacSupervisorNombre, NombreCompleto, fInicio, fFin, "vacaciones") + VacacionesMandaCorreoSupervisor("Vacaciones " & UsuarioActual.Nombre, CorreoSupervisor, VacSupervisorNombre, NombreCompleto, fInicio, fFin, "vacaciones") RegistraScript("$('#ModalAddVacaciones').modal('hide');") End If Else @@ -1208,7 +1209,8 @@ Partial Class RH_MiPerfil Else Alert("Permiso agregado Actualizado correctamente") End If - VacacionesMandaCorreoSupervisor("Permiso para " & UsuarioActual.Nombre, "antonio.gonzalez@adssistemas.mx", VacSupervisorNombre, NombreCompleto, TxtFechaInicioPer.Text, TxtFechaFinPer.Text, "permiso") + Dim CorreoSupervisor As String = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, DdlSupervisor.SelectedValue.ToEntero).FiltroPrimeroValor("Correo") + VacacionesMandaCorreoSupervisor("Permiso para " & UsuarioActual.Nombre, CorreoSupervisor, VacSupervisorNombre, NombreCompleto, TxtFechaInicioPer.Text, TxtFechaFinPer.Text, "permiso") RegistraScript("$('#DvPermisos').modal('hide');") End If diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 4a1480b55..23307d079 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1178,6 +1178,7 @@ Partial Class RH_Personal 'Carga Datos Personales LtlPersonal.Text = ObjPersonal.NombreCompleto + NombreCompleto = ObjPersonal.NombreCompleto 'TxtNombre.Text = ObjPersonal.Nombre TxtAPaterno.Text = ObjPersonal.APaterno TxtAMaterno.Text = ObjPersonal.AMaterno diff --git a/Scripts/custom.js b/Scripts/custom.js index 2e9e49583..4212ccf60 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -1993,7 +1993,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }); } - textoOld = texto + textoOld = texto; }; let GETPSALMACEN = function () { @@ -2016,10 +2016,10 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }; lupa.bind("click", function () { buscaPS(Minput.val()); - }) + }); Minput.bind("copy paste cut", function () { buscaPS(Minput.val()); - }) + }); Minput.bind("keyup ", function (e) { if (e.keyCode == 13) { buscaPS(Minput.val()); @@ -2027,7 +2027,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { } else { buscaPSTimer(Minput.val()); } - }) + }); PSModal.on('click', '.list-group-item ', function (e) { let $this = $(this).hasClass('list-group-item') ? $(this) : $(this).closest('.list-group-item'); @@ -2054,7 +2054,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }); PSModal.on('shown.bs.modal', function () { Minput.focus(); - }) + }); PSModal.on('click', '.item-almacen', function (e) { let $this = $(this).hasClass('item-almacen') ? $(this) : $(this).closest('.item-almacen'); let cveps = $(PSModal.find('.active')).data('cve');