This commit is contained in:
rrene
2020-05-30 14:58:55 -07:00
17 changed files with 544 additions and 245 deletions

View File

@@ -1839,6 +1839,44 @@ Public Class ClsProductosServicios
Return Retorno Return Retorno
End Function End Function
Public Function GetPSExistenciasWS(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ProductosExistenciasWSGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Lote", SqlDbType.VarChar).Value = Lote
.Add("@Batch", SqlDbType.VarChar).Value = Batch
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
.Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region #End Region
#Region "Porcentaje Productos" #Region "Porcentaje Productos"

View File

@@ -67,11 +67,14 @@ Partial Class Bancos_PopUpBuscarIE
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
Dim ObjBancosIE As New ClsBancos
Dim Folio As String = "-1" Dim Folio As String = "-1"
If TxtFolio.Text <> "" Then Folio = String.Format("%{0}%", TxtFolio.Text.Trim) If TxtFolio.Text <> "" Then Folio = String.Format("%{0}%", TxtFolio.Text.Trim)
If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate, MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then If ValidarFiltrosSeleccionado() Then
Dim ObjBancosIE As New ClsBancos
If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate,
MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados) DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados)
Else Else
Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError) Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError)
@@ -85,6 +88,9 @@ Partial Class Bancos_PopUpBuscarIE
GvDatos.DataBind() GvDatos.DataBind()
UpDatos.Update() UpDatos.Update()
End If End If
Else
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
@@ -103,4 +109,11 @@ Partial Class Bancos_PopUpBuscarIE
End If End If
End Sub End Sub
Private Function ValidarFiltrosSeleccionado() As Boolean
If DdlBanco.SelectedValue.ToEntero > 0 Then Return True
If DdlCuenta.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.Length > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -26,6 +26,8 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas
ClsCGame ObjCort = new ClsCGame(); ClsCGame ObjCort = new ClsCGame();
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa)) if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
{ {
DdlHuerta.DataSource = ObjCort.DtResultados;
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
DdlHuerta.DataBind(); DdlHuerta.DataBind();
} }
ObjCort.Dispose(); ObjCort.Dispose();
@@ -45,7 +47,10 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas
GvDatos.DataBind(); GvDatos.DataBind();
LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString(); LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString();
if (ObjCGame.DtResultados.Rows.Count < 1) if (ObjCGame.DtResultados.Rows.Count < 1)
{ {
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia);
}
else
{ {
TblBusqueda.Visible = true; TblBusqueda.Visible = true;
} }
@@ -60,4 +65,12 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas
} }
#region GridView #region GridView
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir("+"" + e.Row.DBCampo("CveProduccion") + ""+");'>", e.Row.DBCampo("Folio"));
}
}
#endregion #endregion

View File

