Merge branch 'master' of http://jperez@adsistemasof.sytes.net:8383/SIG.git
This commit is contained in:
@@ -219,6 +219,109 @@ Public Class ClsOIEventos
|
||||
Public Property objCorreo As ObjEventosCorreo
|
||||
|
||||
#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"
|
||||
Public Function GetTablero(cveTablero As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
|
||||
@@ -3585,6 +3585,8 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/OI/Proyecto.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/OI/Tablero.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/RepReuniones.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1)
|
||||
|
||||
@@ -68,6 +68,53 @@ Namespace Extensiones
|
||||
#End Region
|
||||
|
||||
|
||||
Public 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
|
||||
|
||||
Public Function CadenaConexion() As String
|
||||
Dim BaseDatos As String = "Ventas"
|
||||
'If Not IsNothing(System.Web.HttpContext.Current) AndAlso Not IsNothing(System.Web.HttpContext.Current.Session) Then
|
||||
|
||||
@@ -141,7 +141,7 @@ Partial Class Bancos_Reportes
|
||||
rv.LocalReport.DataSources.Clear()
|
||||
rv.LocalReport.DataSources.Add(rds)
|
||||
rv.LocalReport.DataSources.Add(rds2)
|
||||
rv.LocalReport.ReportPath = ModExtensiones.DirectorioBaseEmpresas & "Bancos\Reportes\rptChequeMovimientos.rdlc"
|
||||
rv.LocalReport.ReportPath = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\rptChequeMovimientos.rdlc"
|
||||
rv.LocalReport.Refresh()
|
||||
|
||||
Dim paramList As New List(Of ReportParameter)
|
||||
|
||||
@@ -6110,52 +6110,6 @@ Partial Class OC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = 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 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
|
||||
|
||||
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19451,30 +19451,11 @@ Partial Class Ventas
|
||||
Public Sub LbDescargarExcel_Click(sender As Object, e As EventArgs) Handles LbDescargarExcelVentas.Click
|
||||
DescargarFormato()
|
||||
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, FileUrl As String)
|
||||
Dim dt As New DataTable
|
||||
Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||
Dim ErrorArchivo = False
|
||||
Dim n As Integer = 0
|
||||
Try
|
||||
Select Case Tipo
|
||||
Case "EXCEL"
|
||||
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
Conexion.Open()
|
||||
Dim cmd = Conexion.CreateCommand()
|
||||
cmd.CommandType = CommandType.Text
|
||||
cmd.CommandText = "Select * FROM [Hoja1$] WHERE Cantidad >=1"
|
||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
DataAdapter.Fill(dt)
|
||||
Case Else
|
||||
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ErrorArchivo = True
|
||||
OnError("Ocurrio un Error al leer el archivo <br/>" & ex.Message, ex)
|
||||
End Try
|
||||
Conexion.Close()
|
||||
dt = ReadExcelFile(FileUrl, True)
|
||||
If Not ErrorArchivo Then
|
||||
If Not dt.Columns(0).ColumnName = "Cantidad" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Cantidad'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
@@ -19523,6 +19504,7 @@ Partial Class Ventas
|
||||
Dim RowNoEncontrados As String = ""
|
||||
Dim NumAgregados As Integer = 0
|
||||
For Each Row As DataRow In dt.Rows
|
||||
NumAgregados = NumAgregados + 1
|
||||
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal
|
||||
Dim UM As String = Row("UM").ToString()
|
||||
Dim Codigo As String = Row("Código").ToString().Trim.ToUpper
|
||||
@@ -19674,7 +19656,7 @@ Partial Class Ventas
|
||||
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
||||
Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
|
||||
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
|
||||
CargarArchivo(Directorio, file.filename, Tipo)
|
||||
CargarArchivo(Directorio, file.filename, Tipo, file.FileUrl)
|
||||
Else
|
||||
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
||||
End If
|
||||
@@ -25444,4 +25426,7 @@ Partial Class Ventas
|
||||
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
||||
CargaEventoBitacora()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user