Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -10,18 +10,25 @@ Imports System.IO
|
|||||||
Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||||
|
|
||||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
If context.Request("metodo").ToString() = "GetTokenAngular" Then
|
If context.Request("metodo") IsNot Nothing AndAlso context.Request("metodo").ToString() = "GetTokenAngular" Then
|
||||||
'context.Response.ContentType = "application/json; charset=utf-8"
|
'context.Response.ContentType = "application/json; charset=utf-8"
|
||||||
|
|
||||||
context.Response.ContentType = "text/json"
|
context.Response.ContentType = "text/json"
|
||||||
Dim origin As String = context.Request.UrlReferrer.ToString()
|
If context.Request IsNot Nothing AndAlso context.Request.UrlReferrer IsNot Nothing Then
|
||||||
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
|
Dim origin As String = context.Request.UrlReferrer.ToString()
|
||||||
|
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
|
||||||
|
End If
|
||||||
'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200")
|
'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200")
|
||||||
'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST")
|
'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST")
|
||||||
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept")
|
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept")
|
||||||
context.Response.AddHeader("Access-Control-Allow-Credentials", "true")
|
context.Response.AddHeader("Access-Control-Allow-Credentials", "true")
|
||||||
context.Response.StatusCode = 200
|
context.Response.StatusCode = 200
|
||||||
Dim key As String = GetTokenAngular(context)
|
Dim key As String = ""
|
||||||
|
Try
|
||||||
|
key = GetTokenAngular(context)
|
||||||
|
Catch ex As Exception
|
||||||
|
GuardaLog(ex.ToString())
|
||||||
|
End Try
|
||||||
Dim json As String = JsonConvert.SerializeObject(key)
|
Dim json As String = JsonConvert.SerializeObject(key)
|
||||||
context.Response.Write(json)
|
context.Response.Write(json)
|
||||||
context.Response.Flush()
|
context.Response.Flush()
|
||||||
|
|||||||
@@ -658,7 +658,7 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<asp:UpdatePanel runat="server">
|
<asp:UpdatePanel runat="server">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:Button ID="BtnGuardarFaturas" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
|
<asp:Button ID="BtnGuardarFaturas" runat="server" ClientIDMode="Static" Text="Aceptar" CssClass="btn btn-primary" />
|
||||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|||||||
@@ -1208,7 +1208,7 @@ Partial Class Compras_eFacturas
|
|||||||
DtNoRecibidas.ReadXml(Ruta)
|
DtNoRecibidas.ReadXml(Ruta)
|
||||||
|
|
||||||
Dim conta As Integer = 1
|
Dim conta As Integer = 1
|
||||||
Str.Append("Se encontraron las siguientes facturas con problema:<br/> <table width='900px'><tr class='Titulos'><td>Serie</td><td>Folio</td><td>Fecha</td><td>Proveedor</td><td>Importe</td><td>Motivo</td><td>Correo</td><td>F. Recepción</td></tr>")
|
Str.Append("Se procesó la información con la siguiente información:<br/> <table width='900px'><tr class='Titulos'><td>Serie</td><td>Folio</td><td>Fecha</td><td>Proveedor</td><td>Importe</td><td>Motivo</td><td>Correo</td><td>F. Recepción</td></tr>")
|
||||||
|
|
||||||
For Each dr As DataRow In DtNoRecibidas.FiltraParametros("", "Fecha DESC").Rows
|
For Each dr As DataRow In DtNoRecibidas.FiltraParametros("", "Fecha DESC").Rows
|
||||||
|
|
||||||
@@ -2809,7 +2809,12 @@ Partial Class Compras_eFacturas
|
|||||||
dRow2("CveFactura") = drow("CveFactura").ToString.ToEntero
|
dRow2("CveFactura") = drow("CveFactura").ToString.ToEntero
|
||||||
dRow2("CveMetodoPago") = drow("CveMetodoPago").ToString.ToEntero
|
dRow2("CveMetodoPago") = drow("CveMetodoPago").ToString.ToEntero
|
||||||
dRow2("SerieFolioCompra") = drow("SerieFolioCompra").ToString
|
dRow2("SerieFolioCompra") = drow("SerieFolioCompra").ToString
|
||||||
dRow2("CvePrePolizaDetalle") = drow("CvePrePolizaDetalle").ToString
|
Try
|
||||||
|
dRow2("CvePrePolizaDetalle") = drow("CvePrePolizaDetalle").ToString
|
||||||
|
Catch ex As Exception
|
||||||
|
dRow2("CvePrePolizaDetalle") = 0
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
If drow("CveIE").ToString.ToEntero > 0 Then
|
If drow("CveIE").ToString.ToEntero > 0 Then
|
||||||
|
|
||||||
|
|||||||
@@ -1275,7 +1275,7 @@ Partial Class Contratos_Default
|
|||||||
PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero, TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero,
|
PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero, TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero,
|
||||||
CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero, CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero,
|
CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero, CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero,
|
||||||
Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(),
|
Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(),
|
||||||
FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=DdlDiaFact.SelectedValue.ToEntero())
|
FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=If(DdlDiaFact.SelectedValue.ToEntero() < 0, 0, DdlDiaFact.SelectedValue.ToEntero()))
|
||||||
|
|
||||||
|
|
||||||
TieneError = Not GuardaFianzas(ObjContratos)
|
TieneError = Not GuardaFianzas(ObjContratos)
|
||||||
@@ -1364,7 +1364,7 @@ Partial Class Contratos_Default
|
|||||||
CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero,
|
CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero,
|
||||||
TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero,
|
TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero,
|
||||||
CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked,
|
CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked,
|
||||||
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=DdlDiaFact.SelectedValue.ToEntero(), CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero()) Then
|
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=If(DdlDiaFact.SelectedValue.ToEntero() < 0, 0, DdlDiaFact.SelectedValue.ToEntero()), CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero()) Then
|
||||||
|
|
||||||
|
|
||||||
TieneError = Not GuardaFianzas(ObjContratos)
|
TieneError = Not GuardaFianzas(ObjContratos)
|
||||||
|
|||||||
@@ -257,7 +257,7 @@
|
|||||||
<label class="col-md-1 truncate">Contrato:</label>
|
<label class="col-md-1 truncate">Contrato:</label>
|
||||||
<div class="col-md-6 col-lg-4">
|
<div class="col-md-6 col-lg-4">
|
||||||
<div class="ddls">
|
<div class="ddls">
|
||||||
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" AutoPostBack="true" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
|
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -303,59 +303,7 @@
|
|||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<%-- <asp:TemplateField HeaderText="Cantidad">
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField HeaderText="Importe">
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField HeaderText=" ">
|
|
||||||
<ItemTemplate>
|
|
||||||
|
|
||||||
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" />
|
|
||||||
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm btn-success" ID="LnkModalDropzone" Visible="false"> <i class='fa fa-plus'></i></asp:LinkButton>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div runat="server" id="ModalAnexoEvidencia" class="modal ADS fade" role="dialog">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
|
|
||||||
<!-- Modal content-->
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header ">
|
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
||||||
<h4 class="modal-title">Cargar Evidencia</h4>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-body">
|
|
||||||
|
|
||||||
|
|
||||||
<div style="text-align:left">
|
|
||||||
<asp:TextBox ID="TXTAnexo" CssClass="ADSdropzone hidden" data-maxFile="10" Text="" runat="server"></asp:TextBox>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<asp:UpdatePanel runat="server">
|
|
||||||
<ContentTemplate>
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
|
||||||
</ContentTemplate>
|
|
||||||
</asp:UpdatePanel>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>--%>
|
|
||||||
|
|
||||||
|
|
||||||
</Columns>
|
</Columns>
|
||||||
@@ -370,12 +318,16 @@
|
|||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
|
||||||
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
|
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
|
||||||
|
<asp:Button id="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
<Triggers>
|
||||||
|
<asp:PostBackTrigger ControlID="BtnDescargarGenerado" />
|
||||||
|
</Triggers>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ Imports Extensiones
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports Newtonsoft.Json
|
Imports Newtonsoft.Json
|
||||||
|
Imports ClosedXML.Excel
|
||||||
|
|
||||||
Partial Class Contratos_ContratoAvance
|
Partial Class Contratos_ContratoAvance
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
#Region "Propiedades"
|
#Region "Propiedades"
|
||||||
Private Property DtDatos As DataTable
|
Private Property DtDatos As DataTable
|
||||||
Get
|
Get
|
||||||
@@ -63,6 +64,34 @@ Partial Class Contratos_ContratoAvance
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Property CveEstimacionNueva As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveEstimacionNueva") Is Nothing Then
|
||||||
|
Return -1
|
||||||
|
Else
|
||||||
|
Return ViewState("CveEstimacionNueva").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveEstimacionNueva") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Property NuemeroEstimacionNuevo As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("NuemeroEstimacionNuevo") Is Nothing Then
|
||||||
|
Return -1
|
||||||
|
Else
|
||||||
|
Return ViewState("NuemeroEstimacionNuevo").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("NuemeroEstimacionNuevo") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
@@ -74,15 +103,15 @@ Partial Class Contratos_ContratoAvance
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "Filtros"
|
#Region "Filtros"
|
||||||
|
|
||||||
Private Sub CargaContrato()
|
Private Sub CargaContrato()
|
||||||
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (4,30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||||
DdlContratos.DataBind()
|
DdlContratos.DataBind()
|
||||||
|
|
||||||
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (4,30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||||
DDlContratosEstimaciones.DataBind()
|
DDlContratosEstimaciones.DataBind()
|
||||||
|
|
||||||
|
|
||||||
@@ -96,21 +125,21 @@ Partial Class Contratos_ContratoAvance
|
|||||||
DdlAvances.Items.Clear()
|
DdlAvances.Items.Clear()
|
||||||
Dim ObjContratos As New ClsContratos()
|
Dim ObjContratos As New ClsContratos()
|
||||||
If ObjContratos.GetContratosAvanceFecha(DdlContratos.SelectedValue.ToEntero, 2) Then
|
If ObjContratos.GetContratosAvanceFecha(DdlContratos.SelectedValue.ToEntero, 2) Then
|
||||||
DdlAvances.DataSource = ObjContratos.DtResultados
|
DdlAvances.DataSource = ObjContratos.DtResultados
|
||||||
End If
|
End If
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
DdlAvances.DataBind()
|
DdlAvances.DataBind()
|
||||||
DdlAvances.Items.Insert(0, New ListItem(" ---- ", "-1"))
|
DdlAvances.Items.Insert(0, New ListItem(" ---- ", "-1"))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||||
CveContrato = DdlContratos.SelectedValue.ToEntero
|
CveContrato = DdlContratos.SelectedValue.ToEntero
|
||||||
CargaDatosAvance()
|
CargaDatosAvance()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaDatosAvance()
|
Private Sub CargaDatosAvance()
|
||||||
GvAnexos.Visible = False
|
GvAnexos.Visible = False
|
||||||
Dim ObjContratos As New ClsContratos()
|
Dim ObjContratos As New ClsContratos()
|
||||||
If DdlAvances.SelectedValue = "-1" Then
|
If DdlAvances.SelectedValue = "-1" Then
|
||||||
If ObjContratos.GetContratosAvanceTodos(CveContrato, 2) Then
|
If ObjContratos.GetContratosAvanceTodos(CveContrato, 2) Then
|
||||||
@@ -121,7 +150,7 @@ Partial Class Contratos_ContratoAvance
|
|||||||
btnanexogral.Visible = True
|
btnanexogral.Visible = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If ObjContratos.GetContratosAvanceHistoricos(CveContrato, 2, DdlAvances.SelectedValue) Then
|
If ObjContratos.GetContratosAvanceHistoricos(CveContrato, 2, DdlAvances.SelectedValue) Then
|
||||||
fecha = DdlAvances.SelectedValue
|
fecha = DdlAvances.SelectedValue
|
||||||
DtDatos = ObjContratos.DtResultados
|
DtDatos = ObjContratos.DtResultados
|
||||||
@@ -131,8 +160,8 @@ Partial Class Contratos_ContratoAvance
|
|||||||
End If
|
End If
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
CargaGrid()
|
CargaGrid()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "GV"
|
#Region "GV"
|
||||||
Private Sub CargaGrid()
|
Private Sub CargaGrid()
|
||||||
If DtDatos IsNot Nothing Then
|
If DtDatos IsNot Nothing Then
|
||||||
@@ -380,16 +409,19 @@ Partial Class Contratos_ContratoAvance
|
|||||||
|
|
||||||
Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click
|
Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click
|
||||||
|
|
||||||
|
CveEstimacionNueva = -1
|
||||||
|
NuemeroEstimacionNuevo = -1
|
||||||
|
|
||||||
Dim ObjContratos As New ClsContratos()
|
Dim ObjContratos As New ClsContratos()
|
||||||
Dim ErrorProceso As Boolean = False
|
Dim ErrorProceso As Boolean = False
|
||||||
Dim NuemeroEstimacion As Integer = -1
|
|
||||||
ObjContratos.IniciaTransacSQL()
|
ObjContratos.IniciaTransacSQL()
|
||||||
|
|
||||||
|
|
||||||
If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
|
CveEstimacionNueva = ObjContratos.CveEstimacionNueva
|
||||||
NuemeroEstimacion = ObjContratos.NumeroEstimacionNueva
|
NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvEstimaciones.Rows
|
For Each GvRow As GridViewRow In GvEstimaciones.Rows
|
||||||
|
|
||||||
@@ -412,15 +444,303 @@ Partial Class Contratos_ContratoAvance
|
|||||||
|
|
||||||
If Not ErrorProceso Then
|
If Not ErrorProceso Then
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
Alert($"Estimación {NuemeroEstimacion} agregada correctamente.")
|
Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.")
|
||||||
|
|
||||||
|
BtnGuardarEstimacion.Visible = False
|
||||||
|
BtnDescargarGenerado.Visible = True
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ObjContratos.RollBack()
|
ObjContratos.RollBack()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
|
|
||||||
|
UpEstimaciones.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click
|
||||||
|
|
||||||
|
|
||||||
|
GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String)
|
||||||
|
|
||||||
|
Dim PlantillaAnexo As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Anexo.xlsx"
|
||||||
|
|
||||||
|
If Not System.IO.File.Exists(PlantillaAnexo) Then
|
||||||
|
Alert("No se encuentra la platilla de anexos.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim DtControl As New DataTable
|
||||||
|
Dim ObjContratos As New ClsContratos
|
||||||
|
|
||||||
|
|
||||||
|
If ObjContratos.GetContratosObraAvancesControlAcumulativo(CveContrato, CveEstimacion, UsuarioActual.CveEmpresa) Then
|
||||||
|
DtControl = ObjContratos.DtResultados
|
||||||
|
End If
|
||||||
|
ObjContratos.Dispose()
|
||||||
|
|
||||||
|
If DtControl.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
Dim WBAnexo = New ClosedXML.Excel.XLWorkbook(PlantillaAnexo)
|
||||||
|
|
||||||
|
Dim WBAnexoSalvar = New ClosedXML.Excel.XLWorkbook
|
||||||
|
|
||||||
|
Dim WSControl = WBAnexo.Worksheet(1)
|
||||||
|
Dim WSDetalle = WBAnexo.Worksheet(2)
|
||||||
|
|
||||||
|
Dim CuerrentRow As Integer = 28
|
||||||
|
|
||||||
|
WSControl.Cell(17, 2).Value = NumeroEstimacion 'Estimacion
|
||||||
|
WSControl.Cell(20, 9).Value = FechaEstimacion.ToString("dd/MM/yyyy") 'Fecha estimacion
|
||||||
|
WSControl.Cell(19, 8).Value = "$ " & DtControl.SUM("Importe").ToString("###,###,###.00") 'Total
|
||||||
|
WSControl.Cell(19, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
|
||||||
|
|
||||||
|
WSControl.Cell(20, 6).Value = NumeroContrato
|
||||||
|
|
||||||
|
WSControl.Cell(18, 2).Value = "" 'Lugar
|
||||||
|
WSControl.Cell(17, 6).Value = "" 'Periodo Fecha Inicial
|
||||||
|
WSControl.Cell(17, 7).Value = "" 'Periuodo Fecha Final
|
||||||
|
WSControl.Cell(20, 2).Value = "" 'Obra
|
||||||
|
WSControl.Cell(22, 7).Value = "" 'Presupuesto segun contrato
|
||||||
|
WSControl.Cell(19, 5).Value = "" 'Contrtatista
|
||||||
|
|
||||||
|
Dim RowCountControl As Integer = 1
|
||||||
|
|
||||||
|
For Each Drow As DataRow In DtControl.Rows
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow, 1).Value = Drow("Codigo").ToString
|
||||||
|
WSControl.Cell(CuerrentRow, 2).Value = Drow("PS").ToString
|
||||||
|
WSControl.Cell(CuerrentRow, 3).Value = Drow("Abreviatura").ToString
|
||||||
|
WSControl.Cell(CuerrentRow, 4).Value = Drow("Cantidad").ToString.ToDecimal
|
||||||
|
WSControl.Cell(CuerrentRow, 5).Value = Drow("AcumuladoTotal").ToString.ToDecimal
|
||||||
|
WSControl.Cell(CuerrentRow, 6).Value = Drow("AcumuladoAnterior").ToString.ToDecimal
|
||||||
|
WSControl.Cell(CuerrentRow, 7).Value = Drow("CantidadActual").ToString.ToDecimal
|
||||||
|
WSControl.Cell(CuerrentRow, 8).Value = Drow("PU").ToString.ToDecimal
|
||||||
|
WSControl.Cell(CuerrentRow, 9).Value = Drow("Total").ToString.ToDecimal
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
|
||||||
|
'ultimo Row
|
||||||
|
If DtControl.Rows.Count = RowCountControl Then
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Value = "Total:"
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Font.Bold = True
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Value = DtControl.SUM("Total")
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.Font.Bold = True
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
|
||||||
|
|
||||||
|
|
||||||
|
Dim range = WSControl.Range($"A{CuerrentRow + 3}:D{CuerrentRow + 3}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
|
||||||
|
range = WSControl.Range($"E{CuerrentRow + 3}:I{CuerrentRow + 3}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
range = WSControl.Range($"A{CuerrentRow + 4}:D{CuerrentRow + 4}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "ING. WALTER ROBERTO VILLEGAS LARES"
|
||||||
|
|
||||||
|
range = WSControl.Range($"E{CuerrentRow + 4}:I{CuerrentRow + 4}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "C. SALVADOR SUAREZ"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
range = WSControl.Range($"A{CuerrentRow + 5}:D{CuerrentRow + 5}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "SERVICIOS ELECTRICOS Y CONTROL DE HERMOSILLO S.A. DE C.V."
|
||||||
|
range.Style.Font.Bold = True
|
||||||
|
|
||||||
|
range = WSControl.Range($"E{CuerrentRow + 5}:I{CuerrentRow + 5}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "GASERVICIO MATAMOROS SA DE CV"
|
||||||
|
range.Style.Font.Bold = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
CuerrentRow = CuerrentRow + 1
|
||||||
|
RowCountControl = RowCountControl + 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
WBAnexo.Worksheet(1).CopyTo(WBAnexoSalvar, "CONTROL")
|
||||||
|
|
||||||
|
|
||||||
|
For Each Drow As DataRow In DtControl.Rows
|
||||||
|
|
||||||
|
|
||||||
|
If Drow("CantidadActual").ToString.ToDecimal > 0 Then
|
||||||
|
|
||||||
|
WSDetalle.Cell(3, 6).Value = NumeroContrato
|
||||||
|
|
||||||
|
WSDetalle.Cell(4, 9).Value = "" 'Fecha de
|
||||||
|
WSDetalle.Cell(4, 10).Value = "" 'Fecha a
|
||||||
|
WSDetalle.Cell(4, 11).Value = NumeroEstimacion
|
||||||
|
|
||||||
|
'WSDetalle.Picture("Logo").Name = $"Logo{Drow("CveContratoDetalle").ToString}"
|
||||||
|
'WSDetalle.Picture("Firma").Name = $"Firma{Drow("CveContratoDetalle").ToString}"
|
||||||
|
|
||||||
|
|
||||||
|
WSDetalle.Cell(14, 2).Value = Drow("Codigo").ToString
|
||||||
|
WSDetalle.Cell(14, 3).Value = Drow("PS").ToString
|
||||||
|
WSDetalle.Cell(14, 4).Value = Drow("Abreviatura").ToString
|
||||||
|
|
||||||
|
|
||||||
|
WSDetalle.Cell(12, 3).Value = "" 'Concepto
|
||||||
|
|
||||||
|
WSDetalle.Cell(14, 10).Value = Drow("CantidadActual").ToString.ToDecimal
|
||||||
|
WSDetalle.Cell(14, 11).Value = Drow("CantidadActual").ToString.ToDecimal
|
||||||
|
'WSDetalle.Cell(61, 6).Value = "" 'Empresario
|
||||||
|
WSDetalle.Cell(61, 9).Value = Drow("Nombre").ToString 'Cliente
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim objContrato As New ClsContratos
|
||||||
|
Dim DTArchivos As New DataTable
|
||||||
|
|
||||||
|
If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, Drow("Fecha").ToString, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
|
||||||
|
DTArchivos = objContrato.DtResultados
|
||||||
|
End If
|
||||||
|
objContrato.Dispose()
|
||||||
|
|
||||||
|
Dim Imagenes As New List(Of ClosedXML.Excel.Drawings.IXLPicture)
|
||||||
|
|
||||||
|
Dim CurrectRowImg As Integer = 19 'Row 19 primera imggen
|
||||||
|
Dim RowH As Double = WSDetalle.Row(19).Height
|
||||||
|
|
||||||
|
For Each drowArchivos As DataRow In DTArchivos.Rows
|
||||||
|
|
||||||
|
Dim Archivo As String = ""
|
||||||
|
Archivo = drowArchivos("Archivo").ToString
|
||||||
|
Dim RutaArchivo As String = $"{UsuarioActual.Empresa.Ruta}\Contrato\{CveContrato}\Anexos\{Archivo}"
|
||||||
|
|
||||||
|
If File.Exists(RutaArchivo) Then
|
||||||
|
|
||||||
|
Dim Imagen = WSDetalle.AddPicture(RutaArchivo).MoveTo(WSDetalle.Cell(CurrectRowImg, 3))
|
||||||
|
Imagen.Scale(WSDetalle.Column(3).Width / (Imagen.OriginalWidth * 0.145D))
|
||||||
|
|
||||||
|
Dim ImgWidth As Double = Imagen.Height
|
||||||
|
|
||||||
|
Dim nRowmas As Integer = (ImgWidth / RowH).ToEntero
|
||||||
|
|
||||||
|
CurrectRowImg = CurrectRowImg + nRowmas
|
||||||
|
|
||||||
|
Imagenes.Add(Imagen)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
WBAnexo.Worksheet(2).CopyTo(WBAnexoSalvar, If(Drow("Codigo").ToString.Trim.Length > 0, Drow("Codigo").ToString, Drow("CvePS").ToString))
|
||||||
|
|
||||||
|
For Each img As ClosedXML.Excel.Drawings.IXLPicture In Imagenes
|
||||||
|
img.Delete()
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim msB = New MemoryStream()
|
||||||
|
WBAnexoSalvar.SaveAs(msB)
|
||||||
|
|
||||||
|
Dim BB As Byte() = msB.ToArray
|
||||||
|
msB.Dispose()
|
||||||
|
|
||||||
|
Response.Clear()
|
||||||
|
Response.Buffer = True
|
||||||
|
Response.AddHeader("content-disposition", "attachment; filename=Anexo_Estimacion" & NumeroEstimacion & ".xlsx")
|
||||||
|
Response.ContentType = "application/vnd.ms-excel"
|
||||||
|
Response.BinaryWrite(BB)
|
||||||
|
Response.End()
|
||||||
|
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert("No se encontraron datos des control", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports ClosedXML.Excel
|
||||||
|
|
||||||
Partial Class RepContratosObraAvancesDetalle
|
Partial Class RepContratosObraAvancesDetalle
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -152,7 +153,8 @@ Partial Class RepContratosObraAvancesDetalle
|
|||||||
|
|
||||||
WSControl.Cell(17, 2).Value = NumeroEstimacion 'Estimacion
|
WSControl.Cell(17, 2).Value = NumeroEstimacion 'Estimacion
|
||||||
WSControl.Cell(20, 9).Value = FechaEstimacion.ToString("dd/MM/yyyy") 'Fecha estimacion
|
WSControl.Cell(20, 9).Value = FechaEstimacion.ToString("dd/MM/yyyy") 'Fecha estimacion
|
||||||
WSControl.Cell(19, 8).Value = "$ " & DtControl.SUM("Total").ToString("###,###,###.00") 'Total
|
WSControl.Cell(19, 8).Value = "$ " & DtControl.SUM("Importe").ToString("###,###,###.00") 'Total
|
||||||
|
WSControl.Cell(19, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
|
||||||
|
|
||||||
WSControl.Cell(20, 6).Value = NumeroContrato
|
WSControl.Cell(20, 6).Value = NumeroContrato
|
||||||
|
|
||||||
@@ -163,7 +165,7 @@ Partial Class RepContratosObraAvancesDetalle
|
|||||||
WSControl.Cell(22, 7).Value = "" 'Presupuesto segun contrato
|
WSControl.Cell(22, 7).Value = "" 'Presupuesto segun contrato
|
||||||
WSControl.Cell(19, 5).Value = "" 'Contrtatista
|
WSControl.Cell(19, 5).Value = "" 'Contrtatista
|
||||||
|
|
||||||
|
Dim RowCountControl As Integer = 1
|
||||||
|
|
||||||
For Each Drow As DataRow In DtControl.Rows
|
For Each Drow As DataRow In DtControl.Rows
|
||||||
|
|
||||||
@@ -177,7 +179,121 @@ Partial Class RepContratosObraAvancesDetalle
|
|||||||
WSControl.Cell(CuerrentRow, 8).Value = Drow("PU").ToString.ToDecimal
|
WSControl.Cell(CuerrentRow, 8).Value = Drow("PU").ToString.ToDecimal
|
||||||
WSControl.Cell(CuerrentRow, 9).Value = Drow("Total").ToString.ToDecimal
|
WSControl.Cell(CuerrentRow, 9).Value = Drow("Total").ToString.ToDecimal
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
|
||||||
|
'ultimo Row
|
||||||
|
If DtControl.Rows.Count = RowCountControl Then
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Value = "Total:"
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 8).Style.Font.Bold = True
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Value = DtControl.SUM("Total")
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.Font.Bold = True
|
||||||
|
|
||||||
|
WSControl.Cell(CuerrentRow + 1, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
|
||||||
|
|
||||||
|
|
||||||
|
Dim range = WSControl.Range($"A{CuerrentRow + 3}:D{CuerrentRow + 3}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
|
||||||
|
range = WSControl.Range($"E{CuerrentRow + 3}:I{CuerrentRow + 3}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
range = WSControl.Range($"A{CuerrentRow + 4}:D{CuerrentRow + 4}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "ING. WALTER ROBERTO VILLEGAS LARES"
|
||||||
|
|
||||||
|
range = WSControl.Range($"E{CuerrentRow + 4}:I{CuerrentRow + 4}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "C. SALVADOR SUAREZ"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
range = WSControl.Range($"A{CuerrentRow + 5}:D{CuerrentRow + 5}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "SERVICIOS ELECTRICOS Y CONTROL DE HERMOSILLO S.A. DE C.V."
|
||||||
|
range.Style.Font.Bold = True
|
||||||
|
|
||||||
|
range = WSControl.Range($"E{CuerrentRow + 5}:I{CuerrentRow + 5}")
|
||||||
|
range.Merge()
|
||||||
|
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
|
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
|
||||||
|
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
|
||||||
|
range.Value = "GASERVICIO MATAMOROS SA DE CV"
|
||||||
|
range.Style.Font.Bold = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
CuerrentRow = CuerrentRow + 1
|
CuerrentRow = CuerrentRow + 1
|
||||||
|
RowCountControl = RowCountControl + 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
WBAnexo.Worksheet(1).CopyTo(WBAnexoSalvar, "CONTROL")
|
WBAnexo.Worksheet(1).CopyTo(WBAnexoSalvar, "CONTROL")
|
||||||
@@ -280,13 +396,13 @@ Partial Class RepContratosObraAvancesDetalle
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function GetStream(excelWorkbook As ClosedXML.Excel.XLWorkbook) As Stream
|
'Public Function GetStream(excelWorkbook As ClosedXML.Excel.XLWorkbook) As Stream
|
||||||
|
|
||||||
Dim fs = New MemoryStream()
|
' Dim fs = New MemoryStream()
|
||||||
excelWorkbook.SaveAs(fs)
|
' excelWorkbook.SaveAs(fs)
|
||||||
fs.Position = 0
|
' fs.Position = 0
|
||||||
Return fs
|
' Return fs
|
||||||
|
|
||||||
End Function
|
'End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -134,6 +134,12 @@
|
|||||||
<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#Kardex"> </a>
|
<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#Kardex"> </a>
|
||||||
</li>
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
<Triggers>
|
||||||
|
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||||
|
<asp:PostBackTrigger ControlID="LnkExportar" />
|
||||||
|
|
||||||
|
</Triggers>
|
||||||
|
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
|||||||
13
LogIn.aspx
13
LogIn.aspx
@@ -131,18 +131,7 @@
|
|||||||
<script type="text/javascript" src="/Metronic/assets/global/scripts/JSNoCustom"></script>
|
<script type="text/javascript" src="/Metronic/assets/global/scripts/JSNoCustom"></script>
|
||||||
<%--<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>--%>
|
<%--<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>--%>
|
||||||
<script>
|
<script>
|
||||||
function opennewlocation(returnurl,token) {
|
function opennewlocation(returnurl,token) {
|
||||||
//let fram = $('#framexd');
|
|
||||||
//let Pagina =
|
|
||||||
// "http://localhost:2536/auth/login?authtoken=" + token;
|
|
||||||
// Metronic.blockUI();
|
|
||||||
//fram.unbind("load");
|
|
||||||
//fram.load(function () {
|
|
||||||
// setTimeout(function () { document.location = returnurl; },1500)
|
|
||||||
// Metronic.unblockUI();
|
|
||||||
//});
|
|
||||||
//fram.prop('src', Pagina);
|
|
||||||
|
|
||||||
document.location = returnurl;
|
document.location = returnurl;
|
||||||
}
|
}
|
||||||
// aqui debe de llammarse siganalr, para desconectar
|
// aqui debe de llammarse siganalr, para desconectar
|
||||||
|
|||||||
@@ -250,26 +250,7 @@ Partial Class LogIn
|
|||||||
|
|
||||||
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
|
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
|
||||||
Response.Cookies.Add(cookie)
|
Response.Cookies.Add(cookie)
|
||||||
'RegistraScript(String.Format("iniciaSesion('{0}')", ReturnUrl.Replace("'", "\'")))
|
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, ""))
|
||||||
|
|
||||||
'Public Property CveUsuario As Integer
|
|
||||||
'Public Property Mail As String
|
|
||||||
'Public Property Nombre As String
|
|
||||||
'Public Property Contraseña As String
|
|
||||||
'Public Property CvePerfil As Integer
|
|
||||||
'Public Property CveUsuarioModifico As Integer
|
|
||||||
'Public Property CveEmpresa As Integer
|
|
||||||
'Public Property CveUsuarioRegistro As Integer
|
|
||||||
Dim userm As New UserModel()
|
|
||||||
userm.CveUsuario = Usuario.CveUsuario
|
|
||||||
userm.Mail = Usuario.Usuario
|
|
||||||
userm.Nombre = Usuario.Nombre
|
|
||||||
userm.Contraseña = Usuario.Contraseña
|
|
||||||
userm.CvePerfil = Usuario.CveRol
|
|
||||||
userm.CveEmpresa = 119 'Usuario.CveEmpresa
|
|
||||||
userm.CveUsuarioModifico = Usuario.CveEmpresa
|
|
||||||
userm.CveUsuarioRegistro = Usuario.CveEmpresa
|
|
||||||
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, GenerateJSONWebToken(userm)))
|
|
||||||
'Response.Redirect(ReturnUrl, True)
|
'Response.Redirect(ReturnUrl, True)
|
||||||
Else
|
Else
|
||||||
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)
|
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)
|
||||||
|
|||||||
Reference in New Issue
Block a user