-
This commit is contained in:
@@ -3112,6 +3112,25 @@ Public Class ClsOIEventos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function DesaprobarDocumentoAutorizacion(CveAutorizacion As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosAutorizacionesDesaprobar")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al desaprobar la autorización del documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -866,11 +866,77 @@
|
||||
</Border>
|
||||
</Style>
|
||||
</Tablix>
|
||||
<Textbox Name="Textbox8">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Parameters!Observaciones.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>MYRIAd Pro</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox8</rd:DefaultName>
|
||||
<Top>3.8986cm</Top>
|
||||
<Left>0.17882cm</Left>
|
||||
<Height>0.97952cm</Height>
|
||||
<Width>19.04079cm</Width>
|
||||
<ZIndex>4</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Textbox Name="Textbox5">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>OBSERVACIONES:</Value>
|
||||
<Style>
|
||||
<FontFamily>MYRIAd Pro</FontFamily>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox5</rd:DefaultName>
|
||||
<Top>3.11339cm</Top>
|
||||
<Left>0.18166cm</Left>
|
||||
<Height>0.60882cm</Height>
|
||||
<Width>3.98167cm</Width>
|
||||
<ZIndex>5</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</ReportItems>
|
||||
<Height>1.75444in</Height>
|
||||
<Height>1.94921in</Height>
|
||||
<Style />
|
||||
</Body>
|
||||
<Width>7.59789in</Width>
|
||||
<Width>7.6851in</Width>
|
||||
<Page>
|
||||
<PageHeader>
|
||||
<Height>4.936cm</Height>
|
||||
@@ -1195,12 +1261,12 @@
|
||||
</Style>
|
||||
</PageHeader>
|
||||
<PageFooter>
|
||||
<Height>2.33028cm</Height>
|
||||
<Height>2.93363cm</Height>
|
||||
<PrintOnFirstPage>true</PrintOnFirstPage>
|
||||
<PrintOnLastPage>true</PrintOnLastPage>
|
||||
<ReportItems>
|
||||
<Line Name="Line2">
|
||||
<Top>0.92688cm</Top>
|
||||
<Top>1.1404cm</Top>
|
||||
<Left>0.05012cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>19.16949cm</Width>
|
||||
@@ -1229,7 +1295,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox12</rd:DefaultName>
|
||||
<Top>1.03271cm</Top>
|
||||
<Top>1.22061cm</Top>
|
||||
<Left>0.12893cm</Left>
|
||||
<Height>0.44125cm</Height>
|
||||
<Width>1.36232cm</Width>
|
||||
@@ -1264,7 +1330,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox18</rd:DefaultName>
|
||||
<Top>1.03271cm</Top>
|
||||
<Top>1.22061cm</Top>
|
||||
<Left>1.49125cm</Left>
|
||||
<Height>0.44125cm</Height>
|
||||
<Width>5.21516cm</Width>
|
||||
@@ -1297,7 +1363,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox12</rd:DefaultName>
|
||||
<Top>1.03271cm</Top>
|
||||
<Top>1.22061cm</Top>
|
||||
<Left>7.7587cm</Left>
|
||||
<Height>0.44125cm</Height>
|
||||
<Width>2.68521cm</Width>
|
||||
@@ -1333,7 +1399,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox18</rd:DefaultName>
|
||||
<Top>1.03271cm</Top>
|
||||
<Top>1.22061cm</Top>
|
||||
<Left>10.44391cm</Left>
|
||||
<Height>0.44125cm</Height>
|
||||
<Width>3.44953cm</Width>
|
||||
@@ -1368,7 +1434,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox3</rd:DefaultName>
|
||||
<Top>1.03271cm</Top>
|
||||
<Top>1.22061cm</Top>
|
||||
<Left>15.59511cm</Left>
|
||||
<Height>0.38981cm</Height>
|
||||
<Width>3.61081cm</Width>
|
||||
@@ -1401,7 +1467,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox29</rd:DefaultName>
|
||||
<Top>1.47396cm</Top>
|
||||
<Top>1.66186cm</Top>
|
||||
<Left>0.12912cm</Left>
|
||||
<Height>0.41981cm</Height>
|
||||
<Width>5.78083cm</Width>
|
||||
@@ -1419,7 +1485,7 @@
|
||||
<Rectangle Name="Rectangle1">
|
||||
<ReportItems>
|
||||
<Line Name="Line6">
|
||||
<Top>0.19459cm</Top>
|
||||
<Top>0.3175cm</Top>
|
||||
<Left>1.19476cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>5.13525cm</Width>
|
||||
@@ -1447,9 +1513,9 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox31</rd:DefaultName>
|
||||
<Top>0.37098cm</Top>
|
||||
<Top>0.4239cm</Top>
|
||||
<Left>0.77992cm</Left>
|
||||
<Height>0.09729cm</Height>
|
||||
<Height>0.56472cm</Height>
|
||||
<Width>5.95755cm</Width>
|
||||
<ZIndex>1</ZIndex>
|
||||
<Style>
|
||||
@@ -1463,7 +1529,7 @@
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Line Name="Line7">
|
||||
<Top>0.19459cm</Top>
|
||||
<Top>0.3175cm</Top>
|
||||
<Left>13.20536cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>5.24108cm</Width>
|
||||
@@ -1492,9 +1558,9 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox31</rd:DefaultName>
|
||||
<Top>0.3357cm</Top>
|
||||
<Top>0.38862cm</Top>
|
||||
<Left>12.80849cm</Left>
|
||||
<Height>0.13257cm</Height>
|
||||
<Height>0.6cm</Height>
|
||||
<Width>5.95755cm</Width>
|
||||
<ZIndex>3</ZIndex>
|
||||
<Style>
|
||||
@@ -1507,89 +1573,11 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Line Name="Line1">
|
||||
<Top>0.75931cm</Top>
|
||||
<Left>0.05417cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>19.1695cm</Width>
|
||||
<ZIndex>4</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Color>#0e2455</Color>
|
||||
<Style>Solid</Style>
|
||||
</Border>
|
||||
</Style>
|
||||
</Line>
|
||||
<Textbox Name="Textbox5">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>OBSERVACIONES:</Value>
|
||||
<Style>
|
||||
<FontFamily>MYRIAd Pro</FontFamily>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox5</rd:DefaultName>
|
||||
<Top>0.46827cm</Top>
|
||||
<Left>0.1196cm</Left>
|
||||
<Height>0.18521cm</Height>
|
||||
<Width>3.98167cm</Width>
|
||||
<ZIndex>5</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Textbox Name="Textbox8">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Parameters!Observaciones.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>MYRIAd Pro</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox8</rd:DefaultName>
|
||||
<Top>0.86514cm</Top>
|
||||
<Left>0.05417cm</Left>
|
||||
<Height>0.04437cm</Height>
|
||||
<Width>19.07699cm</Width>
|
||||
<ZIndex>6</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</ReportItems>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Left>0.05922cm</Left>
|
||||
<Height>0.90952cm</Height>
|
||||
<Top>0.04233cm</Top>
|
||||
<Left>0.05012cm</Left>
|
||||
<Height>0.98862cm</Height>
|
||||
<Width>19.22367cm</Width>
|
||||
<ZIndex>7</ZIndex>
|
||||
<Visibility>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<div>
|
||||
<div runat="server" id="DivFileDropZone">
|
||||
<asp:Label runat="server" ID="LblDocumentoFile" Text="Documento" />
|
||||
<asp:TextBox ID="TxtDocumentoFile" CssClass="ADSdropzone hidden" runat="server" Style="height: 100px"></asp:TextBox>
|
||||
</div>
|
||||
@@ -99,7 +99,7 @@
|
||||
<asp:UpdatePanel ID="UpDatosUsuarios" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvUsuarios" runat="server" AutoGenerateColumns="False" DataKeyNames="CveUsuario,Usuario,Correo" EmptyDataText="No se encontraron Categorías de Documentos Registrados"
|
||||
ToolTip="Listado de Categorías de Documentos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center; width: 100%; overflow-x: hidden"
|
||||
ToolTip="Listado de Categorías de Documentos" CssClass="table table-striped table-advance table-hover ScrollAD" Style="text-align: center; width: 100%; overflow-x: hidden"
|
||||
GridLines="None" OnRowDataBound="GvUsuarios_RowDataBound">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
|
||||
@@ -110,13 +110,19 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aprobar" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="ChkAprobar" />
|
||||
<asp:CheckBox runat="server" ID="ChkAprobar" OnCheckedChanged="ChkAprobar_Checked" AutoPostBack="true" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Propuesta" Visible="false">
|
||||
<asp:TemplateField HeaderText="Propuesta" Visible="false" ItemStyle-Width="15%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="LkbSubirPropuesta" OnClick="LkbSubirPropuesta_Click" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Subir Documento' class='fa fa-upload' title='Subir Documento' ></i>" />
|
||||
<asp:LinkButton runat="server" ID="LkbDescargarPropuesta" OnClick="LkbDescargarPropuesta_Click" AlternateText="Descargar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i title='Subir Documento' class='fa fa-download' title='Descargar Documento' ></i>" />
|
||||
<div class="row">
|
||||
<div class="col-md-4" style="width:50%;text-align:right;padding-right:unset">
|
||||
<asp:LinkButton runat="server" ID="LkbSubirPropuesta" OnClick="LkbSubirPropuesta_Click" AlternateText="Subir" CausesValidation="False" s CssClass="btn btn-circle btn-sm green" Text="<i title='Subir Documento' class='fa fa-upload' title='Subir Documento' ></i>" />
|
||||
</div>
|
||||
<div class="col-md-4" style="width:50%;text-align:left;;padding-right:unset">
|
||||
<asp:LinkButton runat="server" ID="LkbDescargarPropuesta" OnClick="LkbDescargarPropuesta_Click" AlternateText="Descargar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" CssStyle="" Text="<i title='Subir Documento' class='fa fa-download' title='Descargar Documento' ></i>" />
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
@@ -132,6 +138,7 @@
|
||||
<br />
|
||||
<asp:LinkButton runat="server" ID="LkbGuardar" OnClick="LblGuardar_Click" Text="Guardar" class="btn btn-primary" ValidationGroup="GrpDoc" />
|
||||
<asp:LinkButton runat="server" ID="LkbActualizar" OnClick="LbkActualizar_Click" Text="Actualizar" class="btn btn-primary" ValidationGroup="GrpDoc" Visible="false" />
|
||||
<asp:LinkButton runat="server" ID="LkbPublicar" OnClick="LkbPublicar_Click" Text="Publicar" class="btn btn-primary" ValidationGroup="GrpDoc" />
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
@@ -148,7 +155,8 @@
|
||||
<asp:Label runat="server" ID="Label1" Text="Subir Archivo de Propuesta:" style="font-size:15px"/>
|
||||
<br />
|
||||
<asp:TextBox ID="TxtArchivoPropuesta" CssClass="ADSdropzone hidden" runat="server" Style="height: 100px"></asp:TextBox>
|
||||
<asp:Label runat="server" ID="Label2" Text="Comentarios:" />
|
||||
<br />
|
||||
<asp:Label runat="server" ID="Label2" Text="Comentarios:" style="font-size:15px"/>
|
||||
<textarea runat="server" id="TxtComentarios" class="form-control" style="border: 1px solid #e5e5e5" rows="2"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -11,6 +11,19 @@ using System.Text;
|
||||
|
||||
public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
{
|
||||
private int CveUsuarioResponsable
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveUsuarioResponsable"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveUsuarioResponsable"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int CveDocumento
|
||||
{
|
||||
get
|
||||
@@ -111,22 +124,40 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
|
||||
private void CargarUsuarios()
|
||||
{
|
||||
if (this.CveDocumento > 0)
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento))
|
||||
{
|
||||
GvUsuarios.DataSource = ObjOI.DtResultados;
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
}
|
||||
GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
GvUsuarios.DataBind();
|
||||
}
|
||||
|
||||
private void CargarUsuariosParticipantes()
|
||||
{
|
||||
|
||||
DataTable UsuariosAux = null;
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento))
|
||||
{
|
||||
GvUsuarios.DataSource = ObjOI.DtResultados;
|
||||
UsuariosAux = ObjOI.DtResultados;
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
GvUsuarios.DataBind();
|
||||
IndicarQuienesYaAutorizaron(UsuariosAux);
|
||||
|
||||
}
|
||||
|
||||
private void IndicarQuienesYaAutorizaron(DataTable Usuarios)
|
||||
{
|
||||
if (Usuarios != null)
|
||||
{
|
||||
GridViewRowCollection UsuariosEnGrid = GvUsuarios.Rows;
|
||||
foreach (GridViewRow Usuario in UsuariosEnGrid)
|
||||
{
|
||||
int CveUsuario = Usuario.DataKey("CveUsuario").ToEntero();
|
||||
string FechaAprobacion = Usuarios.FiltroPrimeroValor("FechaAprobacion", string.Format("CveUsuario = {0}", CveUsuario));
|
||||
Usuario.FCCheckBox("ChkAprobar").Checked = FechaAprobacion != "" || (UsuarioActual.CveUsuario == CveUsuarioResponsable && CveUsuario == UsuarioActual.CveUsuario);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void GvUsuarios_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
@@ -163,6 +194,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
{
|
||||
DataRow Documento = ObjOI.DtResultados.Rows[0];
|
||||
|
||||
CveUsuarioResponsable = Documento["CveUsuario"].ToString().ToEntero();
|
||||
TxtDescripcion.Text = Documento["Descripcion"].ToString();
|
||||
DdlSubCategoria.SelectedValue = Documento["CveSubCategoria"].ToString();
|
||||
DdlEstatus.SelectedValue = Documento["CveEstatus"].ToString();
|
||||
@@ -173,11 +205,6 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
ArchivoAdjuntoNombre = Documento["ArchivoFisico"].ToString();
|
||||
LkbDescargarArchivo.Text = ArchivoAdjuntoNombre;
|
||||
DivDescargarArchivo.Visible = true;
|
||||
//if (ArchivoAdjuntoNombre.Contains("_"))
|
||||
//{
|
||||
// string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_');
|
||||
// string ArchivoAdjunto = ArchivoAux[1];
|
||||
//}
|
||||
}
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
@@ -208,6 +235,36 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
GvUsuarios.Columns[3].Visible = true;
|
||||
}
|
||||
|
||||
private void ConfigurarGridUsuariosParticipantes()
|
||||
{
|
||||
int CveUsuarioActual = UsuarioActual.CveUsuario;
|
||||
GridViewRowCollection Usuarios = GvUsuarios.Rows;
|
||||
foreach (GridViewRow Usuario in Usuarios)
|
||||
{
|
||||
int CveUsuarioIteracion = Usuario.DataKey("CveUsuario").ToEntero();
|
||||
if (CveUsuarioIteracion != CveUsuarioActual)
|
||||
{
|
||||
Usuario.FCCheckBox("ChkAprobar").Enabled = false;
|
||||
Usuario.FCLinkButton("LkbSubirPropuesta").Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigurarCamposDetalleSegunUsuario()
|
||||
{
|
||||
if (UsuarioActual.CveUsuario != CveUsuarioResponsable)
|
||||
{
|
||||
TxtDescripcion.Enabled = false;
|
||||
DdlSubCategoria.Enabled = false;
|
||||
DdlEstatus.Enabled = false;
|
||||
TxtVersion.Enabled = false;
|
||||
TxtResponsable.Enabled = false;
|
||||
TxtObs.Disabled = true;
|
||||
DivFileDropZone.Visible = false;
|
||||
LkbActualizar.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Cargar()
|
||||
{
|
||||
CargarSubCategoria();
|
||||
@@ -217,8 +274,11 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
if (this.CveDocumento > 0)
|
||||
{
|
||||
CargarDocumentoYaExistente();
|
||||
CargarUsuariosParticipantes();
|
||||
CargarUsuariosAutorizo();
|
||||
ConfiguracionActualizar();
|
||||
ConfigurarGridUsuariosParticipantes();
|
||||
ConfigurarCamposDetalleSegunUsuario();
|
||||
CargarMensajeNuevoEditado();
|
||||
}
|
||||
}
|
||||
@@ -474,7 +534,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento))
|
||||
{
|
||||
UsuarioRetorno = ObjOI.DtResultados.FiltroPrimero(string.Format("CveUsuario = {0}",CveUsuario));
|
||||
UsuarioRetorno = ObjOI.DtResultados.FiltroPrimero(string.Format("CveUsuario = {0}", CveUsuario));
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
return UsuarioRetorno;
|
||||
@@ -495,17 +555,24 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
int CveUsuario = GvRow.DataKey("CveUsuario").ToEntero();
|
||||
DataRow UsuarioSeleccionado = GetUsuarioParticipante(CveUsuario);
|
||||
string Propuesta = UsuarioSeleccionado["Adjunto"] == null?"": UsuarioSeleccionado["Adjunto"].ToString();
|
||||
string Propuesta = UsuarioSeleccionado["Adjunto"] == null ? "" : UsuarioSeleccionado["Adjunto"].ToString();
|
||||
string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}/{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, this.CveDocumento, Propuesta);
|
||||
byte[] archivoBytes = File.ReadAllBytes(Ruta);
|
||||
if (File.Exists(Ruta))
|
||||
{
|
||||
byte[] archivoBytes = File.ReadAllBytes(Ruta);
|
||||
|
||||
HttpContext.Current.Response.Clear();
|
||||
HttpContext.Current.Response.ClearContent();
|
||||
HttpContext.Current.Response.ContentType = "application/octet-stream";
|
||||
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", Propuesta));
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", archivoBytes.Length.ToString());
|
||||
HttpContext.Current.Response.OutputStream.Write(archivoBytes, 0, archivoBytes.Length);
|
||||
HttpContext.Current.Response.End();
|
||||
HttpContext.Current.Response.Clear();
|
||||
HttpContext.Current.Response.ClearContent();
|
||||
HttpContext.Current.Response.ContentType = "application/octet-stream";
|
||||
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", Propuesta));
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", archivoBytes.Length.ToString());
|
||||
HttpContext.Current.Response.OutputStream.Write(archivoBytes, 0, archivoBytes.Length);
|
||||
HttpContext.Current.Response.End();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("El Usuario no ha realizado una propuesta", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnAgregarPropuesta_Click(object sender, EventArgs e)
|
||||
@@ -526,7 +593,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
try
|
||||
{
|
||||
string NombreArchivo = fileItem.filenameO;
|
||||
fileNameReturn = string.Format("{0}_{1}",CveUsuario,NombreArchivo);
|
||||
fileNameReturn = string.Format("{0}_{1}", CveUsuario, NombreArchivo);
|
||||
string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}_{3}", UsuarioActual.Empresa.Ruta, this.CveDocumento, CveUsuario, NombreArchivo);
|
||||
System.IO.File.Move(fileItem.FileUrl, RutaDestino);
|
||||
}
|
||||
@@ -542,7 +609,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
private void ActualizarUsuario(int CveAutorizacion, string Archivo)
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (!ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion,this.CveDocumento,TxtComentarios.InnerText,Archivo,ModExtensiones.MinFecha))
|
||||
if (!ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, this.CveDocumento, TxtComentarios.InnerText, Archivo, ModExtensiones.MinFecha))
|
||||
{
|
||||
Alert("Error al actualizar el archivo subido propuesto por el usuario");
|
||||
}
|
||||
@@ -550,4 +617,67 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "APROBACIÓN DEL DOCUMENTO"
|
||||
protected void ChkAprobar_Checked(object sender, EventArgs e)
|
||||
{
|
||||
CheckBox SelectedCheckBox = (CheckBox)sender;
|
||||
GridViewRow UsuarioAux = (GridViewRow)((Control)sender).Parent.Parent;
|
||||
int CveUsuario = UsuarioAux.DataKey("CveUsuario").ToEntero();
|
||||
DataRow Usuario = GetUsuarioParticipante(CveUsuario);
|
||||
|
||||
AprobacionDeUsuario(Usuario, SelectedCheckBox.Checked);
|
||||
}
|
||||
|
||||
private void AprobacionDeUsuario(DataRow Usuario, bool Autorizar)
|
||||
{
|
||||
int CveAutorizacion = Usuario["CveAutorizacion"].ToString().ToEntero();
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (Autorizar)
|
||||
{
|
||||
if (ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, -1, "-1", "-1", DateTime.Now))
|
||||
{
|
||||
Alert("Haz aprobado la versión actual del Documento");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjOI.DesaprobarDocumentoAutorizacion(CveAutorizacion))
|
||||
{
|
||||
Alert("Haz desaprobado la versión actual del Documento");
|
||||
}
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
protected void LkbPublicar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRowCollection Usuarios = GvUsuarios.Rows;
|
||||
bool Aprobado = true;
|
||||
foreach (GridViewRow Usuario in Usuarios)
|
||||
{
|
||||
if (!Usuario.FCCheckBox("ChkAprobar").Checked)
|
||||
{
|
||||
Aprobado = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Aprobado)
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 2, "-1", TxtResponsable.Text,
|
||||
DateTime.Now, -1, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
Cargar();
|
||||
UpCliente.Update();
|
||||
Alert("Documento publicado");
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Los usuarios participantes aún no autorizan este Documento");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user