@@ -37,6 +37,7 @@ Partial Class CGame_PopUpBuscarOrdenProduccion
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
Dim Folio As String Dim Folio As String
If TxtFolio.Text.Trim <> "" Then Folio = TxtFolio.Text Else Folio = "-1" If TxtFolio.Text.Trim <> "" Then Folio = TxtFolio.Text Else Folio = "-1"
If ValidarFiltrosSeleccionado() Then
Dim ObjOP As New ClsCGame Dim ObjOP As New ClsCGame
If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then
GvOP.DataSource = ObjOP.DtResultados GvOP.DataSource = ObjOP.DtResultados
@@ -50,6 +51,9 @@ Partial Class CGame_PopUpBuscarOrdenProduccion
End If End If
ObjOP.Dispose() ObjOP.Dispose()
UPDatos.Update() UPDatos.Update()
Else
Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Private Sub GvOP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOP.RowDataBound Private Sub GvOP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOP.RowDataBound
@@ -57,4 +61,13 @@ Partial Class CGame_PopUpBuscarOrdenProduccion
e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir(""" & e.Row.DBCampo("CveOrdenProduccion") & """);'>", e.Row.DBCampo("Folio")) e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir(""" & e.Row.DBCampo("CveOrdenProduccion") & """);'>", e.Row.DBCampo("Folio"))
End If End If
End Sub End Sub
Private Function ValidarFiltrosSeleccionado() As Boolean
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.Length > 0 Then Return True
If TxtFechaEntregaI.Text.Length > 0 Then Return True
If TxtFechaEntregaF.Text.Length > 0 Then Return True
If DdlCliente.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -164,6 +164,8 @@ public partial class CRM_PopUpBuscarAcercamiento : ClsPaginas
string FechaCierre = TxtFechaCierre.Text == "" ? "-1" : TxtFechaCierre.Text; string FechaCierre = TxtFechaCierre.Text == "" ? "-1" : TxtFechaCierre.Text;
string NombreAcercamiento = TxtAcercamiento.Text == "" ? "-1" : TxtAcercamiento.Text; string NombreAcercamiento = TxtAcercamiento.Text == "" ? "-1" : TxtAcercamiento.Text;
if (ValidarFiltrosSeleccionados())
{
ClsCRM ObjCRM = new ClsCRM(); ClsCRM ObjCRM = new ClsCRM();
if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, CveTipoProceso, CveVendedor, "-1", "-1", NombreAcercamiento, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidad, FechaApertura, FechaCierre)) if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, CveTipoProceso, CveVendedor, "-1", "-1", NombreAcercamiento, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidad, FechaApertura, FechaCierre))
{ {
@@ -179,6 +181,24 @@ public partial class CRM_PopUpBuscarAcercamiento : ClsPaginas
ObjCRM.Dispose(); ObjCRM.Dispose();
UPDatos.Update(); UPDatos.Update();
}else
{
Alert("Seleccione un criterio de busqueda",ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
private bool ValidarFiltrosSeleccionados()
{
if (DdlTipoProceso.SelectedValue.ToEntero() > 0) return true;
if (DdlEmpresaCRM.SelectedValue.ToEntero() > 0) return true;
if (DdlVendedor.SelectedValue.ToEntero() > 0) return true;
if (DdlMedioCaptacion.SelectedValue.ToEntero() > 0) return true;
if (DdlRechazoMotivo.SelectedValue.ToEntero() > 0) return true;
if (DdlProbabilidad.SelectedValue.ToEntero() > 0) return true;
if (TxtFechaApertura.Text != "") return true;
if (TxtFechaCierre.Text != "") return true;
if (TxtAcercamiento.Text != "") return true;
return false;
} }
#endregion #endregion
} }

View File

