Commit inicial Ventas Productivo
This commit is contained in:
118
CRM/PopUpBuscarAcercamiento.aspx.cs
Normal file
118
CRM/PopUpBuscarAcercamiento.aspx.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
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.IO;
|
||||
using System.Data;
|
||||
|
||||
public partial class CRM_PopUpBuscarAcercamiento : ClsPaginas
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
((BaseMasterPage)this.Master).EsPopup = true;
|
||||
CargaFiltros();
|
||||
}
|
||||
}
|
||||
|
||||
#region "CARGA FILTROS"
|
||||
protected void CargaFiltros()
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
|
||||
if (ObjCRM.GetProbabilidadAcercamiento(UsuarioActual.CveEmpresa, 1))
|
||||
{
|
||||
DdlProbabilidad.DataSource = ObjCRM.DtResultados;
|
||||
DdlProbabilidad.Items.Insert(0, new ListItem("Todas ", "-1"));
|
||||
}
|
||||
if (ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DdlEmpresaCRM.DataSource = ObjCRM.DtResultados;
|
||||
DdlEmpresaCRM.Items.Insert(0, new ListItem("Todas ", "-1"));
|
||||
}
|
||||
if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa, 1))
|
||||
{
|
||||
DdlTipoProceso.DataSource = ObjCRM.DtResultados;
|
||||
DdlTipoProceso.Items.Insert(0, new ListItem("Todos ", "-1"));
|
||||
}
|
||||
if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa, 1))
|
||||
{
|
||||
DdlMedioCaptacion.DataSource = ObjCRM.DtResultados;
|
||||
DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos ", "-1"));
|
||||
}
|
||||
|
||||
if (ObjCRM.GetRechazoMotivo(UsuarioActual.CveEmpresa, 1))
|
||||
{
|
||||
DdlRechazoMotivo.DataSource = ObjCRM.DtResultados;
|
||||
DdlRechazoMotivo.Items.Insert(0, new ListItem("Todos ", "-1"));
|
||||
}
|
||||
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.Items.Insert(0, new ListItem("Todos ", "-1"));
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor);
|
||||
ObjCRM.Dispose();
|
||||
|
||||
DdlProbabilidad.DataBind();
|
||||
DdlEmpresaCRM.DataBind();
|
||||
DdlTipoProceso.DataBind();
|
||||
DdlVendedor.DataBind();
|
||||
DdlMedioCaptacion.DataBind();
|
||||
DdlRechazoMotivo.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "CARGA DATOS"
|
||||
|
||||
protected void BtnBuscar_Click(object sender, EventArgs e)
|
||||
{
|
||||
TblBusqueda.Visible = true;
|
||||
CargaDatos();
|
||||
UPDatos.Update();
|
||||
}
|
||||
|
||||
protected void GVDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (e.Row.DataKey("CveAcercamiento").ToEntero() > 0)
|
||||
e.Row.FCHyperLink("HplNombreAcercamiento").NavigateUrl = String.Format("/CRM/Acercamiento.aspx?CveAcercamiento={0}", e.Row.DataKey("CveAcercamiento"));
|
||||
}
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
int CveTipoProceso = DdlTipoProceso.SelectedValue.ToEntero();
|
||||
int CveEmpresaCRM = DdlEmpresaCRM.SelectedValue.ToEntero();
|
||||
|
||||
int CveVendedor = DdlVendedor.SelectedValue.ToEntero();
|
||||
int CveMedioCaptacion = DdlMedioCaptacion.SelectedValue.ToEntero();
|
||||
|
||||
int CveRechazoMotivo = DdlRechazoMotivo.SelectedValue.ToEntero();
|
||||
int CveProbabilidad = DdlProbabilidad.SelectedValue.ToEntero();
|
||||
|
||||
string FechaApertura = TxtFechaApertura.Text == "" ? "-1" : TxtFechaApertura.Text;
|
||||
string FechaCierre = TxtFechaCierre.Text == "" ? "-1" : TxtFechaCierre.Text;
|
||||
string NombreAcercamiento = TxtAcercamiento.Text == "" ? "-1" : TxtAcercamiento.Text;
|
||||
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, CveTipoProceso, CveVendedor, "-1", "-1", NombreAcercamiento, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidad, FechaApertura, FechaCierre))
|
||||
{
|
||||
GVDatos.DataSource = ObjCRM.DtResultados;
|
||||
GVDatos.DataBind();
|
||||
|
||||
LtlTotalRegistros.Text = ObjCRM.DtResultados.Rows.Count.ToString();
|
||||
if (ObjCRM.DtResultados.Rows.Count > 0)
|
||||
DivBusqueda.Visible = true;
|
||||
else
|
||||
DivBusqueda.Visible = false;
|
||||
}
|
||||
|
||||
ObjCRM.Dispose();
|
||||
UPDatos.Update();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user