154.Solicitudes de traspaso correcto notificación rechazo
This commit is contained in:
@@ -130,11 +130,11 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo
|
||||
TxtFechaDel.Text = FechaInicio.ToShortDateString
|
||||
End If
|
||||
|
||||
'If Request("CveSubProyecto") IsNot Nothing Then
|
||||
' If IsNumeric(Request("CveSubProyecto")) Then
|
||||
' CveSubProyecto = Request("CveSubProyecto").ToString
|
||||
' End If
|
||||
'End If
|
||||
If Request("CveSubProyecto") IsNot Nothing Then
|
||||
If IsNumeric(Request("CveSubProyecto")) Then
|
||||
DdlSubproyecto.SelectedValueExist(Request("CveSubProyecto").ToString)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
ErrorParametros = False
|
||||
|
||||
@@ -259,8 +259,7 @@
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar autorización?" data-btn-ok-label="Si" OnClick="LnkAceptarTraslado_Click"></asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align:center!important">
|
||||
<asp:LinkButton runat="server" Text ="Rechazar" ID="LnkRechazarTraslado" CssClass="btn btn-danger"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar rechazo?" data-btn-ok-label="Si" OnClick="LnkRechazarTraslado_Click" ></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" Text ="Rechazar" ID="LnkRechazarTraslado" CssClass="btn btn-danger" OnClick="LnkRechazarTraslado_Click" ></asp:LinkButton>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -500,6 +499,51 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="ModalRechazarTraslado" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalRechazo" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal3" runat="server">Rechazar solicitud</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-10 form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMotivoRechazo" CssClass="form-control marginFixRow" runat="server" MaxLength="200" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtMotivoRechazo.ClientID.ToString()%>">Motivo de rechazo:</label>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtMotivoRechazo" runat="server" ControlToValidate="TxtMotivoRechazo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo de rechazo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRechazo"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<asp:Button ID="BtnModalRechazo" runat="server" class="btn btn-danger" Text="Rechazar" Style="margin-left: -100px;" ValidationGroup="GrpRechazo"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar rechazo?" data-btn-ok-label="Si" OnClick="BtnModalRechazo_Click" />
|
||||
<button id="btnModalRechazoCerrar" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -36,19 +36,19 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
ViewState("CveDireccionEnvio") = value
|
||||
End Set
|
||||
End Property
|
||||
'Private Property CveUsuarioAutoriza As Integer
|
||||
' Get
|
||||
' If ViewState("CveUsuarioAutoriza") Is Nothing Then
|
||||
' Return -1
|
||||
' Else
|
||||
' Return CType(ViewState("CveUsuarioAutoriza"), Integer)
|
||||
' End If
|
||||
Private Property CveUsuarioSolicita As Integer
|
||||
Get
|
||||
If ViewState("CveUsuarioSolicita") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return CType(ViewState("CveUsuarioSolicita"), Integer)
|
||||
End If
|
||||
|
||||
' End Get
|
||||
' Set(value As Integer)
|
||||
' ViewState("CveUsuarioAutoriza") = value
|
||||
' End Set
|
||||
'End Property
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUsuarioSolicita") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -178,6 +178,8 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
HplContrato.Text = ObjInventarios.DtResultados.Rows(0)("DescripcionContrato").ToString
|
||||
HplContrato.NavigateUrl = $"/Contratos/Contrato.aspx?CveContrato={ObjInventarios.DtResultados.Rows(0)("CveContrato").ToString.ToEntero}"
|
||||
|
||||
CveUsuarioSolicita = ObjInventarios.DtResultados.Rows(0)("CveUsuario").ToString.ToEntero
|
||||
|
||||
'25/04/2018
|
||||
CveDireccionEnvio = ObjInventarios.DtResultados.Rows(0)("CveDireccionEnvio").ToString.ToEntero
|
||||
If CveDireccionEnvio > 0 And ObjClientes.DireccionEnvioGet(CveDireccionEnvio, -1, -1) Then
|
||||
@@ -994,15 +996,85 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkRechazarTraslado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
TxtMotivoRechazo.Text = ""
|
||||
UpModalRechazo.Update()
|
||||
RegistraScript("$('#ModalRechazarTraslado').modal();")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnModalRechazo_Click(sender As Object, e As EventArgs)
|
||||
RechazarTraslado()
|
||||
End Sub
|
||||
|
||||
Private Sub RechazarTraslado()
|
||||
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
If TxtMotivoRechazo.Text.Trim.Length.ToEntero = 0 Then
|
||||
Alert("El motivo de rechazo es necesario", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
Dim ObjInven As New ClsInventarios
|
||||
|
||||
If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 3, UsuarioActual.CveUsuario, Now) Then
|
||||
Alert("Rechazado correctamente.")
|
||||
ErrorProceso = False
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
ObjInven.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
If Not ErrorProceso Then
|
||||
MandaCorreoRechazo(LbFolio.Text.ToEntero, CveTraspasoSolicitud, CveUsuarioSolicita, TxtMotivoRechazo.Text)
|
||||
CargaDatos()
|
||||
RegistraScript("$('#ModalRechazarTraslado').modal('hide');")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MandaCorreoRechazo(Folio As Integer, CveTraspasoSolicitud As Integer, CveUsuarioSolicita As Integer, MotivoRechazo As String)
|
||||
|
||||
Dim SB As New StringBuilder
|
||||
|
||||
Dim CorreoDestino As String = GlobalDTUsuarios(CveUsuarioSolicita)(0)("Correo").ToString.Trim
|
||||
|
||||
|
||||
If CorreoDestino.Length > 0 Then
|
||||
|
||||
|
||||
SB.AppendLine($"<p>Se ha rechazado la solicitud de traspaso con folio {Folio}, el traspaso fue rechazado por el usuario {UsuarioActual.Nombre }, el traspaso fue rechazado por el motivo: {MotivoRechazo} </p>")
|
||||
|
||||
|
||||
|
||||
SB.AppendLine("<br>")
|
||||
SB.AppendLine("<table border = '0'>")
|
||||
SB.AppendLine("<tr style='color:white;background-color:#808080;' ><th>Cantidad</th> <th>U.M.</th> <th>Producto</th> <th>Observaciones</th> </tr>")
|
||||
|
||||
For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
SB.AppendLine($"<tr style='background-color:#F2F2F0;'> <td>{GvRow.DataKey("Cantidad")}</td> <td>{GvRow.DataKey("UnidadMedida")}</td> <td>{GvRow.DataKey("CodigoPS")}</td> <td>{GvRow.DataKey("Observaciones")}</td> </tr>")
|
||||
End If
|
||||
|
||||
Next
|
||||
SB.AppendLine("</table>")
|
||||
SB.AppendLine("<br>")
|
||||
|
||||
SB.AppendLine($"<strong> <a href='{Request.Url.GetLeftPart(UriPartial.Authority)}/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}'>Ir a solicitud de traspaso folio {Folio}</a></strong>")
|
||||
|
||||
|
||||
|
||||
Dim MandaCorre As New ClsSisMail
|
||||
MandaCorre.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, $"Rechazo de Autorización de traspaso #{Folio}", SB.ToString, Displayname:="SIG Notificaciones: Rechazo de Traspaso")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -1057,5 +1129,6 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Next
|
||||
GvDatos.Columns(5).Visible = Mostrar
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user