@@ -38,7 +38,6 @@ Partial Class Compras_PopUpBuscarFolioC
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
Dim ObjCompras As New ClsCompras()
Dim Folio As String = "-1" Dim Folio As String = "-1"
Dim FolioFiscal As String = "-1" Dim FolioFiscal As String = "-1"
@@ -55,7 +54,10 @@ Partial Class Compras_PopUpBuscarFolioC
Descripcion = If(TxtDescripcion.Text.Trim = "", "-1", TxtDescripcion.Text.Trim) Descripcion = If(TxtDescripcion.Text.Trim = "", "-1", TxtDescripcion.Text.Trim)
Obs = If(TxtObservaciones.Text.Trim = "", "-1", TxtObservaciones.Text.Trim) Obs = If(TxtObservaciones.Text.Trim = "", "-1", TxtObservaciones.Text.Trim)
If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Folio, FolioFiscal, Codigo, Proveedor, FechaI, FechaF, Descripcion, Obs, CveProveedor:=DdlProveedor.SelectedValue.ToEntero) Then If ValidarUnFiltroSeleccionado() Then
Dim ObjCompras As New ClsCompras()
If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Folio, FolioFiscal, Codigo, Proveedor, FechaI, FechaF, Descripcion, Obs,
CveProveedor:=DdlProveedor.SelectedValue.ToEntero) Then
If ObjCompras.DtResultados.Rows.Count > 0 Then If ObjCompras.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjCompras.DtResultados.Rows.Count.ToString.FormatoNumero(0) LtlTotalRegistros.Text = ObjCompras.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjCompras.DtResultados GV.DataSource = ObjCompras.DtResultados
@@ -72,6 +74,9 @@ Partial Class Compras_PopUpBuscarFolioC
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
Else
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -100,5 +105,14 @@ Partial Class Compras_PopUpBuscarFolioC
End If End If
End Sub End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If TxtFolio.Text.Trim.Length > 0 Then Return True
If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True
If TxtDescripcion.Text.Trim.Length > 0 Then Return True
If TxtObservaciones.Text.Trim.Length > 0 Then Return True
If DdlTipoDocto.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -60,6 +60,7 @@ Partial Class Compras_PopUpBuscarProveedor
If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim
CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero
If ValidarUnFiltroSeleccionado() Then
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, Codigo, RazonSocial, NombreComercial, NombreCorto, RFC, Contacto, Telefono, -1, UsuarioActual.CveEmpresa, CveTipoProveedor:=CveTipoProveedor) Then If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, Codigo, RazonSocial, NombreComercial, NombreCorto, RFC, Contacto, Telefono, -1, UsuarioActual.CveEmpresa, CveTipoProveedor:=CveTipoProveedor) Then
If ObjProveedor.DtResultados.Rows.Count > 0 Then If ObjProveedor.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjProveedor.DtResultados.Rows.Count.ToString.FormatoNumero(0) LtlTotalRegistros.Text = ObjProveedor.DtResultados.Rows.Count.ToString.FormatoNumero(0)
@@ -70,6 +71,9 @@ Partial Class Compras_PopUpBuscarProveedor
Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If End If
End If End If
Else
Alert("Seleccione un criterio de búsqueda", TipoMensaje.MsgAdvertencia)
End If
ObjProveedor.Dispose() ObjProveedor.Dispose()
GV.DataBind() GV.DataBind()
@@ -115,4 +119,16 @@ Partial Class Compras_PopUpBuscarProveedor
e.Row.FCLiteral("LtlContacto").Text = String.Format("<div class='truncate' style='width:65px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("ContactoNombre")) e.Row.FCLiteral("LtlContacto").Text = String.Format("<div class='truncate' style='width:65px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("ContactoNombre"))
End If End If
End Sub End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If TxtCodigo.Text.Trim <> String.Empty Then Return True
If TxtRazonSocial.Text.Trim <> String.Empty Then Return True
If TxtNombreComercial.Text.Trim <> String.Empty Then Return True
If TxtNombreCorto.Text.Trim <> String.Empty Then Return True
If TxtRFC.Text.Trim <> String.Empty Then Return True
If TxtContacto.Text.Trim <> String.Empty Then Return True
If TxtTelefono.Text.Trim <> String.Empty Then Return True
If DdlTipoProveedor.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -340,6 +340,21 @@ Partial Class Compras_RepRembolsoComprobaciones
params.Add(New ReportParameter("Autorizo", "")) params.Add(New ReportParameter("Autorizo", ""))
params.Add(New ReportParameter("ElaboroPuesto", "")) params.Add(New ReportParameter("ElaboroPuesto", ""))
params.Add(New ReportParameter("AutorizoPuesto", "")) params.Add(New ReportParameter("AutorizoPuesto", ""))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
params.Add(New ReportParameter("CveCajaChica", DtDatos.Rows(0)("CveCajaChica").ToString))
params.Add(New ReportParameter("CveFyE", "0")) '
params.Add(New ReportParameter("cuentaRetiro", "Cuenta retiro: " & ""))
params.Add(New ReportParameter("CajaChica", "Caja chica: " & ""))
params.Add(New ReportParameter("observaciones", "Observaciones: " & ""))
params.Add(New ReportParameter("folio", DtDatos.Rows(0)("Folio").ToString))
params.Add(New ReportParameter("fecha", ""))
params.Add(New ReportParameter("importe", ""))
params.Add(New ReportParameter("TotAbono", DtDatos.SUM("Abonado").ToString))
ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras") ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras")
Else Else
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))

