se agrego un nuevo catálogo de equivalencias en medidas para econollantas
This commit is contained in:
@@ -1106,6 +1106,87 @@ Public Class ClsGenerales
|
|||||||
OnError("Ocurrió un error al eliminar el modelo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al eliminar el modelo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function GetMedidasEquivalentes(CveEmpresa As Integer, Optional CveMedida As Integer = -1, Optional CveRin As Integer = -1) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Gral_MedidasEquivalenciasGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CveMedida", SqlDbType.Int).Value = CveMedida
|
||||||
|
.Add("@CveRin", SqlDbType.Int).Value = CveRin
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener las equivalencias de medidas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function AddMedidasEquivalentes(CveMedida As Integer, CveRin As Integer, CveMedidaEquivalente As Integer, CveRinEquivalente As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Gral_MedidasEquivalenciasAdd")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveMedida", SqlDbType.Int).Value = CveMedida
|
||||||
|
.Add("@CveRin", SqlDbType.Int).Value = CveRin
|
||||||
|
.Add("@CveMedidaEquivalente", SqlDbType.Int).Value = CveMedidaEquivalente
|
||||||
|
.Add("@CveRinEquivalente", SqlDbType.Int).Value = CveRinEquivalente
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar la equivalencia de medida", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function UpdateMedidasEquivalentes(CveMedidaEquivalencia As Integer, CveMedida As Integer, CveRin As Integer, CveMedidaEquivalente As Integer, CveRinEquivalente As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Gral_MedidasEquivalenciasUpdate")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveMedidaEquivalencia", SqlDbType.Int).Value = CveMedidaEquivalencia
|
||||||
|
.Add("@CveMedida", SqlDbType.Int).Value = CveMedida
|
||||||
|
.Add("@CveRin", SqlDbType.Int).Value = CveRin
|
||||||
|
.Add("@CveMedidaEquivalente", SqlDbType.Int).Value = CveMedidaEquivalente
|
||||||
|
.Add("@CveRinEquivalente", SqlDbType.Int).Value = CveRinEquivalente
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar la equivalencia de medida", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function RemoveMedidasEquivalentes(CveMedidaEquivalencia As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Gral_MedidasEquivalenciasDelete")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveMedidaEquivalencia", SqlDbType.Int).Value = CveMedidaEquivalencia
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar la equivalencia de medida", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|||||||
@@ -4420,6 +4420,7 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/General/CatRinTamanios.aspx".ToUpper(), 711)
|
PaginaDict.Add("/General/CatRinTamanios.aspx".ToUpper(), 711)
|
||||||
PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712)
|
PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712)
|
||||||
PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038)
|
PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038)
|
||||||
|
PaginaDict.Add("/General/CatMedidaEquivalencia.aspx".ToUpper(), 773)
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<div class="modal-header ">
|
<div class="modal-header ">
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
<h4 class="modal-title">
|
<h4 class="modal-title">
|
||||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Tipo Gastos de Rechazo</asp:Literal></h4>
|
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Tipo Gastos</asp:Literal></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
|
|||||||
96
General/CatMedidaEquivalencia.aspx
Normal file
96
General/CatMedidaEquivalencia.aspx
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
<%@ Page Title="General - Catálogo de Equivalencias de Medida" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatMedidaEquivalencia.aspx.cs" Inherits="General_CatMedidaEquivalencia" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||||
|
<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="HB" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
Catálogo de Equivalencias de Medida
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
|
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||||
|
<ContentTemplate>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton runat="server" ID="BtnAgregarMedidaEquivalente" OnClick="BtnAgregarMedidaEquivalente_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Medida Equivalente" Text="<i class='fa fa-plus'></i>Agregar Medida Equivalente"></asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMedidaEquivalencia,CveMedida,CveRin,CveMedidaEquivalente,CveRinEquivalente,Medida,RinTamaño,MedidaEquivalente,RinTamañoEquivalente" EmptyDataText="No se encontraron Equivalencias de Medidas" ToolTip="Listado de Equivalencias de Medidas" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<asp:BoundField HeaderText="Medida" DataField="Medida" ItemStyle-Width="22.5%"/>
|
||||||
|
<asp:BoundField HeaderText="Tamaño de Rin" DataField="RinTamaño" ItemStyle-Width="22.5%"/>
|
||||||
|
<asp:BoundField HeaderText="Medida Equivalente" DataField="MedidaEquivalente" ItemStyle-Width="22.5%"/>
|
||||||
|
<asp:BoundField HeaderText="Tamaño de Rin Equivalente" DataField="RinTamañoEquivalente" ItemStyle-Width="22.5%"/>
|
||||||
|
<asp:TemplateField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
|
||||||
|
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
<div id="DivAgregarTiposD" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog" style="width: 350px;">
|
||||||
|
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Medidas Equivalentes</asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList runat="server" ID="DdlMedidas" CssClass="form-control input-sm select2me" Width="100%" DataTextField="Medida" DataValueField="CveMedida"></asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlMedidas" InitialValue="-1" runat="server" ControlToValidate="DdlMedidas" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMedida"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VceDdlMedidas" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlMedidas" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<label for="DdlMedidas">Medida:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList runat="server" ID="DdlRin" CssClass="form-control input-sm select2me" Width="100%" DataTextField="RinTamaño" DataValueField="CveRinTamaño"></asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlRin" InitialValue="-1" runat="server" ControlToValidate="DdlMedidas" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Rin''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMedida"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VceDdlRin" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlRin" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<label for="DdlRin">Rin:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList runat="server" ID="DdlMedidasEquivalente" CssClass="form-control input-sm select2me" Width="100%" DataTextField="Medida" DataValueField="CveMedida"></asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlMedidasEquivalente" InitialValue="-1" runat="server" ControlToValidate="DdlMedidasEquivalente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Medida Equivalente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMedida"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VceDdlMedidasEquivalente" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlMedidasEquivalente" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<label for="DdlMedidasEquivalente">Medida Equivalente:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList runat="server" ID="DdlRinEquivalente" CssClass="form-control input-sm select2me" Width="100%" DataTextField="RinTamaño" DataValueField="CveRinTamaño"></asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlRinEquivalente" InitialValue="-1" runat="server" ControlToValidate="DdlRinEquivalente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Rin Equivalente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMedida"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VceDdlRinEquivalente" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlRinEquivalente" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<label for="DdlRinEquivalente">Rin Equivalente:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="BtnAgregarEquivalente" OnClick="BtnAgregarEquivalente_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpMedida" />
|
||||||
|
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
132
General/CatMedidaEquivalencia.aspx.cs
Normal file
132
General/CatMedidaEquivalencia.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;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
public partial class General_CatMedidaEquivalencia : ClsPaginas
|
||||||
|
{
|
||||||
|
private int CveMedidaEquivalencia
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ViewState["CveMedidaEquivalencia"].ToString().ToEntero();
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["CveMedidaEquivalencia"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
CargaDatos();
|
||||||
|
CargaDatosModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CargaDatos()
|
||||||
|
{
|
||||||
|
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||||
|
if (ObjGeneral.GetMedidasEquivalentes(UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
GvDatos.DataSource = ObjGeneral.DtResultados;
|
||||||
|
GvDatos.DataBind();
|
||||||
|
}
|
||||||
|
ObjGeneral.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CargaDatosModal()
|
||||||
|
{
|
||||||
|
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||||
|
if (ObjGeneral.GetMedidas(UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
DdlMedidas.DataSource = ObjGeneral.DtResultados;
|
||||||
|
DdlMedidasEquivalente.DataSource = ObjGeneral.DtResultados;
|
||||||
|
}
|
||||||
|
if (ObjGeneral.GetRimTamanios(UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
DdlRin.DataSource = ObjGeneral.DtResultados;
|
||||||
|
DdlRinEquivalente.DataSource = ObjGeneral.DtResultados;
|
||||||
|
}
|
||||||
|
ObjGeneral.Dispose();
|
||||||
|
DdlMedidas.DataBind();
|
||||||
|
DdlMedidasEquivalente.DataBind();
|
||||||
|
DdlRin.DataBind();
|
||||||
|
DdlRinEquivalente.DataBind();
|
||||||
|
DdlMedidas.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||||
|
DdlMedidasEquivalente.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||||
|
DdlRin.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||||
|
DdlRinEquivalente.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void BtnAgregarMedidaEquivalente_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BtnAgregarEquivalente.Text = "Agregar";
|
||||||
|
DdlMedidas.SelectedValueExist(-1);
|
||||||
|
DdlMedidasEquivalente.SelectedValueExist(-1);
|
||||||
|
DdlRin.SelectedValueExist(-1);
|
||||||
|
DdlRinEquivalente.SelectedValueExist(-1);
|
||||||
|
UpModalTiposD.Update();
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BtnAgregarEquivalente.Text = "Actualizar";
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
CveMedidaEquivalencia = GvRow.DataKey("CveMedidaEquivalencia").ToEntero();
|
||||||
|
int CveMedida = GvRow.DataKey("CveMedida").ToEntero();
|
||||||
|
int CveRin = GvRow.DataKey("CveRin").ToEntero();
|
||||||
|
int CveMedidaEquivalente = GvRow.DataKey("CveMedidaEquivalente").ToEntero();
|
||||||
|
int CveRinEquivalente = GvRow.DataKey("CveRinEquivalente").ToEntero();
|
||||||
|
DdlMedidas.SelectedValueExist(CveMedida);
|
||||||
|
DdlMedidasEquivalente.SelectedValueExist(CveMedidaEquivalente);
|
||||||
|
DdlRin.SelectedValueExist(CveRin);
|
||||||
|
DdlRinEquivalente.SelectedValueExist(CveRinEquivalente);
|
||||||
|
UpModalTiposD.Update();
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
int CveMedidaEquivalenciaEliminar = GvRow.DataKey("CveMedidaEquivalencia").ToEntero();
|
||||||
|
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||||
|
if (ObjGeneral.RemoveMedidasEquivalentes(CveMedidaEquivalenciaEliminar))
|
||||||
|
{
|
||||||
|
Alert("Equivalencia eliminada correctamente");
|
||||||
|
CargaDatos();
|
||||||
|
UpDatos.Update();
|
||||||
|
}
|
||||||
|
ObjGeneral.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void BtnAgregarEquivalente_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||||
|
if(BtnAgregarEquivalente.Text == "Agregar")
|
||||||
|
{
|
||||||
|
if (ObjGeneral.AddMedidasEquivalentes(DdlMedidas.SelectedValue.ToEntero(),DdlRin.SelectedValue.ToEntero(), DdlMedidasEquivalente.SelectedValue.ToEntero(),DdlRinEquivalente.SelectedValue.ToEntero()))
|
||||||
|
{
|
||||||
|
Alert("Se agregó la equivalencia correctamente");
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
if (ObjGeneral.UpdateMedidasEquivalentes(CveMedidaEquivalencia, DdlMedidas.SelectedValue.ToEntero(), DdlRin.SelectedValue.ToEntero(), DdlMedidasEquivalente.SelectedValue.ToEntero(), DdlRinEquivalente.SelectedValue.ToEntero()))
|
||||||
|
{
|
||||||
|
Alert("Se actualizó la equivalencia correctamente");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ObjGeneral.Dispose();
|
||||||
|
CargaDatos();
|
||||||
|
UpDatos.Update();
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,18 +35,37 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr runat="server" id="DivMed" visible="false">
|
<tr runat="server" id="DivMed" visible="false">
|
||||||
<td class="text-right">Medida: </td>
|
<td class="text-right">Medida: </td>
|
||||||
<td >
|
<td >
|
||||||
<asp:DropDownList runat="server" ID="DdlMedidas" CssClass="form-control input-sm select2me" Width="150px" DataTextField="Medida" DataValueField="CveMedida"></asp:DropDownList>
|
<asp:DropDownList runat="server" ID="DdlMedidas" CssClass="form-control input-sm select2me" Width="150px" DataTextField="Medida" DataValueField="CveMedida"></asp:DropDownList>
|
||||||
</td>
|
</td>
|
||||||
|
<td rowspan="2">
|
||||||
|
<div id="DivEquivalentes" style="overflow-y: auto; overflow-x:hidden; width: 150px; height:100px" runat="server" visible="False">
|
||||||
|
<asp:GridView ID="GvEquival" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMedidaEquivalencia,CveMedida,CveRin,CveMedidaEquivalente,CveRinEquivalente,Medida,RinTamaño,MedidaEquivalente,RinTamañoEquivalente" EmptyDataText="No se encontraron Equivalencias de Medidas" ToolTip="Listado de Equivalencias de Medidas" CssClass="table table-striped table-advance table-hover" Style="margin-top: 10px; width: 100%" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField ItemStyle-Width="300px" HeaderText="Equivalentes">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="lblUsuario" runat="server" Text='<%#String.Concat(Eval("MedidaEquivalente"), " ", Eval("RinTamañoEquivalente")) %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr runat="server" id="DivRin" visible="false">
|
<tr runat="server" id="DivRin" visible="false">
|
||||||
<td class="text-right">Rin: </td>
|
<td class="text-right">Rin: </td>
|
||||||
<td >
|
<td >
|
||||||
<asp:DropDownList runat="server" ID="DdlRin" CssClass="form-control input-sm select2me" Width="150px" DataTextField="RinTamaño" DataValueField="CveRinTamaño"></asp:DropDownList>
|
<asp:DropDownList runat="server" ID="DdlRin" CssClass="form-control input-sm select2me" Width="150px" DataTextField="RinTamaño" DataValueField="CveRinTamaño"></asp:DropDownList>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr runat="server" id="DivCodigoSeriePS" visible="false">
|
<tr runat="server" id="DivCodigoSeriePS" visible="false">
|
||||||
<td class="text-right"><b>C. Barras:</b></td>
|
<td class="text-right"><b>C. Barras:</b></td>
|
||||||
@@ -60,6 +79,9 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr align="left" runat="server" id="DivSucursal" visible="false">
|
<tr align="left" runat="server" id="DivSucursal" visible="false">
|
||||||
@@ -67,12 +89,15 @@
|
|||||||
<td>
|
<td>
|
||||||
<asp:DropDownList ID="DdlSubProyecto" AutoPostBack="True" runat="server" CssClass="form-control input-sm select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="400px"></asp:DropDownList>
|
<asp:DropDownList ID="DdlSubProyecto" AutoPostBack="True" runat="server" CssClass="form-control input-sm select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="400px"></asp:DropDownList>
|
||||||
</td>
|
</td>
|
||||||
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" style="text-align: center;">
|
<td colspan="4" style="text-align: center;">
|
||||||
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" />
|
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" />
|
||||||
</td>
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
@@ -113,7 +138,7 @@
|
|||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 365px;" runat="server" visible="True">
|
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 230px;" runat="server" visible="True">
|
||||||
<asp:GridView ID="GvMedRin" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos encontrados." CssClass="table table-striped table-hover" GridLines="None">
|
<asp:GridView ID="GvMedRin" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos encontrados." CssClass="table table-striped table-hover" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />
|
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ Partial Class Inventarios_Default
|
|||||||
DivRin.Visible = True
|
DivRin.Visible = True
|
||||||
CargarMedRin()
|
CargarMedRin()
|
||||||
DivMedRin.Visible = True
|
DivMedRin.Visible = True
|
||||||
|
DivEquivalentes.Visible = True
|
||||||
DivPS.Visible = False
|
DivPS.Visible = False
|
||||||
End If
|
End If
|
||||||
Dim Txt As String = IfNull(Request("Txt"), "").ToString
|
Dim Txt As String = IfNull(Request("Txt"), "").ToString
|
||||||
@@ -89,6 +90,7 @@ Partial Class Inventarios_Default
|
|||||||
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
||||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||||
CargarDatosMedRin()
|
CargarDatosMedRin()
|
||||||
|
CargaEquivalencia()
|
||||||
Else
|
Else
|
||||||
CargaDatos(DDlPS.SelectedValue.ToEntero, 1)
|
CargaDatos(DDlPS.SelectedValue.ToEntero, 1)
|
||||||
End If
|
End If
|
||||||
@@ -243,6 +245,15 @@ Partial Class Inventarios_Default
|
|||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaEquivalencia()
|
||||||
|
Dim ObjGeneral As New ClsGenerales
|
||||||
|
If ObjGeneral.GetMedidasEquivalentes(UsuarioActual.CveEmpresa, DdlMedidas.SelectedValue.ToEntero(), DdlRin.SelectedValue.ToEntero()) Then
|
||||||
|
GvEquival.DataSource = ObjGeneral.DtResultados
|
||||||
|
End If
|
||||||
|
ObjGeneral.Dispose()
|
||||||
|
GvEquival.DataBind()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Function ValidarFiltrosSeleccionados() As Boolean
|
Private Function ValidarFiltrosSeleccionados() As Boolean
|
||||||
If DDlPS.SelectedValue.ToEntero > 0 Then Return True
|
If DDlPS.SelectedValue.ToEntero > 0 Then Return True
|
||||||
Return False
|
Return False
|
||||||
|
|||||||
Reference in New Issue
Block a user