Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -219,6 +219,109 @@ Public Class ClsOIEventos
|
|||||||
Public Property objCorreo As ObjEventosCorreo
|
Public Property objCorreo As ObjEventosCorreo
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
#Region "uno a uno"
|
||||||
|
Public Function GetUnoaUnoEtiqueta(cveUnoaUnoEtiqueta As Int32, cveEmpresa As Int32) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_OI_GetUnoaUnoEtiqueta", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@cveUnoaUnoEtiqueta", SqlDbType.Int).Value = (cveUnoaUnoEtiqueta)
|
||||||
|
.Add("@cveEmpresa", SqlDbType.Int).Value = (cveEmpresa)
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el UnoaUnoEtiqueta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
Public Function AddUnoaUnoEtiqueta(etiqueta As String, cveUnoaUnoEtiquetaVinculo As Int32, cveGrupo As Int32, cveEmpresa As Int32) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_OI_AddUnoaUnoEtiqueta", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@etiqueta", SqlDbType.VarChar).Value = (etiqueta)
|
||||||
|
.Add("@cveUnoaUnoEtiquetaVinculo", SqlDbType.Int).Value = (cveUnoaUnoEtiquetaVinculo)
|
||||||
|
.Add("@cveGrupo", SqlDbType.Int).Value = (cveGrupo)
|
||||||
|
.Add("@cveEmpresa", SqlDbType.Int).Value = (cveEmpresa)
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar el UnoaUnoEtiqueta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
Public Function UpUnoaUnoEtiqueta(cveUnoaUnoEtiqueta As Int32, etiqueta As String, cveUnoaUnoEtiquetaVinculo As Int32, cveGrupo As Int32, cveEmpresa As Int32) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_OI_UpUnoaUnoEtiqueta", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@cveUnoaUnoEtiqueta", SqlDbType.Int).Value = (cveUnoaUnoEtiqueta)
|
||||||
|
.Add("@etiqueta", SqlDbType.VarChar).Value = (etiqueta)
|
||||||
|
.Add("@cveUnoaUnoEtiquetaVinculo", SqlDbType.Int).Value = (cveUnoaUnoEtiquetaVinculo)
|
||||||
|
.Add("@cveGrupo", SqlDbType.Int).Value = (cveGrupo)
|
||||||
|
.Add("@cveEmpresa", SqlDbType.Int).Value = (cveEmpresa)
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar el UnoaUnoEtiqueta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
Public Function RemoveUnoaUnoEtiqueta(cveUnoaUnoEtiqueta As Int32) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_OI_RemoveUnoaUnoEtiqueta", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@cveUnoaUnoEtiqueta", SqlDbType.Int).Value = (cveUnoaUnoEtiqueta)
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar el UnoaUnoEtiqueta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function UnoAUnoTableroGet(cveEmpresa As Int32, fecha As String, cveUsuario As Int32) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_OI_UnoAUnoTableroGet", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Fecha", SqlDbType.Date).Value = (fecha)
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario)
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = (cveEmpresa)
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el Tablero Uno A Uno.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
Public Function UnoAUnoTableroAdd(cveEmpresa As Int32, fecha As String, cveUsuario As Int32, CveUnoaUnoEtiqueta As Integer, Comentarios As String) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_OI_UnoAUnoADD", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Fecha", SqlDbType.Date).Value = (fecha)
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario)
|
||||||
|
.Add("@CveUnoaUnoEtiqueta", SqlDbType.Int).Value = (CveUnoaUnoEtiqueta)
|
||||||
|
.Add("@Comentarios", SqlDbType.VarChar).Value = (Comentarios)
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = (cveEmpresa)
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el Tablero Uno A Uno.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
#Region "Trello"
|
#Region "Trello"
|
||||||
Public Function GetTablero(cveTablero As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
|
Public Function GetTablero(cveTablero As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
|
||||||
Dim retorno As Boolean = False
|
Dim retorno As Boolean = False
|
||||||
|
|||||||
@@ -3585,6 +3585,8 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/OI/Proyecto.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/Proyecto.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/OI/Tablero.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/Tablero.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/OI/TableroDetalle.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/TableroDetalle.aspx".ToUpper(), -1)
|
||||||
|
PaginaDict.Add("/OI/UnoaUno.aspx".ToUpper(), -1)
|
||||||
|
PaginaDict.Add("/OI/UnoaUnoConfiguracion.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/OI/ConvocatoriaDetalle.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/ConvocatoriaDetalle.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/OI/RepReuniones.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/RepReuniones.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1)
|
PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1)
|
||||||
|
|||||||
@@ -4811,7 +4811,7 @@ Partial Class OC
|
|||||||
Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
|
Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
|
||||||
|
|
||||||
For Each fileItem As Archivo In Filesgral
|
For Each fileItem As Archivo In Filesgral
|
||||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "")
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||||
Filename = fileItem.filename
|
Filename = fileItem.filename
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -6102,7 +6102,7 @@ Partial Class OC
|
|||||||
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
|
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
|
||||||
If TxtExcel.getfiles().Archivos.Count > 0 Then
|
If TxtExcel.getfiles().Archivos.Count > 0 Then
|
||||||
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
||||||
Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
|
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||||
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
|
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
|
||||||
CargarArchivo(Directorio, file.filename, Tipo)
|
CargarArchivo(Directorio, file.filename, Tipo)
|
||||||
Else
|
Else
|
||||||
@@ -7509,7 +7509,7 @@ Partial Class OC
|
|||||||
Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs)
|
||||||
If TxtExcelCot.getfiles().Archivos.Count > 0 Then
|
If TxtExcelCot.getfiles().Archivos.Count > 0 Then
|
||||||
Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0)
|
Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0)
|
||||||
Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
|
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||||
CargarArchivoCot(Directorio, file.filename)
|
CargarArchivoCot(Directorio, file.filename)
|
||||||
|
|
||||||
CargaCotizaciones(CveOrdenCompra)
|
CargaCotizaciones(CveOrdenCompra)
|
||||||
|
|||||||
86
OI/UnoaUno.aspx
Normal file
86
OI/UnoaUno.aspx
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="UnoaUno.aspx.cs" Inherits="OI_UnoaUno" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
<style>
|
||||||
|
.fecharef {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpTitulo" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
Tablero Uno a Uno - <asp:Literal ID="LtlusuarioTitulo" runat="server"></asp:Literal>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
|
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
<asp:UpdatePanel ID="UpContenido" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="portlet solid grey-cascade portlet-filter">
|
||||||
|
<div class="portlet-title portlet-filterT smalltitle magindate">
|
||||||
|
<div class="tools">
|
||||||
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" CssClass="btn btn-primary" />
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption ">
|
||||||
|
<ul class="list-inline text-size-12">
|
||||||
|
<li>Fecha :</li>
|
||||||
|
<li style="margin-right: 30px">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox ID="TxtCFecha" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10" Height="24px"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="LnkFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" Height="24px" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
<ajax:MaskedEditExtender ID="MEETxtCFecha" runat="server" TargetControlID="TxtCFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="CEETxtCFecha" TargetControlID="TxtCFecha" PopupButtonID="LnkFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvTxtCFecha" runat="server" ControlToValidate="TxtCFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<asp:CompareValidator ID="CVTxtCFecha" runat="server" ControlToValidate="TxtCFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaI''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VcoTxtCFecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtCFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VcoTxtCFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtCFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<asp:GridView ID="GVPA_OI_UnoAUnoTableroGet" runat="server" GridLines="None" CssClass="table table-hover ScrollAD Widthall" AutoGenerateColumns="False" ShowHeader="false"
|
||||||
|
DataKeyNames="CveUnoaUnoEtiqueta,Etiqueta,Comentarios,CveUnoaUno">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField HeaderText="Comentarios">
|
||||||
|
<ItemTemplate>
|
||||||
|
<h4>
|
||||||
|
<asp:Label ID="lbletiqueta" CssClass="bold" runat="server" Text='<%# Eval("Etiqueta")%>'> </asp:Label></h4>
|
||||||
|
<br />
|
||||||
|
<asp:TextBox ID="TxtComentarios" CssClass="form-control" Text='<%# Eval("Comentarios")%>' TextMode="MultiLine" Rows="3" runat="server"></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<div class="text-center">
|
||||||
|
<asp:LinkButton runat="server" ID="LnkGuardar" OnClick="LnkGuardar_Click" CssClass="btn btn-primary"> Guardar</asp:LinkButton>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
58
OI/UnoaUno.aspx.cs
Normal file
58
OI/UnoaUno.aspx.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using Extensiones;
|
||||||
|
public partial class OI_UnoaUno : ClsPaginas
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
TxtCFecha.Text = DateTime.Now.ToString("dd/MM/yyyy");
|
||||||
|
LtlusuarioTitulo.Text = UsuarioActual.Nombre;
|
||||||
|
BtnConsultar_Click(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using (ClsOIEventos ObjPA_O = new ClsOIEventos())
|
||||||
|
{
|
||||||
|
|
||||||
|
ObjPA_O.UnoAUnoTableroGet(UsuarioActual.CveEmpresa, TxtCFecha.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario);
|
||||||
|
GVPA_OI_UnoAUnoTableroGet.DataSource = ObjPA_O.DtResultados;
|
||||||
|
ObjPA_O.Dispose();
|
||||||
|
GVPA_OI_UnoAUnoTableroGet.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkGuardar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string fecha = TxtCFecha.Text.ToDate().ToString("yyyy/MM/dd");
|
||||||
|
bool continuar = true;
|
||||||
|
using (ClsOIEventos ObjPA_O = new ClsOIEventos())
|
||||||
|
{
|
||||||
|
foreach (GridViewRow gvrow in GVPA_OI_UnoAUnoTableroGet.Rows)
|
||||||
|
{
|
||||||
|
if (continuar)
|
||||||
|
{
|
||||||
|
int CveUnoaUnoEtiqueta = gvrow.DataKey("CveUnoaUnoEtiqueta").ToEntero();
|
||||||
|
if (CveUnoaUnoEtiqueta > 0)
|
||||||
|
{
|
||||||
|
string Comentarios = gvrow.FCTextBox("TxtComentarios").Text;
|
||||||
|
continuar = ObjPA_O.UnoAUnoTableroAdd(UsuarioActual.CveEmpresa, fecha, UsuarioActual.CveUsuario, CveUnoaUnoEtiqueta, Comentarios);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (continuar)
|
||||||
|
{
|
||||||
|
Alert("Información Actualizada");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
81
OI/UnoaUnoConfiguracion.aspx
Normal file
81
OI/UnoaUnoConfiguracion.aspx
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="UnoaUnoConfiguracion.aspx.cs" Inherits="OI_UnoaUnoConfiguracion" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||||
|
Configuración Uno a Uno
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||||
|
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<li ><asp:LinkButton ID = "LinkButton1" OnClick ="LnkAgregarUnoa_Click" runat = "server" ><i class="fa fa-plus"></i>Etiqueta</asp:LinkButton></li>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content8" ContentPlaceHolderID="C" Runat="Server">
|
||||||
|
<asp:UpdatePanel ID="upDatosUnoa" runat ="server" UpdateMode="Conditional" >
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:GridView ID="GVUnoaUnoEtiqueta" runat="server" GridLines="None" CssClass ="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
|
||||||
|
datakeynames="CveUnoaUnoEtiqueta,Etiqueta,CveUnoaUnoEtiquetaVinculo,CveGrupo,CveEmpresa,Empresa">
|
||||||
|
<Columns>
|
||||||
|
<asp:BoundField HeaderText="Etiqueta" DataField="Etiqueta" />
|
||||||
|
<asp:TemplateField ItemStyle-Width="50">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarUnoa_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField ItemStyle-Width="50">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarUnoa_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el UnoaUnoEtiqueta?" data-btn-ok-label="si" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
<div id="DModalUnoaUnoEtiqueta" class="modal ADS fade" role="dialog">
|
||||||
|
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalUnoa" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-content" >
|
||||||
|
<div class="modal-header ">
|
||||||
|
<div class="modal-btn">
|
||||||
|
</div>
|
||||||
|
<h4 class="modal-title"><asp:Literal ID="ltlUnoatitulo" runat="server"> </asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 truncate ">Etiqueta</div>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtUnoaetiqueta" CssClass="form-control input-sm " runat="server"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvUnoaetiqueta" runat="server" ControlToValidate="TxtUnoaetiqueta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Etiqueta''</b> es necesario, por favor ingréselo." ValidationGroup="VGMUnoa"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VcoUnoaetiqueta" runat="server" HighlightCssClass="vco" TargetControlID="RfvUnoaetiqueta"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 truncate ">Vinculo </div>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlUnoaetiqueta1" CssClass="form-control input-sm select2me " runat="server" DataTextField="Etiqueta" DataValueField="CveUnoaUnoEtiqueta" style="width: 100%" ></asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
|
||||||
|
<asp:Button ID="BtnUnoaADD" OnClick="BtnUnoaADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMUnoa" />
|
||||||
|
<asp:Button ID="BtnUnoaEdit" OnClick="BtnUnoaEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMUnoa" ></asp:Button>
|
||||||
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content9" ContentPlaceHolderID="JS" Runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
|
||||||
132
OI/UnoaUnoConfiguracion.aspx.cs
Normal file
132
OI/UnoaUnoConfiguracion.aspx.cs
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using Extensiones;
|
||||||
|
|
||||||
|
public partial class OI_UnoaUnoConfiguracion : ClsPaginas
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Propiedades
|
||||||
|
private int CcveUnoaUnoEtiqueta
|
||||||
|
{
|
||||||
|
get { return (ViewState["CcveUnoaUnoEtiqueta"] == null) ? 0 : Convert.ToInt32(ViewState["CcveUnoaUnoEtiqueta"]); }
|
||||||
|
set { ViewState["CcveUnoaUnoEtiqueta"] = value; }
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
CargaUnoaUnoEtiqueta();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void CargaUnoaUnoEtiqueta()
|
||||||
|
{
|
||||||
|
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||||
|
{
|
||||||
|
|
||||||
|
ObjUnoa.GetUnoaUnoEtiqueta(-1, UsuarioActual.CveEmpresa);
|
||||||
|
GVUnoaUnoEtiqueta.DataSource = ObjUnoa.DtResultados;
|
||||||
|
DdlUnoaetiqueta1.DataSource = ObjUnoa.DtResultados;
|
||||||
|
}
|
||||||
|
GVUnoaUnoEtiqueta.DataBind();
|
||||||
|
DdlUnoaetiqueta1.DataBind();
|
||||||
|
DdlUnoaetiqueta1.Items.Insert(0,new ListItem("Seleccione","-1"));
|
||||||
|
upDatosUnoa.Update();
|
||||||
|
}
|
||||||
|
protected void LimpiaUnoaUnoEtiqueta()
|
||||||
|
{
|
||||||
|
TxtUnoaetiqueta.Text = "";
|
||||||
|
DdlUnoaetiqueta1.SelectedIndex = 0;
|
||||||
|
UPModalUnoa.Update();
|
||||||
|
}
|
||||||
|
protected void LnkEditarUnoa_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LimpiaUnoaUnoEtiqueta();
|
||||||
|
ltlUnoatitulo.Text = "Actualizar Etiqueta";
|
||||||
|
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
CcveUnoaUnoEtiqueta = gvRow.DataKey("CveUnoaUnoEtiqueta").ToEntero();
|
||||||
|
string etiqueta = gvRow.DataKey("Etiqueta");
|
||||||
|
int cveUnoaUnoEtiquetaVinculo = gvRow.DataKey("CveUnoaUnoEtiquetaVinculo").ToEntero();
|
||||||
|
int cveGrupo = gvRow.DataKey("CveGrupo").ToEntero();
|
||||||
|
int cveEmpresa = gvRow.DataKey("CveEmpresa").ToEntero();
|
||||||
|
|
||||||
|
TxtUnoaetiqueta.Text = etiqueta.ToString();
|
||||||
|
DdlUnoaetiqueta1.SelectedValue = "-1";
|
||||||
|
DdlUnoaetiqueta1.SelectedValueExist(cveUnoaUnoEtiquetaVinculo.ToString());
|
||||||
|
this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal();");
|
||||||
|
BtnUnoaADD.Visible = false;
|
||||||
|
BtnUnoaEdit.Visible = true;
|
||||||
|
UPModalUnoa.Update();
|
||||||
|
}
|
||||||
|
protected void LnkAgregarUnoa_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ltlUnoatitulo.Text = "Agregar Etiqueta";
|
||||||
|
this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal();");
|
||||||
|
LimpiaUnoaUnoEtiqueta();
|
||||||
|
BtnUnoaADD.Visible = true;
|
||||||
|
BtnUnoaEdit.Visible = false;
|
||||||
|
UPModalUnoa.Update();
|
||||||
|
}
|
||||||
|
protected void BtnUnoaADD_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
string etiqueta = TxtUnoaetiqueta.Text;
|
||||||
|
int cveUnoaUnoEtiquetaVinculo = DdlUnoaetiqueta1.SelectedValue.ToEntero();
|
||||||
|
int cveGrupo = 1;
|
||||||
|
int cveEmpresa = UsuarioActual.CveEmpresa;
|
||||||
|
bool Continuar = false;
|
||||||
|
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||||
|
{
|
||||||
|
Continuar=ObjUnoa.AddUnoaUnoEtiqueta(etiqueta, cveUnoaUnoEtiquetaVinculo, cveGrupo, cveEmpresa);
|
||||||
|
}
|
||||||
|
if (Continuar)
|
||||||
|
{
|
||||||
|
this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal('hide');");
|
||||||
|
LimpiaUnoaUnoEtiqueta();
|
||||||
|
CargaUnoaUnoEtiqueta();
|
||||||
|
UPModalUnoa.Update();
|
||||||
|
this.Alert("La Etiqueta se ha agregado");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void BtnUnoaEdit_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
string etiqueta = TxtUnoaetiqueta.Text;
|
||||||
|
int cveUnoaUnoEtiquetaVinculo = DdlUnoaetiqueta1.SelectedValue.ToEntero();
|
||||||
|
int cveGrupo = 1;
|
||||||
|
int cveEmpresa = UsuarioActual.CveEmpresa;
|
||||||
|
bool Continuar = false;
|
||||||
|
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||||
|
{
|
||||||
|
Continuar = ObjUnoa.UpUnoaUnoEtiqueta(CcveUnoaUnoEtiqueta, etiqueta, cveUnoaUnoEtiquetaVinculo, cveGrupo, cveEmpresa);
|
||||||
|
}
|
||||||
|
if (Continuar)
|
||||||
|
{
|
||||||
|
this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal('hide');");
|
||||||
|
LimpiaUnoaUnoEtiqueta();
|
||||||
|
UPModalUnoa.Update();
|
||||||
|
CargaUnoaUnoEtiqueta();
|
||||||
|
this.Alert("La Etiqueta se ha actualizado");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void LnkEliminarUnoa_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
CcveUnoaUnoEtiqueta = gvRow.DataKey("CveUnoaUnoEtiqueta").ToEntero();
|
||||||
|
bool Continuar = false;
|
||||||
|
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||||
|
{
|
||||||
|
|
||||||
|
Continuar = ObjUnoa.RemoveUnoaUnoEtiqueta(CcveUnoaUnoEtiqueta);
|
||||||
|
}
|
||||||
|
if (Continuar)
|
||||||
|
{
|
||||||
|
CargaUnoaUnoEtiqueta();
|
||||||
|
this.Alert("La Etiqueta se ha Eliminado");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1789,7 +1789,7 @@ Partial Class PV
|
|||||||
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
|
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
|
||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
Dim index As Integer = 0
|
Dim index As Integer = 0
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows
|
||||||
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
|
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
|
||||||
If CveVentaDetalle > 0 Then
|
If CveVentaDetalle > 0 Then
|
||||||
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
|
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
|
||||||
@@ -1847,19 +1847,45 @@ Partial Class PV
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'RECARGA LOS DATOS
|
'RECARGA LOS DATOS
|
||||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
ObjFactura.Dispose()
|
||||||
TmpDT = ObjVentas.DtResultados.Copy()
|
ObjFactura = Nothing
|
||||||
ObjFactura.DtDetalle = TmpDT
|
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa)
|
||||||
Else
|
|
||||||
|
If ObjFactura Is Nothing Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
|
Else
|
||||||
|
TmpDT = ObjFactura.DtDetalle
|
||||||
|
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||||
|
|
||||||
|
Dim NumRowsPS As Integer = 0
|
||||||
|
Dim CantidadPS As Decimal = 0
|
||||||
|
For Each GvRow As GridViewRow In GvPS.Rows
|
||||||
|
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||||
|
NumRowsPS += 1
|
||||||
|
CantidadPS += GvRow.DataKey("Cantidad").ToDecimal()
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
'VALIDA NUMERO DE REGISTROS
|
||||||
|
If TmpDT.Rows.Count <> NumRowsPS Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
'VALIDA CANTIDAD DE REGISTROS
|
||||||
|
If TmpDT.SUM("Cantidad") <> CantidadPS Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'GUARDA USADOS
|
'GUARDA USADOS
|
||||||
If Not ObjVentas.EliminarUsados(CveVenta) Then
|
If Not OcurrioError AndAlso Not ObjVentas.EliminarUsados(CveVenta) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If TmpDTRecepcionUsados IsNot Nothing Then
|
If Not OcurrioError AndAlso TmpDTRecepcionUsados IsNot Nothing Then
|
||||||
For Each drow As DataRow In TmpDTRecepcionUsados.Rows
|
For Each drow As DataRow In TmpDTRecepcionUsados.Rows
|
||||||
If Not ObjVentas.AddVentaUsado(CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("CveBCIUsado").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero) Then
|
If Not ObjVentas.AddVentaUsado(CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("CveBCIUsado").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
@@ -1869,11 +1895,11 @@ Partial Class PV
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'GUARDAR AJUSTES'
|
'GUARDAR AJUSTES'
|
||||||
If Not ObjAcum.EliminarGarantiasDetalle(CveVenta) Then
|
If Not OcurrioError AndAlso Not ObjAcum.EliminarGarantiasDetalle(CveVenta) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0 Then
|
If Not OcurrioError AndAlso TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0 Then
|
||||||
For Each Dr As DataRow In TmpDTAjustes.Rows
|
For Each Dr As DataRow In TmpDTAjustes.Rows
|
||||||
If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero,
|
If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero,
|
||||||
Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero,
|
Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero,
|
||||||
@@ -1884,11 +1910,11 @@ Partial Class PV
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'GUARDAR POLIZA VIRTUAL
|
'GUARDAR POLIZA VIRTUAL
|
||||||
If Not ObjAcum.EliminarPolizaVirtual(CveVenta) Then
|
If Not OcurrioError AndAlso Not ObjAcum.EliminarPolizaVirtual(CveVenta) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If TmpDTPolizaVirtual IsNot Nothing Then
|
If Not OcurrioError AndAlso TmpDTPolizaVirtual IsNot Nothing Then
|
||||||
For Each drow As DataRow In TmpDTPolizaVirtual.Rows
|
For Each drow As DataRow In TmpDTPolizaVirtual.Rows
|
||||||
If ObjAcum.AddPolizaVirtual(CveVenta, drow("CveVentaDetalle").ToString().ToEntero(), drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("Descuento").ToString.ToDecimal,
|
If ObjAcum.AddPolizaVirtual(CveVenta, drow("CveVentaDetalle").ToString().ToEntero(), drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("Descuento").ToString.ToDecimal,
|
||||||
drow("Total").ToString.ToDecimal, drow("TipoServicio").ToString.ToEntero, drow("TipoPoliza").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero, drow("AnioVehiculo").ToString.ToEntero, CBool(drow("TieneUsado").ToString),
|
drow("Total").ToString.ToDecimal, drow("TipoServicio").ToString.ToEntero, drow("TipoPoliza").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero, drow("AnioVehiculo").ToString.ToEntero, CBool(drow("TieneUsado").ToString),
|
||||||
@@ -2758,13 +2784,18 @@ Partial Class PV
|
|||||||
|
|
||||||
#Region "GVPS"
|
#Region "GVPS"
|
||||||
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
|
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
|
||||||
|
|
||||||
Dim DbRow As DataRow = Nothing
|
Dim DbRow As DataRow = Nothing
|
||||||
DbRow = TmpDT.Rows(e.RowIndex)
|
DbRow = TmpDT.Rows(e.RowIndex)
|
||||||
|
|
||||||
EliminarUsados(DbRow("Consec").ToString().ToEntero())
|
Me.CveVentaDetalle = DbRow("CveVentaDetalle").ToString().ToEntero()
|
||||||
|
|
||||||
TmpDT.Rows.Remove(DbRow)
|
If Me.CveVentaDetalle <= 0 Then
|
||||||
|
EliminarUsados(DbRow("Consec").ToString().ToEntero())
|
||||||
|
TmpDT.Rows.Remove(DbRow)
|
||||||
|
Else
|
||||||
|
EliminarUsados()
|
||||||
|
DbRow("EliminarDB") = True
|
||||||
|
End If
|
||||||
|
|
||||||
GvPS.DataSource = TmpDT.FiltraParametros("EliminarDB = False")
|
GvPS.DataSource = TmpDT.FiltraParametros("EliminarDB = False")
|
||||||
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||||
@@ -2774,6 +2805,9 @@ Partial Class PV
|
|||||||
|
|
||||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||||
|
|
||||||
|
Me.CveVentaDetalle = -1
|
||||||
|
|
||||||
|
|
||||||
UpContado.Update()
|
UpContado.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub GvPS_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPS.RowDataBound
|
Protected Sub GvPS_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPS.RowDataBound
|
||||||
|
|||||||
@@ -19453,28 +19453,29 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||||
Dim dt As New DataTable
|
Dim dt As New DataTable
|
||||||
Dim Conexion As Odbc.OdbcConnection = Nothing
|
'Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||||
Dim ErrorArchivo = False
|
Dim ErrorArchivo = False
|
||||||
Dim n As Integer = 0
|
Dim n As Integer = 0
|
||||||
Try
|
dt = ReadExcelFile(Ruta + FileName, True)
|
||||||
Select Case Tipo
|
'Try
|
||||||
Case "EXCEL"
|
' Select Case Tipo
|
||||||
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
' Case "EXCEL"
|
||||||
Conexion.Open()
|
' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||||
Dim cmd = Conexion.CreateCommand()
|
' Conexion.Open()
|
||||||
cmd.CommandType = CommandType.Text
|
' Dim cmd = Conexion.CreateCommand()
|
||||||
cmd.CommandText = "Select * FROM [Hoja1$] WHERE Cantidad >=1"
|
' cmd.CommandType = CommandType.Text
|
||||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
' cmd.CommandText = "Select * FROM [Hoja1$] WHERE Cantidad >=1"
|
||||||
DataAdapter.Fill(dt)
|
' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||||
Case Else
|
' DataAdapter.Fill(dt)
|
||||||
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
' Case Else
|
||||||
Exit Sub
|
' Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||||
End Select
|
' Exit Sub
|
||||||
Catch ex As Exception
|
' End Select
|
||||||
ErrorArchivo = True
|
'Catch ex As Exception
|
||||||
OnError("Ocurrio un Error al leer el archivo <br/>" & ex.Message, ex)
|
' ErrorArchivo = True
|
||||||
End Try
|
' OnError("Ocurrio un Error al leer el archivo <br/>" & ex.Message, ex)
|
||||||
Conexion.Close()
|
'End Try
|
||||||
|
'Conexion.Close()
|
||||||
If Not ErrorArchivo Then
|
If Not ErrorArchivo Then
|
||||||
If Not dt.Columns(0).ColumnName = "Cantidad" Then
|
If Not dt.Columns(0).ColumnName = "Cantidad" Then
|
||||||
Alert("El nombre de la primera columna debe ser 'Cantidad'.Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la primera columna debe ser 'Cantidad'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
@@ -19523,6 +19524,7 @@ Partial Class Ventas
|
|||||||
Dim RowNoEncontrados As String = ""
|
Dim RowNoEncontrados As String = ""
|
||||||
Dim NumAgregados As Integer = 0
|
Dim NumAgregados As Integer = 0
|
||||||
For Each Row As DataRow In dt.Rows
|
For Each Row As DataRow In dt.Rows
|
||||||
|
NumAgregados = NumAgregados + 1
|
||||||
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal
|
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal
|
||||||
Dim UM As String = Row("UM").ToString()
|
Dim UM As String = Row("UM").ToString()
|
||||||
Dim Codigo As String = Row("Código").ToString().Trim.ToUpper
|
Dim Codigo As String = Row("Código").ToString().Trim.ToUpper
|
||||||
@@ -25444,4 +25446,53 @@ Partial Class Ventas
|
|||||||
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
||||||
CargaEventoBitacora()
|
CargaEventoBitacora()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||||
|
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
|
Dim excelFile As GemBox.Spreadsheet.ExcelFile = GemBox.Spreadsheet.ExcelFile.Load(flatFilePath)
|
||||||
|
|
||||||
|
Dim unnamed As Integer = 0
|
||||||
|
Dim cols As Integer
|
||||||
|
Dim columns As String()
|
||||||
|
Dim curRow As Integer = 0
|
||||||
|
Dim curCol As Integer = 0
|
||||||
|
Dim dataTable As DataTable = New DataTable()
|
||||||
|
Dim worksheet As GemBox.Spreadsheet.ExcelWorksheet = excelFile.Worksheets(0)
|
||||||
|
|
||||||
|
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||||
|
|
||||||
|
If firstRowHasHeaders Then
|
||||||
|
|
||||||
|
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||||
|
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
||||||
|
Else
|
||||||
|
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
curRow = 1
|
||||||
|
Else
|
||||||
|
dataTable.Columns.Add("Column " & (cols + 1))
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
While curRow < worksheet.Rows.Count
|
||||||
|
columns = New String(cols - 1) {}
|
||||||
|
|
||||||
|
For curCol = 0 To cols - 1
|
||||||
|
|
||||||
|
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||||
|
columns(curCol) = ""
|
||||||
|
Else
|
||||||
|
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
dataTable.Rows.Add(columns)
|
||||||
|
curRow += 1
|
||||||
|
End While
|
||||||
|
|
||||||
|
Return dataTable
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user