View File

@@ -125,7 +125,7 @@ Partial Class Contratos_PopUpBuscarContrato
End Sub End Sub
Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click
Dim objContratos As New ClsContratos
Dim NumeroContrato As String = "-1" Dim NumeroContrato As String = "-1"
Dim Estatus As Integer = 1 Dim Estatus As Integer = 1
@@ -141,8 +141,11 @@ Partial Class Contratos_PopUpBuscarContrato
If TxtResponsable.Text.Trim.Length > 0 Then Responsable = TxtResponsable.Text If TxtResponsable.Text.Trim.Length > 0 Then Responsable = TxtResponsable.Text
If TxtNumeroContrato.Text.Trim.Length > 0 Then NumeroContrato = TxtNumeroContrato.Text If TxtNumeroContrato.Text.Trim.Length > 0 Then NumeroContrato = TxtNumeroContrato.Text
If (objContratos.GetContratosBusquedaRep(DdlTipo.SelectedValue.ToEntero, DdlTipoContrato.SelectedValue.ToEntero, NumeroContrato, Descripcion, If ValidarUnFiltroSeleccionado() Then
Ubicacion, Responsable, Estatus, DdlProyecto.SelectedValue.ToEntero, DdlSubProtecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, DdlCliente.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero)) Then Dim objContratos As New ClsContratos
If (objContratos.GetContratosBusquedaRep(DdlTipo.SelectedValue.ToEntero, DdlTipoContrato.SelectedValue.ToEntero, NumeroContrato, Descripcion, Ubicacion, Responsable, Estatus,
DdlProyecto.SelectedValue.ToEntero, DdlSubProtecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, DdlCliente.SelectedValue.ToEntero,
DdlProveedor.SelectedValue.ToEntero)) Then
GV.DataSource = objContratos.DtResultados GV.DataSource = objContratos.DtResultados
LtlTotalRegistros.Text = objContratos.DtResultados.Rows.Count.ToString LtlTotalRegistros.Text = objContratos.DtResultados.Rows.Count.ToString
Else Else
@@ -155,6 +158,10 @@ Partial Class Contratos_PopUpBuscarContrato
objContratos.Dispose() objContratos.Dispose()
GV.DataBind() GV.DataBind()
UPDatos.Update() UPDatos.Update()
Else
Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
@@ -173,6 +180,19 @@ Partial Class Contratos_PopUpBuscarContrato
End If End If
End Sub End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If TxtDescripcion.Text.Trim.Length > 0 Then Return True
If TxtUbicacion.Text.Trim.Length > 0 Then Return True
If TxtResponsable.Text.Trim.Length > 0 Then Return True
If TxtNumeroContrato.Text.Trim.Length > 0 Then Return True
'If DdlTipo.SelectedValue.ToEntero > 0 Then Return True
If DdlTipoContrato.SelectedValue.ToEntero > 0 Then Return True
If DdlProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlSubProtecto.SelectedValue.ToEntero > 0 Then Return True
If DdlCliente.SelectedValue.ToEntero > 0 Then Return True
If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -49,6 +49,7 @@ Partial Class PopUpBuscarFolio
CargaDatos() CargaDatos()
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
If ValidarFiltrosSeleccionados() Then
Dim Reporte As New ClsInventarios Dim Reporte As New ClsInventarios
Dim FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDate, MinFecha) Dim FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDate, MinFecha)
@@ -56,7 +57,8 @@ Partial Class PopUpBuscarFolio
Dim FechaIngI = If(TxtFechaIngInicio.Text.Trim <> "" AndAlso TxtFechaIngInicio.Text <> "__/__/____", TxtFechaIngInicio.Text.ToDate, MinFecha) Dim FechaIngI = If(TxtFechaIngInicio.Text.Trim <> "" AndAlso TxtFechaIngInicio.Text <> "__/__/____", TxtFechaIngInicio.Text.ToDate, MinFecha)
Dim FechaIngF = If(TxtFechaIngFin.Text.Trim <> "" AndAlso TxtFechaIngFin.Text <> "__/__/____", TxtFechaIngFin.Text.ToDate, MaxFecha) Dim FechaIngF = If(TxtFechaIngFin.Text.Trim <> "" AndAlso TxtFechaIngFin.Text <> "__/__/____", TxtFechaIngFin.Text.ToDate, MaxFecha)
If Reporte.GetMovimientosRep(DdlAlmacen.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, If(TxtFolio.Text = "", "-1", TxtFolio.Text.Trim).ToEntero, FechaIngI, FechaIngF, FechaInicial, FechaFinal, -1, UsuarioActual.CveEmpresa) Then If Reporte.GetMovimientosRep(DdlAlmacen.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, If(TxtFolio.Text = "", "-1", TxtFolio.Text.Trim).ToEntero,
FechaIngI, FechaIngF, FechaInicial, FechaFinal, -1, UsuarioActual.CveEmpresa) Then
GvM.DataSource = Reporte.DtResultados GvM.DataSource = Reporte.DtResultados
LtlTotalRegistros.Text = Reporte.DtResultados.Rows.Count.ToString.FormatoNumero(0) LtlTotalRegistros.Text = Reporte.DtResultados.Rows.Count.ToString.FormatoNumero(0)
Else Else
@@ -68,8 +70,17 @@ Partial Class PopUpBuscarFolio
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
Reporte.Dispose() Reporte.Dispose()
Else
Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Private Function ValidarFiltrosSeleccionados() As Boolean
If DdlAlmacen.SelectedValue.ToEntero > 0 Then Return True
If DdlTipoMovimiento.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.Length > 0 Then Return True
Return False
End Function
#End Region #End Region
End Class End Class

