Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

View File

@@ -0,0 +1,130 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class PopUpBuscarClientes
Inherits ClsPaginas
Private ReadOnly Property OpcionBusqueda As String
Get
Return ViewState("Opt").ToString
End Get
End Property
Private Property TipoCliente As Integer
Get
Return ViewState("TipoCliente").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("TipoCliente") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
'CType(Me.Master, BaseMasterPage).PopupWidth = 800
RegistraScript("if($get('tdContenido')){$get('tdContenido').style.height='520px';}")
CargaSubProyectos()
If Request("Opt") = "Fact" Then
ViewState("Opt") = "Factura"
Else
ViewState("Opt") = "Expediente"
End If
If Request("TipoCliente") IsNot Nothing AndAlso Request("TipoCliente").ToEntero > 0 Then
ViewState("TipoCliente") = Request("TipoCliente")
Else
ViewState("TipoCliente") = -1
End If
If Not Request("EsThickbox") Is Nothing Then
hdnEsThickbox.Value = Request("EsThickbox")
Else
hdnEsThickbox.Value = "N"
End If
End If
End Sub
Private Sub CargaSubProyectos()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
End Sub
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 Codigo As String = "-1"
Dim NombreCorto As String = "-1"
Dim RFC As String = "-1"
Dim Telefono As String = "-1"
Dim Mail As String = "-1"
If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim
If TxtCodigo.Text.Trim <> String.Empty Then Codigo = TxtCodigo.Text.Trim
If TxtNombreCorto.Text.Trim <> String.Empty Then NombreCorto = TxtNombreCorto.Text.Trim
If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.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 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
LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjClientes.DtResultados
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then
GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (10450, 10460, 10458)")
LtlTotalRegistros.Text = "0"
ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then
GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (27448)")
LtlTotalRegistros.Text = "0"
End If
Else
LtlTotalRegistros.Text = "0"
GV.DataSource = Nothing
Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If
End If
ObjClientes.Dispose()
GV.DataBind()
UPDatos.Update()
TblBusqueda.Visible = True
End Sub
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.RowIndex = 0 Then
'e.Row.Cells(0).Width = Unit.Pixel(350)
'e.Row.Cells(1).Width = Unit.Pixel(80)
'e.Row.Cells(2).Width = Unit.Pixel(200)
'e.Row.Cells(3).Width = Unit.Pixel(80)
'e.Row.Cells(4).Width = Unit.Pixel(100)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
Dim Liga As String = String.Empty
If OpcionBusqueda = "Factura" Then
Liga = "<a href='javascript:Ir2(""" & e.Row.DBCampo("CveCliente") & """);'>"
Else
If UsuarioActual.CveEmpresa = 43 Then
Liga = String.Format("<a href='javascript:Ir3(""{0}"");'>", e.Row.DBCampo("CveCliente"))
Else
Liga = String.Format("<a href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveCliente"))
End If
End If
e.Row.FCLiteral("LtlCodigo").Text = String.Format("<div class='truncate' style='width:60px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Codigo"))
e.Row.FCLiteral("LtlNombre").Text = String.Format("<div class='truncate' style='width:190px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Nombre"))
e.Row.FCLiteral("LtlRFC").Text = String.Format("<div class='truncate' style='width:100px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("RFC"))
e.Row.FCLiteral("LtlDireccion").Text = String.Format("<div class='truncate' style='width:165px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Direccion"))
e.Row.FCLiteral("LtlCiudad").Text = String.Format("<div class='truncate' style='width:90px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Ciudad"))
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 Sub
End Class