diff --git a/AF/CatCheckList.aspx b/AF/CatCheckList.aspx new file mode 100644 index 000000000..790db7f2a --- /dev/null +++ b/AF/CatCheckList.aspx @@ -0,0 +1,74 @@ +<%@ Page Title="AF - Catálogo de CheckList" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatCheckList.aspx.cs" Inherits="AF_CatCheckList" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de CheckList + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AF/CatCheckList.aspx.cs b/AF/CatCheckList.aspx.cs new file mode 100644 index 000000000..d488bf25c --- /dev/null +++ b/AF/CatCheckList.aspx.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class AF_CatCheckList : ClsPaginas +{ + private int CveCheckList + { + get + { + return ViewState["CveCheckList"].ToString().ToEntero(); + } + + set + { + ViewState["CveCheckList"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAF ObjAF = new ClsAF(); + if (ObjAF.GetCheckList(-1, -1, -1)) + { + GvDatos.DataSource = ObjAF.DtResultados; + GvDatos.DataBind(); + } + + DdlTipoServicio.Items.Clear(); + if (ObjAF.GetTiposServicios(-1,-1,-1,UsuarioActual.CveEmpresa)) + { + DdlTipoServicio.DataSource = ObjAF.DtResultados; + DdlTipoServicio.DataBind(); + DdlTipoServicio.Items.Insert(0, new ListItem("Seleccione","-1")); + } + + DdlCheckListActividad.Items.Clear(); + if (ObjAF.GetCheckListActividad(-1, -1)) + { + DdlCheckListActividad.DataSource = ObjAF.DtResultados; + DdlCheckListActividad.DataBind(); + DdlCheckListActividad.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + + ObjAF.Dispose(); + } + + protected void BtnAgregarCheckListD_Click(object sender, EventArgs e) + { + BtnAgregarCheckList.Text = "Agregar"; + DdlTipoServicio.SelectedValueExist(-1); + DdlCheckListActividad.SelectedValueExist(-1); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarCheckList.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckList = GvRow.DataKey("CveCheckList").ToEntero(); + DdlTipoServicio.SelectedValueExist(GvRow.DataKey("CveTipoServicio")); + DdlCheckListActividad.SelectedValueExist(GvRow.DataKey("CveCheckListActividad")); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckList = GvRow.DataKey("CveCheckList").ToEntero(); + ClsAF ObjAF = new ClsAF(); + if (ObjAF.DeleteCheckList(CveCheckList)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se eliminó el CheckList correctamente"); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarCheckList_Click(object sender, EventArgs e) + { + ClsAF ObjAF = new ClsAF(); + if (BtnAgregarCheckList.Text == "Agregar") + { + if (ObjAF.AddCheckList(DdlTipoServicio.SelectedValue.ToEntero(), DdlCheckListActividad.SelectedValue.ToEntero())) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se agregó el CheckList correctamente"); + } + } + else + { + if (ObjAF.UpdateCheckList(CveCheckList, DdlTipoServicio.SelectedValue.ToEntero(), DdlCheckListActividad.SelectedValue.ToEntero())) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se actualizó el CheckList correctamente"); + } + } + ObjAF.Dispose(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + } +} \ No newline at end of file diff --git a/AF/CatCheckListActividades.aspx b/AF/CatCheckListActividades.aspx new file mode 100644 index 000000000..e4179f25a --- /dev/null +++ b/AF/CatCheckListActividades.aspx @@ -0,0 +1,76 @@ +<%@ Page Title="AF - Catálogo de Actividades de CheckList" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatCheckListActividades.aspx.cs" Inherits="AF_CatCheckListActividades" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Actividades de CheckList + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AF/CatCheckListActividades.aspx.cs b/AF/CatCheckListActividades.aspx.cs new file mode 100644 index 000000000..f21d58f7a --- /dev/null +++ b/AF/CatCheckListActividades.aspx.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class AF_CatCheckListActividades : ClsPaginas +{ + private int CveCheckListActividad + { + get + { + return ViewState["CveCheckListActividad"].ToString().ToEntero(); + } + + set + { + ViewState["CveCheckListActividad"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAF ObjAF = new ClsAF(); + if (ObjAF.GetCheckListActividad(-1, -1)) + { + GvDatos.DataSource = ObjAF.DtResultados; + GvDatos.DataBind(); + } + + if (ObjAF.GetCheckListActividadGrupo(-1)) + { + DdlCheckListActividadGrupo.DataSource = ObjAF.DtResultados; + DdlCheckListActividadGrupo.DataBind(); + DdlCheckListActividadGrupo.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarActividadCheckListD_Click(object sender, EventArgs e) + { + BtnAgregarActividadCheckList.Text = "Agregar"; + TxtCheckListActividad.Text = ""; + DdlCheckListActividadGrupo.SelectedValueExist(-1); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarActividadCheckList.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckListActividad = GvRow.DataKey("CveCheckListActividad").ToEntero(); + TxtCheckListActividad.Text = GvRow.DataKey("CheckListActividad"); + DdlCheckListActividadGrupo.SelectedValueExist(GvRow.DataKey("CveCheckListActividadGrupo")); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckListActividad = GvRow.DataKey("CveCheckListActividad").ToEntero(); + ClsAF ObjAF = new ClsAF(); + if (ObjAF.DeleteCheckListActividad(CveCheckListActividad)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se eliminó la Actividad de CheckList correctamente"); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarActividadCheckList_Click(object sender, EventArgs e) + { + ClsAF ObjAF = new ClsAF(); + if (BtnAgregarActividadCheckList.Text == "Agregar") + { + if (ObjAF.AddCheckListActividad(TxtCheckListActividad.Text, DdlCheckListActividadGrupo.SelectedValue.ToEntero())) + { + Alert("Se agregó la Actividad de CheckList correctamente"); + } + } + else + { + if (ObjAF.UpdateCheckListActividad(CveCheckListActividad, TxtCheckListActividad.Text, DdlCheckListActividadGrupo.SelectedValue.ToEntero())) + { + Alert("Se actualizó la Actividad de CheckList correctamente"); + } + } + ObjAF.Dispose(); + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + } +} \ No newline at end of file diff --git a/AF/TipoOrdenTrabajo.aspx b/AF/TipoOrdenTrabajo.aspx index e6ebb33b7..907178821 100644 --- a/AF/TipoOrdenTrabajo.aspx +++ b/AF/TipoOrdenTrabajo.aspx @@ -39,15 +39,21 @@ - - - - - Registro Revisión + Tipo Servicio + + + +
  • + +
  • +
    +
    + +
    @@ -90,9 +96,7 @@
    - - @@ -100,13 +104,13 @@
    -
    - +<%--
    + -
    +
    --%> @@ -125,28 +129,43 @@ - +
    - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
    @@ -156,49 +175,73 @@
    -
    +
    - - + + - - - - - - + + + + + + + + - - + + + + + + + + + + + + + + + + +
    - +
    - - + + + + - - - - - - + + + + + + - - + + + + + + + +
    @@ -209,13 +252,60 @@ - - - - - - + + + @@ -262,13 +352,14 @@
    +
    - + diff --git a/AF/TipoOrdenTrabajo.aspx.vb b/AF/TipoOrdenTrabajo.aspx.vb index 71b84d52f..f559d1da8 100644 --- a/AF/TipoOrdenTrabajo.aspx.vb +++ b/AF/TipoOrdenTrabajo.aspx.vb @@ -12,20 +12,59 @@ Partial Class AF_TipoOrdenTrabajo #Region " PROPIEDADES" - Property CveOrdenTrabajo As Integer + Property CveTipoServicio As Integer Get - If ViewState("CveOrdenTrabajo") Is Nothing Then + If ViewState("CveTipoServicio") Is Nothing Then Return -1 Else - Return ViewState("CveOrdenTrabajo").ToString.ToEntero + Return ViewState("CveTipoServicio").ToString.ToEntero End If End Get Set(value As Integer) - ViewState("CveOrdenTrabajo") = value + ViewState("CveTipoServicio") = value + End Set + End Property + + Property DTMateriales As DataTable + Get + If ViewState("DTMateriales") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTMateriales"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTMateriales") = value End Set End Property + Property DTActividades As DataTable + Get + If ViewState("DTActividades") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTActividades"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTActividades") = value + End Set + End Property + + + Property DTACheckList As DataTable + Get + If ViewState("DTACheckList") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTACheckList"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTACheckList") = value + End Set + End Property #End Region @@ -34,8 +73,12 @@ Partial Class AF_TipoOrdenTrabajo If Not Page.IsPostBack Then - If Request("CveOrdenTrabajo") IsNot Nothing Then - CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero + If Request("CveTipoServicio") IsNot Nothing Then + CveTipoServicio = Request("CveTipoServicio").ToEntero + End If + + If CveTipoServicio = -1 Then + CrearTablas() End If CargaCombos() @@ -43,11 +86,57 @@ Partial Class AF_TipoOrdenTrabajo End Sub + + Property IndexMaterial As Integer + Get + If ViewState("IndexMaterial") Is Nothing Then + Return -1 + Else + Return ViewState("IndexMaterial").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("IndexMaterial") = value + End Set + End Property + + + + Property IndexActividades As Integer + Get + If ViewState("IndexActividades") Is Nothing Then + Return -1 + Else + Return ViewState("IndexActividades").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("IndexActividades") = value + End Set + End Property + + Property IndexCheckList As Integer + Get + If ViewState("IndexCheckList") Is Nothing Then + Return -1 + Else + Return ViewState("IndexCheckList").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("IndexCheckList") = value + End Set + End Property + + + + #Region " CARGA PARAMETROS " #End Region #Region " CARGA COMBOS " + Protected Sub CargaCombos() Dim ObjAF As New ClsAF @@ -65,6 +154,52 @@ Partial Class AF_TipoOrdenTrabajo UpFiltro.Update() + DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + + + If CveTipoServicio <= 0 Then + CargaActividades() + + End If + + End Sub + + + + + +#End Region + +#Region "CREAR TABLAS" + + Private Sub CrearTablas() + 'CveTipoServicioMaterial CveTipoServicio Cantidad CveUM CvePS Tipo + + Dim DtTempMaterial As New DataTable + Dim DtTempActividades As New DataTable + + DtTempMaterial.Columns.Add("CveTipoServicioMaterial", GetType(Integer)) + DtTempMaterial.Columns.Add("CveTipoServicio", GetType(Integer)) + DtTempMaterial.Columns.Add("Cantidad", GetType(Decimal)) + DtTempMaterial.Columns.Add("CveUM", GetType(Integer)) + DtTempMaterial.Columns.Add("CvePS", GetType(Integer)) + DtTempMaterial.Columns.Add("Tipo", GetType(Integer)) + DtTempMaterial.Columns.Add("PS", GetType(String)) + DtTempMaterial.Columns.Add("Abreviatura", GetType(String)) + DtTempMaterial.AcceptChanges() + + DTMateriales = DtTempMaterial + + + 'CveTipoServicioActividad CveActividad Duracion Observaciones + + DtTempActividades.Columns.Add("CveTipoServicioActividad", GetType(String)) + DtTempActividades.Columns.Add("CveActividad", GetType(String)) + DtTempActividades.Columns.Add("Duracion", GetType(Decimal)) + DtTempActividades.Columns.Add("Observaciones", GetType(String)) + DtTempActividades.AcceptChanges() + + DTActividades = DtTempActividades End Sub @@ -72,6 +207,7 @@ Partial Class AF_TipoOrdenTrabajo #End Region + #Region " CARGA DATOS " 'Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) ' CargaDatos() @@ -85,6 +221,61 @@ Partial Class AF_TipoOrdenTrabajo Private Sub CargaDatos() + CargaMateriales() + CargaActividades() + CargaCheckList() + + End Sub + + Private Sub CargaMateriales() + + If CveTipoServicio > 0 Then + + Dim ObjAF As New ClsAF + + If ObjAF.GetTiposServiciosMaterial(-1, CveTipoServicio) Then + GvMaterial.DataSource = DTMateriales + + Else + GvMaterial = Nothing + End If + + ObjAF.Dispose() + + GvMaterial.DataBind() + Else + GvMaterial.DataSource = DTMateriales + GvMaterial.DataBind() + End If + + UpGvMaterial.Update() + + End Sub + + Private Sub CargaActividades() + + Dim ObjAF As New ClsAF + + If CveTipoServicio <= 0 Then + + If ObjAF.GetActividades(-1, -1, -1, UsuarioActual.CveEmpresa) Then + GvActividades.DataSource = ObjAF.DtResultados + Else + GvActividades.DataSource = Nothing + End If + + End If + + ObjAF.Dispose() + + GvActividades.DataBind() + + UpGvActividades.Update() + + End Sub + + Private Sub CargaCheckList() + Dim ObjAF As New ClsAF @@ -94,7 +285,6 @@ Partial Class AF_TipoOrdenTrabajo End Sub - Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then @@ -110,9 +300,6 @@ Partial Class AF_TipoOrdenTrabajo - Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) - - End Sub @@ -277,4 +464,154 @@ Partial Class AF_TipoOrdenTrabajo + Protected Sub LnkAgregarMaterial_Click(sender As Object, e As EventArgs) + + RegistraScript("$('#ModalMateriales').modal('show');") + ResetModalMaterial() + End Sub + + Private Sub ResetModalMaterial() + + DdlPS.txtValue.Value = "" + DdlPS.txtText.Value = "" + TxtCantidad.Text = "" + + UpModalMaterialesBody.Update() + + End Sub + + + + + Protected Sub BtnGuardarMaterial_Click(sender As Object, e As EventArgs) + + If DdlPS.txtValue.Value.ToString.ToEntero <= 0 Then + Alert("Debe seleccionar un producto o servicio", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim CveUnidadMedida As Integer = -1 + Dim CvePS As Integer = DdlPS.txtValue.Value.ToEntero + Dim Tipo As Integer = -1 + Dim UMAbreviatura As String = "" + + Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") + CveUnidadMedida = drPS("CveUM").ToString.ToEntero + Tipo = drPS("CveTipoPS").ToString.ToEntero + UMAbreviatura = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Abreviatura", $"CveUnidadMedida = {CveUnidadMedida}") + + If CveTipoServicio > 0 Then + + Dim ObjAF As New ClsAF + + If ObjAF.AddTiposServiciosMaterial(CveTipoServicio, TxtCantidad.Text.ToDecimal, CveUnidadMedida, CvePS, Tipo) Then + Alert("Material agregado correctamente") + End If + + ObjAF.Dispose() + + Else + + Dim nRow As DataRow = DTMateriales.NewRow + + nRow("CveTipoServicioMaterial") = -1 + nRow("CveTipoServicio") = -1 + nRow("Cantidad") = TxtCantidad.Text.ToEntero + nRow("CveUM") = CveUnidadMedida + nRow("CvePS") = DdlPS.txtValue.Value.ToEntero + nRow("Tipo") = Tipo + nRow("Abreviatura") = UMAbreviatura + nRow("PS") = DdlPS.txtText.Value + + DTMateriales.Rows.Add(nRow) + Alert("Material agregado correctamente") + + End If + + CargaMateriales() + + ResetModalMaterial() + + RegistraScript("$('#ModalMateriales').modal('hide');") + + End Sub + + Protected Sub LnkEliminarMaterial_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow) + If CveTipoServicio > 0 Then + + + Dim CveTipoServicioMaterial As Integer = GvRow.DataKey("CveTipoServicioMaterial").ToEntero + + Dim ObjAF As New ClsAF + If ObjAF.DeleteTiposServiciosMaterial(CveTipoServicioMaterial, UsuarioActual.CveEmpresa) Then + Alert("Material agregado correctamente") + End If + ObjAF.Dispose() + Else + + + Dim dr As DataRow = DTMateriales.Rows(GvRow.RowIndex) + dr.Delete() + DTMateriales.AcceptChanges() + Alert("Material agregado correctamente") + End If + + CargaMateriales() + + End Sub + + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + + Dim ObjAF As New ClsAF + Dim ErrorProceso As Boolean = False + Dim SBError As New StringBuilder + + ObjAF.IniciaTransacSQL() + + 'validacion? + + + + If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + + + CveTipoServicio = ObjAF.CveTipoServicio + + For Each GvRow As GridViewRow In GvMaterial.Rows + + If Not ObjAF.AddTiposServiciosMaterial(CveTipoServicio, GvRow.DataKey("Cantidad").ToDecimal, GvRow.DataKey("CveUM").ToEntero, GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("Tipo").ToEntero) Then + ErrorProceso = True + Exit For + End If + + Next + + For Each GvRow As GridViewRow In GvActividades.Rows + + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim Horas As Decimal = GvRow.FCTextBox("").Text.ToDecimal + + + If ObjAF.AddTiposServiciosActividades(GvRow.DataKey("").ToEntero) Then + + Next + + + End If + + + If ErrorProceso Then + ObjAF.RollBack() + Else + ObjAF.Commit() + Alert("Tipo servicio guardado correctamente.", TipoMensaje.MsgInformacion) + End If + + + ObjAF.Dispose() + + End Sub + End Class diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index c8f341270..c66beb356 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -89,10 +89,12 @@ Public Class ClsAF Public Property CveGrupoAF As Integer Public Property CveAFPadre As Integer Public Property CveDispositivo As Integer - Public Property MedidaVehicular As Integer - + Public Property MedidaVehicular As Integer + Public Property CveTipoServicio As Integer + + #End Region - + Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) If TransaccionCompartida Is Nothing Then @@ -3502,7 +3504,7 @@ Public Class ClsAF Public Function AddTiposServicios(Nombre As String, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False - + CveTipoServicio = -1 DataAdapter("PA_AF_TiposServicioAdd") With SqlAdapter.SelectCommand.Parameters @@ -3510,10 +3512,16 @@ Public Class ClsAF .Add("@CveTipoMantenimiento", SqlDbType.Int).Value = CveTipoMantenimiento .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveTipoServicio", SqlDbType.Int).Direction = ParameterDirection.Output + + End With Try SqlAdapter.Fill(Data) + + CveTipoServicio = SqlAdapter.SelectCommand.Parameters("@CveTipoServicio").Value.ToString.ToEntero + Retorno = True Catch ex As Exception OnError("Ocurrió un error al agregar los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) @@ -3715,13 +3723,15 @@ Public Class ClsAF Return Retorno End Function - Public Function DeleteTiposServiciosMaterial(CveTipoServicioMaterial As Integer) As Boolean + Public Function DeleteTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_TiposServiciosMaterialDelete") With SqlAdapter.SelectCommand.Parameters .Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try @@ -3995,6 +4005,167 @@ Public Class ClsAF Return Retorno End Function + Public Function GetCheckListActividad(CveCheckListActividad As Integer, CveCheckListActividadGrupo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddCheckListActividad(CheckListActividad As String, CveCheckListActividadGrupo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CheckListActividad", SqlDbType.NVarChar).Value = CheckListActividad + .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateCheckListActividad(CveCheckListActividad As Integer, CheckListActividad As String, CveCheckListActividadGrupo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + .Add("@CheckListActividad", SqlDbType.NVarChar).Value = CheckListActividad + .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function DeleteCheckListActividad(CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadDelete") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + 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 AddCheckList(CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + 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 UpdateCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + 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 DeleteCheckList(CveCheckList As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListDelete") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList + 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 diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 7532b38b7..388666a47 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -1785,6 +1785,27 @@ Public Class ClsCompProveedores End Function + Public Function GetContratoProvedores(CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_ContratosProveedoresGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al Obtener los contratos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveContrato(CveContrato As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -1812,7 +1833,7 @@ Public Class ClsCompProveedores - Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer, CveProveedor As Integer) As Boolean Dim Retorno As Boolean = False @@ -1822,6 +1843,7 @@ Public Class ClsCompProveedores .Add("@RepresentanteLegal", SqlDbType.VarChar).Value = RepresentanteLegal .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor End With Try diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index 878dbc95b..b06f629cf 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -458,7 +458,8 @@ Public Class ClsEdocumentacion Return Retorno End Function - Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1) As Boolean + Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional CveTipoContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionElectronicaAuditoriaGet") @@ -471,6 +472,8 @@ Public Class ClsEdocumentacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Modulo", SqlDbType.Int).Value = Modulo .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ddee3fb68..1e93bc42a 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3958,6 +3958,8 @@ Public Class ClsPaginas PaginaDict.Add("/AF/CatActividades.aspx".ToUpper(), 768) PaginaDict.Add("/AF/CatCheckListActividadesGrupos.aspx".ToUpper(), 769) PaginaDict.Add("/AF/CatCheckListTipo.aspx".ToUpper(), 770) + PaginaDict.Add("/AF/CatCheckListActividades.aspx".ToUpper(), 771) + PaginaDict.Add("/AF/CatCheckList.aspx".ToUpper(), 772) PaginaDict.Add("/AF/TipoOrdenTrabajo.aspx".ToUpper(), -1) PaginaDict.Add("/AF/OrdenTrabajo.aspx".ToUpper(), -1) diff --git a/App_Code/DtDatos.xsd b/App_Code/DtDatos.xsd index f4839bec3..f64700eb6 100644 --- a/App_Code/DtDatos.xsd +++ b/App_Code/DtDatos.xsd @@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -137,7 +137,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -235,12 +235,12 @@ - + - + @@ -256,7 +256,7 @@ - + diff --git a/App_Code/DtDatos.xss b/App_Code/DtDatos.xss index 3d21fe6c6..e0a664890 100644 --- a/App_Code/DtDatos.xss +++ b/App_Code/DtDatos.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -16,7 +16,7 @@ - + diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index c1496d8c6..7cd807988 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -604,11 +604,11 @@
    --%> -
    +
    - Representastes Legales + Representantes Legales
    diff --git a/Compras/RepDocumentacionProveedor.aspx b/Compras/RepDocumentacionProveedor.aspx index f4f0139f4..14fed4ef1 100644 --- a/Compras/RepDocumentacionProveedor.aspx +++ b/Compras/RepDocumentacionProveedor.aspx @@ -94,7 +94,32 @@
    -
    +
    + + + +
    +
    + +
    +
    + + Todos + +
    + +
    Perfil:
    +
    + + Todos + +
    + + + +
    +
    +
    @@ -125,7 +150,10 @@ - + + + + diff --git a/Compras/RepDocumentacionProveedor.aspx.vb b/Compras/RepDocumentacionProveedor.aspx.vb index 5a05ce29e..5e8e053ac 100644 --- a/Compras/RepDocumentacionProveedor.aspx.vb +++ b/Compras/RepDocumentacionProveedor.aspx.vb @@ -212,8 +212,20 @@ Partial Class Proveedores_RepDocumentacionProveedor DdlProveedores.setEsWebService(True) DdlProveedores.Attributes.Add("data-metodo", "getproveedores") DdlProveedores.SelectedText = "Todos" - DdlProveedores.SelectedValue = "-1" - + DdlProveedores.SelectedValue = "-1" + + CargarCentrosDeCosto(Nothing, DdlSubProyectoFiltro, Nothing, LblSubProyectoFiltro) + + Dim ObjProveedor As New ClsCompProveedores + + If ObjProveedor.GetTiposContratos(-1, UsuarioActual.CveEmpresa, 1) Then + DdlTipoContratoFiltro.DataSource = ObjProveedor.DtResultados + End If + ObjProveedor.Dispose() + + DdlTipoContratoFiltro.DataBind() + DdlTipoContratoFiltro.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub @@ -247,7 +259,7 @@ Partial Class Proveedores_RepDocumentacionProveedor Dim obEDoc As New ClsEdocumentacion - If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then + If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero, DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlTipoContratoFiltro.SelectedValue.ToEntero) Then GvDocumentos.DataSource = obEDoc.DtResultados Else GvDocumentos.DataSource = Nothing @@ -269,6 +281,10 @@ Partial Class Proveedores_RepDocumentacionProveedor Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + If e.Row.RowType = DataControlRowType.Header Then + e.Row.FCLabel("LblSubProyecto").Text = LblSubProyectoFiltro.Text + End If + If e.Row.RowType = DataControlRowType.DataRow Then Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString diff --git a/Edoc/CatDocumentosContratos.aspx b/Edoc/CatDocumentosContratos.aspx index 96906ac70..357a66069 100644 --- a/Edoc/CatDocumentosContratos.aspx +++ b/Edoc/CatDocumentosContratos.aspx @@ -27,34 +27,36 @@ - - -
    - - - - - - - - - - - - - - - - - - - - - - +
    +
    + + -
    + + + + + + + + + + + + + + + + + + + + +
    +
    + + diff --git a/Edoc/CatTipoContratos.aspx b/Edoc/CatTipoContratos.aspx index ff3e1493a..9fa61d2e9 100644 --- a/Edoc/CatTipoContratos.aspx +++ b/Edoc/CatTipoContratos.aspx @@ -30,7 +30,7 @@
    + ToolTip="Listado de Genero" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" > diff --git a/Edoc/Contratos.aspx b/Edoc/Contratos.aspx index bc9e9b3c4..89cf0b08c 100644 --- a/Edoc/Contratos.aspx +++ b/Edoc/Contratos.aspx @@ -21,17 +21,77 @@ - + + + + +
    +
    + +
    + + "> + +
    +
    +
    + + +
    +
    + + Todos + +
    + +
    Proveedor:
    +
    + + +
    + +
    Tipo Contrato:
    +
    + + Todos + +
    + +
    +
    +
    + <%--
    +
    + +
    Estatus:
    +
    + + + Todos + Vigente + Rescindido + Suspendido + Terminado + + +
    +
    +
    --%> + +
    + + + -
    - + @@ -40,7 +100,10 @@ - + + + + @@ -121,7 +184,7 @@
    - + @@ -137,7 +200,7 @@
    -
    + Sub Proyecto:
    @@ -147,7 +210,7 @@
    -
    +
    @@ -157,11 +220,17 @@

    -
    -
    -
    - -
    +
    + + + + + + + -
    -
    - -
    + + + + +
    + + + +
    + + +
    @@ -172,14 +241,16 @@ -
    - - + +
    +
    @@ -191,9 +262,27 @@ -
    - + +
    + + <%--
    + +
    + +
    +
    + +
    + +
    + + +
    +
    --%>
    @@ -202,7 +291,7 @@ -
    +
      @@ -243,7 +332,7 @@
    - diff --git a/Edoc/Contratos.aspx.vb b/Edoc/Contratos.aspx.vb index 153298752..46bd9fa4b 100644 --- a/Edoc/Contratos.aspx.vb +++ b/Edoc/Contratos.aspx.vb @@ -23,8 +23,10 @@ Partial Class Proveedores_Contratos Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then - CargaDatos() + CargaCombos() + CargaDatos() + End If @@ -35,7 +37,7 @@ Partial Class Proveedores_Contratos Dim ObjProv As New ClsCompProveedores - If ObjProv.GetContrato(-1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then + If ObjProv.GetContrato(-1, DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlProveedorFiltro.SelectedValue.ToEntero, DdlTipoContratoFiltro.SelectedValue.ToEntero, -1, -1, UsuarioActual.CveEmpresa) Then GvDatos.DataSource = ObjProv.DtResultados Else GvDatos.DataSource = Nothing @@ -50,18 +52,24 @@ Partial Class Proveedores_Contratos Private Sub CargaCombos() 'CargaProveedores + + + DdlProveedores.setEsWebService(True) DdlProveedores.Attributes.Add("data-metodo", "getproveedores") DdlProveedores.SelectedText = "Todos" DdlProveedores.SelectedValue = "-1" - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlSubProyecto.Items.Clear() + 'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + 'DdlSubProyecto.DataBind() + 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + CargarCentrosDeCosto(Nothing, DdlSubProyectoFiltro, Nothing, LblSubProyectoFiltro) + DdlTipoContrato.Items.Clear() Dim ObjProveedor As New ClsCompProveedores @@ -69,15 +77,26 @@ Partial Class Proveedores_Contratos If ObjProveedor.GetTiposContratos(-1, UsuarioActual.CveEmpresa, 1) Then DdlTipoContrato.DataSource = ObjProveedor.DtResultados + DdlTipoContratoFiltro.DataSource = ObjProveedor.DtResultados End If + If ObjProveedor.GetContratoProvedores(UsuarioActual.CveEmpresa) Then + DdlProveedorFiltro.DataSource = ObjProveedor.DtResultados + End If + + ObjProveedor.Dispose() DdlTipoContrato.DataBind() + DdlTipoContratoFiltro.DataBind() + DdlProveedorFiltro.DataBind() DdlTipoContrato.Items.Insert(0, New ListItem("Seleccione", "-1")) - CargaRepresentantes() + DdlTipoContratoFiltro.Items.Insert(0, New ListItem("Todos", "-1")) + DdlProveedorFiltro.Items.Insert(0, New ListItem("Todos", "-1")) + + End Sub @@ -96,6 +115,10 @@ Partial Class Proveedores_Contratos DdlTipoContrato.SelectedValueExist("-1") DdlSubProyecto.SelectedValueExist("-1") + + + DDlRePresentanteLegal.Items.Clear() + DDlRePresentanteLegal.Items.Add(New ListItem("Seleccione uno", "-1")) DDlRePresentanteLegal.SelectedValueExist("-1") TxtFechaInicio.Text = "" @@ -104,6 +127,11 @@ Partial Class Proveedores_Contratos BtnAgregarModalContrato.Text = "Agregar" + CheckActiveSection.Visible = False + ChkEstatus.Enabled = True + + + UpModalContrato.Update() RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato")) @@ -119,8 +147,13 @@ Partial Class Proveedores_Contratos DdlProveedores.txtValue.Value = GvRow.DataKey("CveProveedor") DdlProveedores.txtText.Value = GvRow.DataKey("NombreComercial") + DdlTipoContrato.SelectedValueExist(GvRow.DataKey("CveTipoContrato")) DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto")) + + + CargaRepresentantes(GvRow.DataKey("CveProveedor").ToEntero) + DDlRePresentanteLegal.SelectedValueExist(GvRow.DataKey("CveRepresentanteLegal")) TxtFechaInicio.Text = GvRow.DataKey("FechaInicio").ToString.ToDate().ToString("dd/MM/yyyy") @@ -128,9 +161,12 @@ Partial Class Proveedores_Contratos ChkEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus")) - BtnAgregarModalContrato.Text = "Actualizar" + CheckActiveSection.Visible = True + + + UpModalContrato.Update() RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato")) @@ -183,10 +219,6 @@ Partial Class Proveedores_Contratos End If - - - - End Sub Protected Sub LnkGvEliminar_Click(sender As Object, e As EventArgs) @@ -221,25 +253,32 @@ Partial Class Proveedores_Contratos Protected Sub BtnAgregarRepresentante_Click(sender As Object, e As EventArgs) + Dim CveProveedor As Integer = DdlProveedores.txtValue.Value.ToEntero + + If CveProveedor <= 0 Then + Alert("Debe de seleccionar un proveedor", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim ObjProv As New ClsCompProveedores - If ObjProv.AddRePresentanteLegal(TxtRepresentanteLegal.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjProv.AddRePresentanteLegal(TxtRepresentanteLegal.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedor) Then Alert("Se agrego representante correctamente.") TxtRepresentanteLegal.Text = "" End If ObjProv.Dispose() - CargaRepresentantes() + CargaRepresentantes(CveProveedor) End Sub - Private Sub CargaRepresentantes() + Private Sub CargaRepresentantes(CveProveedor As Integer) Dim ObjProv As New ClsCompProveedores - If ObjProv.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa) Then + If ObjProv.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa, CveProveedor) Then GvRepresentante.DataSource = ObjProv.DtResultados DDlRePresentanteLegal.DataSource = ObjProv.DtResultados Else @@ -263,6 +302,7 @@ Partial Class Proveedores_Contratos Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim CveRepresentanteLegal As Integer = GvRow.DataKey("CveRepresentanteLegal").ToEntero + Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero Dim ObjProv As New ClsCompProveedores If ObjProv.RemoveRePresentanteLegal(CveRepresentanteLegal, UsuarioActual.CveEmpresa) Then @@ -271,7 +311,22 @@ Partial Class Proveedores_Contratos ObjProv.Dispose() - CargaRepresentantes() + CargaRepresentantes(CveProveedor) + + End Sub + Protected Sub DdlProveedores_selectedindexchange(sender As Object, e As EventArgs) + + Dim CveProveedor As Integer = DdlProveedores.txtValue.Value.ToEntero + CargaRepresentantes(CveProveedor) + End Sub + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.Header Then + e.Row.FCLabel("LblSubProyecto").Text = LblSubProyectoFiltro.Text + End If End Sub End Class diff --git a/Empresas/Grales/Formatos/RepIVA.rpt b/Empresas/Grales/Formatos/RepIVA.rpt index 9010bd468..d3b3d6240 100644 Binary files a/Empresas/Grales/Formatos/RepIVA.rpt and b/Empresas/Grales/Formatos/RepIVA.rpt differ diff --git a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt index eb0fede9e..d29e92534 100644 Binary files a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt and b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt differ diff --git a/OI/CatDocumentoCategoria.aspx b/OI/CatDocumentoCategoria.aspx index e935eec64..96ca36b67 100644 --- a/OI/CatDocumentoCategoria.aspx +++ b/OI/CatDocumentoCategoria.aspx @@ -14,7 +14,7 @@
  • - +
  • @@ -25,8 +25,8 @@ - - + + @@ -44,7 +44,7 @@
    diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx index fd583dbd4..43ef51987 100644 --- a/OI/DocumentoDetalle.aspx +++ b/OI/DocumentoDetalle.aspx @@ -29,8 +29,8 @@
    - - +
    +

    @@ -47,18 +47,9 @@

    -
    +
    -
    -
    -
    - - - - - -
    -
    +
    @@ -83,7 +74,7 @@
    - +
    @@ -104,7 +95,7 @@ @@ -144,6 +135,7 @@ +
    diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index a2119cdbb..f16ec0e2b 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -11,11 +11,12 @@ using System.Text; public partial class OI_DocumentoDetalle : ClsPaginas { + #region "PROPIEDADES" private int CveUsuarioResponsable { get { - return ViewState["CveUsuarioResponsable"].ToString().ToEntero(); + return ViewState["CveUsuarioResponsable"] == null ? -1 : ViewState["CveUsuarioResponsable"].ToString().ToEntero(); } set @@ -96,6 +97,8 @@ public partial class OI_DocumentoDetalle : ClsPaginas Cargar(); } } + #endregion + #region "CARGAS" private void CargarCveDocumento() { @@ -107,6 +110,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas else { this.CveDocumento = -1; + this.CveUsuarioResponsable = -1; } } @@ -124,6 +128,9 @@ public partial class OI_DocumentoDetalle : ClsPaginas case "Publicado": Alert("Documento publicado"); break; + case "Rechazado": + Alert("Documento rechazado"); + break; } } @@ -157,8 +164,11 @@ public partial class OI_DocumentoDetalle : ClsPaginas foreach (GridViewRow Usuario in UsuariosEnGrid) { int CveUsuario = Usuario.DataKey("CveUsuario").ToEntero(); - string FechaAprobacion = Usuarios.FiltroPrimeroValor("FechaAprobacion", string.Format("CveUsuario = {0}", CveUsuario)); + string Filtro = string.Format("CveUsuario = {0}", CveUsuario); + string FechaAprobacion = Usuarios.FiltroPrimeroValor("FechaAprobacion", Filtro); Usuario.FCCheckBox("ChkAprobar").Checked = FechaAprobacion != "" || (UsuarioActual.CveUsuario == CveUsuarioResponsable && CveUsuario == UsuarioActual.CveUsuario); + string Adjunto = Usuarios.FiltroPrimeroValor("Adjunto", Filtro); + Usuario.FCLinkButton("LkbDescargarPropuesta").Visible = Adjunto != ""; } } } @@ -207,7 +217,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas DdlCategoria.SelectedValue = Documento["CveCategoria"].ToString(); CargarSubCategoria(); DdlSubCategoria.SelectedValue = Documento["CveSubCategoria"].ToString(); - DdlEstatus.SelectedValue = Documento["CveEstatus"].ToString(); + LblEstatus.Text =$"Estatus: {Documento["Estatus"].ToString()}"; TxtVersion.Text = Documento["Version"].ToString(); TxtResponsable.Text = Documento["Responsable"].ToString(); TxtObs.InnerText = Documento["Observacion"].ToString(); @@ -220,6 +230,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas }else { this.CveDocumento = -1; + Alert("No se encontró el Documento", ModExtensiones.TipoMensaje.MsgAdvertencia); } } ObjOI.Dispose(); @@ -246,7 +257,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas { LkbGuardar.Visible = false; LkbActualizar.Visible = true; - LkbPublicar.Visible = true; + LkbPublicar.Visible = VerificarAprobaciónParticipantes() && UsuarioActual.CveUsuario == CveUsuarioResponsable; GvUsuarios.Columns[1].Visible = false; GvUsuarios.Columns[2].Visible = true; GvUsuarios.Columns[3].Visible = true; @@ -273,7 +284,6 @@ public partial class OI_DocumentoDetalle : ClsPaginas { TxtDescripcion.Enabled = false; DdlSubCategoria.Enabled = false; - DdlEstatus.Enabled = false; TxtVersion.Enabled = false; TxtResponsable.Enabled = false; TxtObs.Disabled = true; @@ -284,8 +294,11 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void ConfigurarSegunEstatus() { - bool MostrarSegunAprobado = (DdlEstatus.SelectedValue == "2"); - DivBotonesAcciones.Visible = !MostrarSegunAprobado; + bool MostrarSegunAprobado = (LblEstatus.Text == "Estatus: Aprobado"); + bool MostrarSegunRechazado = (LblEstatus.Text == "Estatus: Rechazado"); + bool MostrarSegunEnProceso = (LblEstatus.Text == "Estatus: En Proceso"); + LkbActualizar.Visible = !(MostrarSegunRechazado) && (UsuarioActual.CveUsuario == this.CveUsuarioResponsable); + DivBotonesAcciones.Visible = !(MostrarSegunAprobado || MostrarSegunRechazado); UpAgregar.Visible = MostrarSegunAprobado; } @@ -310,12 +323,9 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } - private void EstatusMostrar(bool Mostrar) + private void MostrarBotonRechazar() { - DivEstatus.Visible = Mostrar; - brEstatus.Visible = Mostrar; - DivEstatusInicial.Visible = !Mostrar; - brEstatusInicial.Visible = !Mostrar; + LkbRechazar.Visible = (LblEstatus.Text == "Estatus: En Proceso" && this.CveUsuarioResponsable == UsuarioActual.CveUsuario); } private void Cargar() @@ -326,7 +336,6 @@ public partial class OI_DocumentoDetalle : ClsPaginas CargarUsuarios(); if (this.CveDocumento > 0) { - EstatusMostrar(true); if (CargarDocumentoYaExistente()) { CargarUsuariosParticipantes(); @@ -335,6 +344,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas ConfigurarGridUsuariosParticipantes(); ConfigurarCamposDetalleSegunUsuario(); CargarMensajeNuevoEditado(); + MostrarBotonRechazar(); } } ConfigurarSegunEstatus(); @@ -344,39 +354,45 @@ public partial class OI_DocumentoDetalle : ClsPaginas #region "GENERAR DOCUMENTO" protected void LblGuardar_Click(object sender, EventArgs e) { - ClsOIEventos ObjOI = new ClsOIEventos(); - ObjOI.IniciaTransacSQL(); - bool TieneError = false; - - //Esta variable es requerida más adelante - int CveDocumento = 0; - string RutaArchivo = "-1"; - string CorreosNotificacion = ""; - byte[] ArchivoNotifiacion = null; - - CveDocumento = GuardarDocumento(ref ObjOI, ref TieneError);//Se crea el Documento - if (!TieneError) { RutaArchivo = AsignarArchivoAlDocumento(CveDocumento, ref ObjOI, ref TieneError); }//Se guarda el archivo fisico y se asigna al Documento generado - if (!TieneError) { CorreosNotificacion = GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento - if (!TieneError) + if(TxtDocumentoFile.Text != "[]") { - ArchivoNotifiacion = GenerarArchivoByte(CveDocumento, RutaArchivo); - NotificarPorCorreo(CorreosNotificacion, RutaArchivo, ArchivoNotifiacion); - } + ClsOIEventos ObjOI = new ClsOIEventos(); + ObjOI.IniciaTransacSQL(); + bool TieneError = false; - //Gestión de errores y resultados - if (!TieneError) + //Esta variable es requerida más adelante + int CveDocumento = 0; + string RutaArchivo = "-1"; + string CorreosNotificacion = ""; + byte[] ArchivoNotifiacion = null; + + CveDocumento = GuardarDocumento(ref ObjOI, ref TieneError);//Se crea el Documento + if (!TieneError) { RutaArchivo = AsignarArchivoAlDocumento(CveDocumento, ref ObjOI, ref TieneError); }//Se guarda el archivo fisico y se asigna al Documento generado + if (!TieneError) { CorreosNotificacion = GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento + if (!TieneError) + { + ArchivoNotifiacion = GenerarArchivoByte(CveDocumento, RutaArchivo); + NotificarPorCorreo(CorreosNotificacion, RutaArchivo, ArchivoNotifiacion, CveDocumento); + } + + //Gestión de errores y resultados + if (!TieneError) + { + ObjOI.Commit(); + string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "NuevaVersion";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje)); + } + else + { + ObjOI.RollBack(); + Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError); + UpCliente.Update(); + } + ObjOI.Dispose(); + }else { - ObjOI.Commit(); - string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "NuevaVersion";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página - Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje)); + Alert("Es necesario cargar un Documento",ModExtensiones.TipoMensaje.MsgAdvertencia); } - else - { - ObjOI.RollBack(); - Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError); - UpCliente.Update(); - } - ObjOI.Dispose(); } private int GuardarDocumento(ref ClsOIEventos ObjOI, ref bool TieneError) @@ -444,6 +460,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas { string Archivo = ActualizarArchivoEnDirectorio(); ActualizarDocumentoYaExistente(Archivo); + TxtDocumentoFile.Text = ""; Cargar(); UpCliente.Update(); Alert("Documento actualizado"); @@ -468,8 +485,8 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void ActualizarDocumentoYaExistente(string ArchivoFisico) { ClsOIEventos ObjOI = new ClsOIEventos(); - if (!ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, DdlEstatus.SelectedValue.ToEntero(), - ArchivoFisico, UsuarioActual.Nombre, ModExtensiones.MinFecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + if (!ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 1, ArchivoFisico, + UsuarioActual.Nombre, ModExtensiones.MinFecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { Alert("Error al actualizar", ModExtensiones.TipoMensaje.MsgError); } @@ -554,9 +571,21 @@ public partial class OI_DocumentoDetalle : ClsPaginas #endregion #region "NOTIFICACIONES CORREO" - private void NotificarPorCorreo(string Para, string NombreArchivo, byte[] Adjunto) + private string GenerarCuerpoCorreo(int CveDocumento) { - string Descripcion = TxtDescripcion.Text; + string URL = string.Format("{0}/OI/DocumentoDetalle.aspx?CveDocumento={1}", HttpContext.Current.Request.Url.Host,CveDocumento); + StringBuilder body = new StringBuilder(); + body.Append("Ha sido invitado a revisar la generación de un documento
    "); + body.Append($"Documento: {TxtDescripcion.Text},
    "); + body.Append($"Categoria: {DdlCategoria.SelectedItem.Text},
    "); + body.Append($"Subcategoria: {DdlSubCategoria.SelectedItem.Text},
    "); + body.Append($"Detalles del Documento"); + return body.ToString(); + } + + private void NotificarPorCorreo(string Para, string NombreArchivo, byte[] Adjunto, int CveDocumento) + { + string Descripcion = GenerarCuerpoCorreo(CveDocumento); string Asunto = "Se le ha agregado como participante en el desarrollo de un Documento"; string a = string.Format("{0} -- {1} --- {2}", Descripcion, Para, ""); a.GuardaLog(); @@ -658,7 +687,16 @@ public partial class OI_DocumentoDetalle : ClsPaginas { string Archivo = SubirPropuestaEnDirectorio(this.CveUsuarioSeleccionado); - ActualizarUsuario(this.CveAsignacion, Archivo); + bool UsuarioActualizado = ActualizarUsuario(this.CveAsignacion, Archivo); + if (UsuarioActualizado) + { + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarPropuesta")); + Alert("La propuesta se realizó correctamente"); + CargarUsuariosParticipantes(); + CargarUsuariosAutorizo(); + ConfigurarGridUsuariosParticipantes(); + UpDatosUsuarios.Update(); + } } private string SubirPropuestaEnDirectorio(int CveUsuario) @@ -671,6 +709,12 @@ public partial class OI_DocumentoDetalle : ClsPaginas { try { + string AdjuntoYaCargado = GetUsuarioParticipante(CveUsuario)["Adjunto"] == null ? "": GetUsuarioParticipante(CveUsuario)["Adjunto"].ToString(); + string RutaBuscar = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, this.CveDocumento, AdjuntoYaCargado); + if (File.Exists(RutaBuscar)) + { + File.Delete(RutaBuscar); + } string NombreArchivo = fileItem.filenameO; fileNameReturn = string.Format("{0}_{1}", CveUsuario, NombreArchivo); string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}_{3}", UsuarioActual.Empresa.Ruta, this.CveDocumento, CveUsuario, NombreArchivo); @@ -685,14 +729,16 @@ public partial class OI_DocumentoDetalle : ClsPaginas return fileNameReturn; } - private void ActualizarUsuario(int CveAutorizacion, string Archivo) + private bool ActualizarUsuario(int CveAutorizacion, string Archivo) { ClsOIEventos ObjOI = new ClsOIEventos(); if (!ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, this.CveDocumento, TxtComentarios.InnerText, Archivo, ModExtensiones.MinFecha)) { Alert("Error al actualizar el archivo subido propuesto por el usuario"); + return false; } ObjOI.Dispose(); + return true; } #endregion @@ -705,6 +751,10 @@ public partial class OI_DocumentoDetalle : ClsPaginas DataRow Usuario = GetUsuarioParticipante(CveUsuario); AprobacionDeUsuario(Usuario, SelectedCheckBox.Checked); + + LkbPublicar.Visible = VerificarAprobaciónParticipantes() && UsuarioActual.CveUsuario == CveUsuarioResponsable; + UpCliente.Update(); + } private void AprobacionDeUsuario(DataRow Usuario, bool Autorizar) @@ -728,7 +778,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas ObjOI.Dispose(); } - protected void LkbPublicar_Click(object sender, EventArgs e) + private bool VerificarAprobaciónParticipantes() { GridViewRowCollection Usuarios = GvUsuarios.Rows; bool Aprobado = true; @@ -740,6 +790,12 @@ public partial class OI_DocumentoDetalle : ClsPaginas break; } } + return Aprobado; + } + + protected void LkbPublicar_Click(object sender, EventArgs e) + { + bool Aprobado = VerificarAprobaciónParticipantes(); if (Aprobado) { @@ -771,8 +827,21 @@ public partial class OI_DocumentoDetalle : ClsPaginas GvUsuarios.Columns[1].Visible = true; GvUsuarios.Columns[2].Visible = false; GvUsuarios.Columns[3].Visible = false; - EstatusMostrar(false); UpCliente.Update(); } #endregion + + #region "Rechazar" + protected void LkbRechazar_Click(object sender, EventArgs e) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 3, "-1", TxtResponsable.Text, + DateTime.Now, -1, -1, UsuarioActual.CveEmpresa)) + { + Alert("Documento cancelado"); + } + ObjOI.Dispose(); + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", this.CveDocumento, "Rechazado")); + } + #endregion } \ No newline at end of file diff --git a/OI/Documentos.aspx b/OI/Documentos.aspx index 5e37a8679..2e54f8905 100644 --- a/OI/Documentos.aspx +++ b/OI/Documentos.aspx @@ -14,13 +14,13 @@
  • - +
  • - Imprimir PDF + PDF
  • - Imprimir Excel + Excel
  • @@ -32,13 +32,14 @@ EmptyDataText="No se encontraron Documentos Registrados" ToolTip="Listado de Documentos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None" OnRowDataBound="GvDatos_RowDataBound"> - + - - - + + + - + + diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index e6ef26273..16c1ca692 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -69,6 +69,7 @@ + @@ -799,13 +800,13 @@ <%---2020/02/06 - Auditoria--%> - + -
    +
    diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index fe6e0251c..4b1f46663 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -284,8 +284,16 @@ Partial Class Portal_PortalProveedor ' CargaUsuariosPortal() End If + + If UsuarioActual.TienePermisoProceso(305) Then + + TabAuditoria.Visible = True + + End If + 'CARGA TAB CONTRASENIA PARA TODOS LOS USUARIOS If UsuarioActual.CvePlataforma = 7 Then TabContraseña.Visible = True + End If End Sub @@ -647,289 +655,289 @@ Partial Class Portal_PortalProveedor GvCxPHistorial.DataBind() ' UpDatos.Update() - End Sub - + End Sub + #End Region - - + + #Region "Usuarios Portal" - - 'Private Sub CargaUsuariosPortal() - ' Dim ObjUsrs As New ClsSisUsuarios() - ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' Dim dtUsr As DataTable = ObjUsrs.DtResultados - ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) - ' 'If dr IsNot Nothing Then - - ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" - ' ' If True Then TabCxP.Visible = True - ' ' If True Then TabAnticipos.Visible = True - ' ' If True Then TabBancos.Visible = True - ' ' If True Then TabSistema.Visible = True - - ' 'End If - - ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - - ' ViewState("OrdenUsuarios") = "" - ' GvUsuariosPortal.DataSource = dtUsr - ' ViewState("DTUsuariosProveedor") = dtUsr - ' Else - ' GvUsuariosPortal.DataSource = Nothing - ' ViewState("DTUsuariosProveedor") = Nothing - ' End If - ' ObjUsrs.Dispose() - ' GvUsuariosPortal.DataBind() - 'End Sub - - - 'Private Sub CargaGridUsuarios(Orden As String) - ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then - ' If Orden <> String.Empty Then - ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) - ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' DV.Dispose() - ' Else - ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - ' End If - ' GvUsuariosPortal.DataBind() - ' UPPUsuarios.Update() - 'End Sub - - ''ajustar el tamaño de las celdas de la GvUsuarios Portal - 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - - ' 'El usuario Admin no se puede editar ni eliminar - ' If e.Row.DataKey("Nombre") = "Admin" Then - ' e.Row.FCLinkButton("imgE").Visible = False - ' e.Row.FCLinkButton("imgD").Visible = False - ' e.Row.FCLinkButton("imgC").Visible = False - ' End If - - ' If e.Row.RowIndex = 0 Then - ' '' e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(1).Width = Unit.Pixel(150) - ' 'e.Row.Cells(2).Width = Unit.Pixel(55) - ' 'e.Row.Cells(3).Width = Unit.Pixel(55) - ' 'e.Row.Cells(4).Width = Unit.Pixel(55) - ' 'e.Row.Cells(5).Width = Unit.Pixel(55) - ' 'e.Row.Cells(6).Width = Unit.Pixel(55) - ' 'e.Row.Cells(7).Width = Unit.Pixel(55) - - ' 'e.Row.Cells(8).Width = Unit.Pixel(75) - ' 'e.Row.Cells(9).Width = Unit.Pixel(100) - ' 'e.Row.Cells(10).Width = Unit.Pixel(150) - ' End If - ' End If - 'End Sub - - ''Editar usuarios - 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing - ' GvUsuariosPortal.EditIndex = e.NewEditIndex - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim Nombre, Correo As String - ' Dim Estatus As Boolean - ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) - - ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim - ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim - ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim - ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked - - ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero - ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero - - ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados - ' End If - ' ObjUsuario.Dispose() - - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - - 'End Sub - - ''Cancelar Edición - 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit - ' GvUsuariosPortal.EditIndex = -1 - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Restablecer contraseña - 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand - - ' If e.CommandName = "RestablecerContraseña" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") - ' End If - ' End If - ' Usuario.Dispose() - ' End If - - ' If e.CommandName = "ReenviarCorreo" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' Usuario.IniciaTransacSQL() - ' Dim TieneError = False - - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS - ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' TieneError = True - ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) - ' End If - - ' 'MANDA CORREO ACTIVACION - ' If Not TieneError Then - ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) - ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" - ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) - - ' Dim ObjMail As New ClsSisMail() - - ' If dr("Correo").ToString <> "" Then - ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) - ' Dim Texto = "" - ' For Each Correo As String In Correos - ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) - ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then - ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then - ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) - ' TieneError = True - ' Exit For - ' End If - ' Next - - ' Else - ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) - ' TieneError = True - ' End If - ' End If - - ' If Not TieneError Then - ' Usuario.Commit() - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) - ' Else - ' Usuario.RollBack() - ' End If - - ' End If - ' Usuario.Dispose() - ' End If - - 'End Sub - - ''Eliminar Usuarios - 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' End If - ' Usuario.Dispose() - ' Alert("Usuario Eliminado") - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Agregar Usuario - 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim CvePlataforma As Integer = 7 - - ' ObjUsuario.IniciaTransacSQL() - - ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - ' If CveUsuario > 0 Then - ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then - ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - - ' TxtNombrePortal.Text = "" - ' TxtCorreo.Text = "" - ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") - ' ObjUsuario.Commit() - ' Else - ' ObjUsuario.RollBack() - ' End If - ' Else - ' ObjUsuario.RollBack() - ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") - ' End If - - ' ObjUsuario.Dispose() - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - + + 'Private Sub CargaUsuariosPortal() + ' Dim ObjUsrs As New ClsSisUsuarios() + ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' Dim dtUsr As DataTable = ObjUsrs.DtResultados + ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) + ' 'If dr IsNot Nothing Then + + ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" + ' ' If True Then TabCxP.Visible = True + ' ' If True Then TabAnticipos.Visible = True + ' ' If True Then TabBancos.Visible = True + ' ' If True Then TabSistema.Visible = True + + ' 'End If + + ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + + ' ViewState("OrdenUsuarios") = "" + ' GvUsuariosPortal.DataSource = dtUsr + ' ViewState("DTUsuariosProveedor") = dtUsr + ' Else + ' GvUsuariosPortal.DataSource = Nothing + ' ViewState("DTUsuariosProveedor") = Nothing + ' End If + ' ObjUsrs.Dispose() + ' GvUsuariosPortal.DataBind() + 'End Sub + + + 'Private Sub CargaGridUsuarios(Orden As String) + ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then + ' If Orden <> String.Empty Then + ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) + ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' DV.Dispose() + ' Else + ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + ' End If + ' GvUsuariosPortal.DataBind() + ' UPPUsuarios.Update() + 'End Sub + + ''ajustar el tamaño de las celdas de la GvUsuarios Portal + 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' 'El usuario Admin no se puede editar ni eliminar + ' If e.Row.DataKey("Nombre") = "Admin" Then + ' e.Row.FCLinkButton("imgE").Visible = False + ' e.Row.FCLinkButton("imgD").Visible = False + ' e.Row.FCLinkButton("imgC").Visible = False + ' End If + + ' If e.Row.RowIndex = 0 Then + ' '' e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(1).Width = Unit.Pixel(150) + ' 'e.Row.Cells(2).Width = Unit.Pixel(55) + ' 'e.Row.Cells(3).Width = Unit.Pixel(55) + ' 'e.Row.Cells(4).Width = Unit.Pixel(55) + ' 'e.Row.Cells(5).Width = Unit.Pixel(55) + ' 'e.Row.Cells(6).Width = Unit.Pixel(55) + ' 'e.Row.Cells(7).Width = Unit.Pixel(55) + + ' 'e.Row.Cells(8).Width = Unit.Pixel(75) + ' 'e.Row.Cells(9).Width = Unit.Pixel(100) + ' 'e.Row.Cells(10).Width = Unit.Pixel(150) + ' End If + ' End If + 'End Sub + + ''Editar usuarios + 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing + ' GvUsuariosPortal.EditIndex = e.NewEditIndex + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim Nombre, Correo As String + ' Dim Estatus As Boolean + ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) + + ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim + ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim + ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim + ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked + + ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero + ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero + + ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados + ' End If + ' ObjUsuario.Dispose() + + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + + 'End Sub + + ''Cancelar Edición + 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit + ' GvUsuariosPortal.EditIndex = -1 + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Restablecer contraseña + 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand + + ' If e.CommandName = "RestablecerContraseña" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") + ' End If + ' End If + ' Usuario.Dispose() + ' End If + + ' If e.CommandName = "ReenviarCorreo" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' Usuario.IniciaTransacSQL() + ' Dim TieneError = False + + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS + ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' TieneError = True + ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) + ' End If + + ' 'MANDA CORREO ACTIVACION + ' If Not TieneError Then + ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) + ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" + ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) + + ' Dim ObjMail As New ClsSisMail() + + ' If dr("Correo").ToString <> "" Then + ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) + ' Dim Texto = "" + ' For Each Correo As String In Correos + ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) + ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then + ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then + ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) + ' TieneError = True + ' Exit For + ' End If + ' Next + + ' Else + ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) + ' TieneError = True + ' End If + ' End If + + ' If Not TieneError Then + ' Usuario.Commit() + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) + ' Else + ' Usuario.RollBack() + ' End If + + ' End If + ' Usuario.Dispose() + ' End If + + 'End Sub + + ''Eliminar Usuarios + 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' End If + ' Usuario.Dispose() + ' Alert("Usuario Eliminado") + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Agregar Usuario + 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim CvePlataforma As Integer = 7 + + ' ObjUsuario.IniciaTransacSQL() + + ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + ' If CveUsuario > 0 Then + ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then + ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + + ' TxtNombrePortal.Text = "" + ' TxtCorreo.Text = "" + ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") + ' ObjUsuario.Commit() + ' Else + ' ObjUsuario.RollBack() + ' End If + ' Else + ' ObjUsuario.RollBack() + ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") + ' End If + + ' ObjUsuario.Dispose() + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + #End Region - - + + #Region "O R D E N A M I E N T O" - 'Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) - ' Dim Orden As String = "" - ' Dim Campo As String = "" - ' Dim Literal As Literal = Nothing - ' Const OrdenInicial As String = "" - ' Dim Arg(2) As String - - ' Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) - ' Campo = Arg(0) - ' Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) - - ' If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then - ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) - ' Literal.Text = String.Format("") - ' Else - ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) - ' Literal.Text = String.Format("") - ' End If - ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString - ' ViewState("Orden") = Orden - ' CargaGridUsuarios(Orden) - 'End Sub - + 'Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) + ' Dim Orden As String = "" + ' Dim Campo As String = "" + ' Dim Literal As Literal = Nothing + ' Const OrdenInicial As String = "" + ' Dim Arg(2) As String + + ' Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) + ' Campo = Arg(0) + ' Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) + + ' If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then + ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) + ' Literal.Text = String.Format("") + ' Else + ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) + ' Literal.Text = String.Format("") + ' End If + ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString + ' ViewState("Orden") = Orden + ' CargaGridUsuarios(Orden) + 'End Sub + #End Region - - + + #Region " BANCOS" Protected Sub BtnExcelGvBancosCuentas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteGvBancosCuentas("EXCEL")