View File

@@ -94,6 +94,8 @@ Partial Class Inventarios_Default
End If End If
End Sub End Sub
Private Sub CargaDatos(CvePS As Integer, Tipo As Integer) Private Sub CargaDatos(CvePS As Integer, Tipo As Integer)
If ValidarFiltrosSeleccionados() Then
Dim ObjInventarios As New ClsInventarios() Dim ObjInventarios As New ClsInventarios()
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
@@ -160,6 +162,9 @@ Partial Class Inventarios_Default
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
Else
Alert("Seleccione un producto o servicio", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -227,6 +232,7 @@ Partial Class Inventarios_Default
End Sub End Sub
Private Sub CargarDatosMedRin() Private Sub CargarDatosMedRin()
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then
GvMedRin.DataSource = ObjInventarios.DtResultados GvMedRin.DataSource = ObjInventarios.DtResultados
@@ -236,4 +242,9 @@ Partial Class Inventarios_Default
UPDatos.Update() UPDatos.Update()
End Sub End Sub
Private Function ValidarFiltrosSeleccionados() As Boolean
If DDlPS.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -168,8 +168,11 @@ Partial Class OC_PopUpBuscarReq
Dim FI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate) Dim FI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate)
Dim guia As String = If(TxtGuia.Text.Trim = "", "-1", TxtGuia.Text) Dim guia As String = If(TxtGuia.Text.Trim = "", "-1", TxtGuia.Text)
'Cargar Datos 'Cargar Datos
If ValidarFiltrosSeleccionado() Then
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, DdlProveedor.SelectedValue.ToEntero, If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia, ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, DdlProveedor.SelectedValue.ToEntero,
If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False)) SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False))
Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial
ObjOC.Dispose() ObjOC.Dispose()
@@ -179,6 +182,9 @@ Partial Class OC_PopUpBuscarReq
LtlTotalRegistros.Text = GV.Rows.Count.ToString LtlTotalRegistros.Text = GV.Rows.Count.ToString
LblTotalRegistros.Text = "Número de registros: " LblTotalRegistros.Text = "Número de registros: "
UPDatos.Update() UPDatos.Update()
Else
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -245,6 +251,17 @@ Partial Class OC_PopUpBuscarReq
End If End If
End Sub End Sub
Private Function ValidarFiltrosSeleccionado() As Boolean
If DdlTipo.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.ToEntero > 0 Then Return True
If DdlSubProyectos.SelectedValue.ToEntero > 0 Then Return True
If DdlProyectos.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
#End Region #End Region
#Region " VINCULA CON COMPRAS " #Region " VINCULA CON COMPRAS "

View File

@@ -35,7 +35,7 @@ Partial Class OS_PopUpBuscarOS
'If TxtFechaRecibido.Text.Trim <> String.Empty Then FechaRecibido.ToString() 'If TxtFechaRecibido.Text.Trim <> String.Empty Then FechaRecibido.ToString()
If DdlEstatusOrdenServicio.SelectedValue <> String.Empty Then CveEstatusOrdenServicio = DdlEstatusOrdenServicio.SelectedValue.ToEntero If DdlEstatusOrdenServicio.SelectedValue <> String.Empty Then CveEstatusOrdenServicio = DdlEstatusOrdenServicio.SelectedValue.ToEntero
If ValidarUnFiltroSeleccionado() Then
If ObjOS.GetOrdenesServicios(-1, CveCliente, Folio, CveUsuarioRecibio, CveEstatusOrdenServicio, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then If ObjOS.GetOrdenesServicios(-1, CveCliente, Folio, CveUsuarioRecibio, CveEstatusOrdenServicio, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
If ObjOS.DtResultados.Rows.Count > 0 Then If ObjOS.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjOS.DtResultados.Rows.Count.ToString.FormatoNumero(0) LtlTotalRegistros.Text = ObjOS.DtResultados.Rows.Count.ToString.FormatoNumero(0)
@@ -46,6 +46,9 @@ Partial Class OS_PopUpBuscarOS
Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If End If
End If End If
Else
Alert("Seleccione un criterio de búsqueda", TipoMensaje.MsgAdvertencia)
End If
ObjOS.Dispose() ObjOS.Dispose()
GV.DataBind() GV.DataBind()
@@ -108,4 +111,13 @@ Partial Class OS_PopUpBuscarOS
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If TxtFolio.Text.Trim <> String.Empty Then Return True
If DdlCliente.SelectedValue.ToEntero > 0 Then Return True
If DdlUsuarioRecibio.SelectedValue.ToEntero > 0 Then Return True
'If TxtFechaRecibido.Text.Trim <> String.Empty Then FechaRecibido.ToString()
If DdlEstatusOrdenServicio.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -142,7 +142,6 @@ Partial Class RH_PopUpBuscarPersonal
End Sub End Sub
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
Dim ObjPersonal As New ClsRH()
Dim Codigo As String = "-1" Dim Codigo As String = "-1"
Dim Nombre As String = "-1" Dim Nombre As String = "-1"
@@ -161,6 +160,9 @@ Partial Class RH_PopUpBuscarPersonal
Dim StrFiltroCaracteristica As String = GeneraFiltroCaracteristicas() Dim StrFiltroCaracteristica As String = GeneraFiltroCaracteristicas()
If ValidarFiltrosSeleccionado() Then
Dim ObjPersonal As New ClsRH()
If ObjPersonal.GetPersonal2(-1, Codigo, Nombre, NSS, RFC, DdlTurnos.SelectedValue.ToEntero, DdlPuestos.SelectedValue.ToEntero, DdlDepartamentos.SelectedValue.ToEntero, If ObjPersonal.GetPersonal2(-1, Codigo, Nombre, NSS, RFC, DdlTurnos.SelectedValue.ToEntero, DdlPuestos.SelectedValue.ToEntero, DdlDepartamentos.SelectedValue.ToEntero,
DdlRuta.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, DdlEstadoCivil.SelectedValue.ToEntero, DdlGenero.SelectedValue.ToEntero, DdlRuta.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, DdlEstadoCivil.SelectedValue.ToEntero, DdlGenero.SelectedValue.ToEntero,
DdlEstatus.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClienteAsignado.SelectedValue.ToEntero, Horario, CveSupervisor, DdlEstatus.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClienteAsignado.SelectedValue.ToEntero, Horario, CveSupervisor,
@@ -181,6 +183,9 @@ Partial Class RH_PopUpBuscarPersonal
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
Else
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Private Function GeneraFiltroCaracteristicas() As String Private Function GeneraFiltroCaracteristicas() As String
@@ -383,4 +388,26 @@ Partial Class RH_PopUpBuscarPersonal
End If End If
End Sub End Sub
Private Function ValidarFiltrosSeleccionado() As Boolean
If TxtCodigo.Text.Trim <> String.Empty Then Return True
If TxtNombre.Text.Trim <> String.Empty Then Return True
If TxtNSS.Text.Trim <> String.Empty Then Return True
If TxtRFC.Text.Trim <> String.Empty Then Return True
If TxtHorarioDe.Text.Trim <> String.Empty Then Return True
If DdlTurnos.SelectedValue.ToEntero > 0 Then Return True
If DdlPuestos.SelectedValue.ToEntero > 0 Then Return True
If DdlDepartamentos.SelectedValue.ToEntero > 0 Then Return True
If DdlRuta.SelectedValue.ToEntero > 0 Then Return True
If DdlEscolaridad.SelectedValue.ToEntero > 0 Then Return True
If DdlEstadoCivil.SelectedValue.ToEntero > 0 Then Return True
If DdlGenero.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlClienteAsignado.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -54,7 +54,6 @@ Partial Class PopUpBuscarClientes
End Sub End Sub
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
Dim ObjClientes As New ClsClientes()
Dim Nombre As String = "-1" Dim Nombre As String = "-1"
Dim Codigo As String = "-1" Dim Codigo As String = "-1"
@@ -70,7 +69,11 @@ Partial Class PopUpBuscarClientes
If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim
If TxtMail.Text.Trim <> String.Empty Then Mail = TxtMail.Text.Trim If TxtMail.Text.Trim <> String.Empty Then Mail = TxtMail.Text.Trim
If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente) Then If ValidarUnFiltroSeleccionado() Then
Dim ObjClientes As New ClsClientes()
If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then If ObjClientes.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjClientes.DtResultados GV.DataSource = ObjClientes.DtResultados
@@ -94,6 +97,9 @@ Partial Class PopUpBuscarClientes
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
Else
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
@@ -127,4 +133,17 @@ Partial Class PopUpBuscarClientes
e.Row.FCLiteral("LtlMail").Text = String.Format("<div class='truncate' style='width:100px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Mail")) e.Row.FCLiteral("LtlMail").Text = String.Format("<div class='truncate' style='width:100px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Mail"))
End If End If
End Sub End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If TxtNombre.Text.Trim <> String.Empty Then Return True
If TxtCodigo.Text.Trim <> String.Empty Then Return True
If TxtNombreCorto.Text.Trim <> String.Empty Then Return True
If TxtRFC.Text.Trim <> String.Empty Then Return True
If TxtTelefono.Text.Trim <> String.Empty Then Return True
If TxtMail.Text.Trim <> String.Empty Then Return True
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -88,7 +88,6 @@ Partial Class PopUpBuscarFolio
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
Dim ObjVentas As New ClsVentas()
Dim Serie As String = "-1" Dim Serie As String = "-1"
Dim Folio As Integer = -1 Dim Folio As Integer = -1
@@ -123,7 +122,12 @@ Partial Class PopUpBuscarFolio
PeidoContrato = If(TxtPedidoContrato.Text.Length = 0, "-1", TxtPedidoContrato.Text.Trim) PeidoContrato = If(TxtPedidoContrato.Text.Length = 0, "-1", TxtPedidoContrato.Text.Trim)
OrdenCompra = If(TxtOrdenCompra.Text.Length = 0, "-1", TxtOrdenCompra.Text.Trim) OrdenCompra = If(TxtOrdenCompra.Text.Length = 0, "-1", TxtOrdenCompra.Text.Trim)
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1), DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then If ValidarUnFiltroSeleccionado() Then
Dim ObjVentas As New ClsVentas()
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero,
DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1),
DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0) LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjVentas.DtResultados GV.DataSource = ObjVentas.DtResultados
@@ -140,6 +144,9 @@ Partial Class PopUpBuscarFolio
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
Else
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
@@ -271,4 +278,20 @@ Partial Class PopUpBuscarFolio
DdlEstatusFactura.Items.Add(New ListItem("Todos", "-1")) DdlEstatusFactura.Items.Add(New ListItem("Todos", "-1"))
DdlEstatusFactura.DataBind() DdlEstatusFactura.DataBind()
End Sub End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If DdlTipoDocto.SelectedValue.ToEntero > 0 Then Return True
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True
If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True
If DdlPS.SelectedValue.ToEntero > 0 Then Return True
If DdlNombre.SelectedValue.ToEntero > 0 Then Return True
If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True
If TxtPedidoContrato.Text.Length > 0 Then Return True
If TxtOrdenCompra.Text.Length > 0 Then Return True
Return False
End Function
End Class End Class

View File

@@ -64,8 +64,11 @@ Partial Class PopUpBuscarPs
If TxtCodigoBarras.Text.Trim = "" Then CodigoBarras = "-1" Else CodigoBarras = TxtCodigoBarras.Text.Trim If TxtCodigoBarras.Text.Trim = "" Then CodigoBarras = "-1" Else CodigoBarras = TxtCodigoBarras.Text.Trim
If TxtNombre.Text = "" Then Nombre = "-1" Else Nombre = TxtNombre.Text.ToUpper If TxtNombre.Text = "" Then Nombre = "-1" Else Nombre = TxtNombre.Text.ToUpper
If ValidarUnFiltroSeleccionado() Then
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(-1, Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Codigo:=Codigo, CodigoBarras:=CodigoBarras, PS:=Nombre, pEstado:=DdlEstado.SelectedValue.ToEntero, CveTipoPS:=DdlCveTipoPS.SelectedValue.ToEntero, pAplicaParaVenta:=DdlAplicaVenta.SelectedValue.ToEntero, CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero) Then If ObjPS.GetPS(-1, Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Codigo:=Codigo, CodigoBarras:=CodigoBarras, PS:=Nombre,
pEstado:=DdlEstado.SelectedValue.ToEntero, CveTipoPS:=DdlCveTipoPS.SelectedValue.ToEntero, pAplicaParaVenta:=DdlAplicaVenta.SelectedValue.ToEntero,
CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjPS.DtResultados GvDatos.DataSource = ObjPS.DtResultados
dvbusqueda.Visible = True dvbusqueda.Visible = True
Else Else
@@ -76,6 +79,9 @@ Partial Class PopUpBuscarPs
GvDatos.DataBind() GvDatos.DataBind()
GvDatos.UseAccessibleHeader = True GvDatos.UseAccessibleHeader = True
Else
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub End Sub
#End Region #End Region
@@ -91,6 +97,17 @@ Partial Class PopUpBuscarPs
End Sub End Sub
#End Region #End Region
Private Function ValidarUnFiltroSeleccionado() As Boolean
If TxtCodigo.Text.Trim <> String.Empty Then Return True
If TxtCodigoBarras.Text.Trim <> String.Empty Then Return True
If TxtNombre.Text.Trim <> String.Empty Then Return True
If DdlCveTipoPS.SelectedValue.ToEntero > 0 Then Return True
If DdlAplicaVenta.SelectedValue.ToEntero > 0 Then Return True
If DdlCompuesto.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class End Class