From c07c2b7454fa320dcf58ac70d5318ac3cfa27e38 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Fri, 18 Nov 2022 23:53:41 -0700 Subject: [PATCH] Correcciones CRM --- App_Code/ClsCRM.vb | 6 ++++- CRM/Acercamiento.aspx.cs | 2 +- CRM/EmpresaCRM.aspx.cs | 4 ++- CRM/RepAcercamientosProcesos.aspx.cs | 6 ++--- CRM/RepAcercamientosProcesosDetalle.aspx | 21 +++++++++++++++ CRM/RepAcercamientosProcesosDetalle.aspx.cs | 30 ++++++++++++++++++++- CRM/RepAcercamientosRechazos.aspx.cs | 8 +++--- 7 files changed, 66 insertions(+), 11 deletions(-) diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index 7227fdf29..1fb7574c9 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -1102,7 +1102,8 @@ Public Class ClsCRM End Function Public Function RepAcercamientosDetalle(CveEmpresa As Int32, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, cveEtapaProceso As Int32, sFecha As String, sFechaIni As String, - sFechaFin As String, Optional CveTipoProceso As Integer = -1, Optional CveRechazoMotivo As Integer = -1) As Boolean + sFechaFin As String, Optional CveTipoProceso As Integer = -1, Optional CveRechazoMotivo As Integer = -1, Optional EnPausa As Integer = -1, Optional CveGiroClasificacion As Integer = -1, + Optional EsRechazo As Boolean = False) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAcercamientosDetalle", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -1116,6 +1117,9 @@ Public Class ClsCRM .Add("@SFechaFin", SqlDbType.VarChar).Value = sFechaFin .Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso .Add("@CveRechazoMotivo", SqlDbType.Int).Value = CveRechazoMotivo + .Add("@EnPausa", SqlDbType.Int).Value = EnPausa + .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion + .Add("@EsRechazo", SqlDbType.Bit).Value = EsRechazo End With Try SqlAdapter.Fill(Data) diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index a3d0f0dd7..b4ad2e15c 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -312,7 +312,7 @@ public partial class CRM_Acercamiento : ClsPaginas CargaCheckLis(); } CargarPS(); - BtnGuardarAcercamiento.Visible = true; + //BtnGuardarAcercamiento.Visible = true; } } diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 6747ded25..368e21914 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -1015,6 +1015,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas protected void LnkEditarContacto_Click(object sender, EventArgs e) { + CargaGridTipoContacto(); + EsEditarContacto = true; limpiarCamposModalContato(); @@ -1030,7 +1032,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas IndexDTContacto = GvRow.RowIndex; - CargaGridTipoContacto(); + UPModalContacto.Update(); diff --git a/CRM/RepAcercamientosProcesos.aspx.cs b/CRM/RepAcercamientosProcesos.aspx.cs index a30b2b799..3881ae560 100644 --- a/CRM/RepAcercamientosProcesos.aspx.cs +++ b/CRM/RepAcercamientosProcesos.aspx.cs @@ -178,7 +178,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas hypt.HeaderText = $"Total"; hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1" }; string strfilstros =string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); - hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlTipoProceso.SelectedValue}&CveGrupo1={DdlGrupo1.SelectedValue}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlTipoProceso.SelectedValue}&CveGrupo1={DdlGrupo1.SelectedValue}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}"; switch (idgrupo1) { case 1: @@ -196,7 +196,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas case 4: test.HeaderText = "Fecha"; Agrupador = "Fecha"; - hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}"; + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}"; break; case 6: test.HeaderText = "Giro"; @@ -216,7 +216,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas hyp.DataTextField = $"C_{row["CveEtapaProceso"]}"; hyp.HeaderText = $"{row["EtapaProceso"]}"; hyp.DataNavigateUrlFields = new string[]{ "CveGrupo1","CveGrupo2"}; - hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}&cveEtapaProceso={row["CveEtapaProceso"]}"; + hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}&cveEtapaProceso={row["CveEtapaProceso"]}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}"; GVRepAcercamientosEtapas.Columns.Add(hyp); } } diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx b/CRM/RepAcercamientosProcesosDetalle.aspx index eaab47bd7..3ca963f4a 100644 --- a/CRM/RepAcercamientosProcesosDetalle.aspx +++ b/CRM/RepAcercamientosProcesosDetalle.aspx @@ -252,6 +252,27 @@
+ + +
+ + Todo + Activos + En Pausa + +
+ + + <%-- +
+ + +
--%> + <%-- +
+ +
--%> + diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx.cs b/CRM/RepAcercamientosProcesosDetalle.aspx.cs index 46fecc7cd..36bb965da 100644 --- a/CRM/RepAcercamientosProcesosDetalle.aspx.cs +++ b/CRM/RepAcercamientosProcesosDetalle.aspx.cs @@ -9,6 +9,8 @@ using System.Data; using System.Text; using System.IO; using Microsoft.Reporting.WebForms; +using ADSNetLibrary.SIGAPI.Models.CRM.Request; +using ADSNetLibrary.SIGAPI.Services.CRM; public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas { @@ -62,6 +64,21 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas set { ViewState["RsFechaFin"] = value; } } + + private bool REsRechazo + { + get { + if(ViewState["REsRechazo"] == null) + { + ViewState["REsRechazo"] = false; + } + + return bool.Parse(ViewState["REsRechazo"].ToString()) ; + } + set { ViewState["REsRechazo"] =(bool) value; } + } + + private DataTable DtMedioCaptacion { get @@ -112,15 +129,20 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas CveRechazoMotivo = Request["CveRechazoMotivo"] == null ? -1 : Request["CveRechazoMotivo"].ToString().ToEntero(); + REsRechazo = Request["EsRechazo"] == null ? false : (Request["EsRechazo"].ToString().ToEntero()==1?true:false); + RsFecha = Request["Fecha"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["Fecha"].ToString(); RsFechaIni = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString(); RsFechaFin = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString(); TxtFechaInicio.Text = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString(); TxtFechaFin.Text = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString(); + try { RsFechaIni = RsFechaIni.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaInicio.Text = RsFechaIni.ToDateTime().ToString("dd/MM/yyyy"); } catch (Exception) { RsFechaIni = ""; } + try { RsFechaFin = RsFechaFin.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaFin.Text = RsFechaFin.ToDateTime().ToString("dd/MM/yyyy"); } catch (Exception) { RsFechaFin = ""; } + switch (RCveTipoProceso) { case 1: @@ -145,6 +167,10 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas DdlVendedor.SelectedValueExist(RcveVendedor); DdlMedioCaptacion.SelectedValueExist(RcveMedioCaptacion); DdlProbabilidad.SelectedValueExist(RcveProbabilidadAcercamiento); + //Request["CveTipoProceso"] == null ? -1 : Request["CveTipoProceso"].ToString().ToEntero() + DdlEnPausa.SelectedValueExist(Request["EnPausa"] == null ? -1 : Request["EnPausa"].ToString().ToEntero()); + DdlGiroClasificacion.SelectedValueExist(Request["CveGiroClasificacion"] == null ? -1 : Request["CveGiroClasificacion"].ToString().ToEntero()); + cargarDatos(); } } @@ -214,6 +240,7 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas DdlTipoProceso.SelectedValue = CveTipoProceso; } upDatosRepA.Update(); + } protected void DdlTipoProceso_Change(object sender, EventArgs e) @@ -234,7 +261,8 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas { ClsCRM ObjRepA = new ClsCRM(); ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni, - RsFechaFin,CveTipoProceso:DdlTipoProceso.SelectedValue.ToEntero(), CveRechazoMotivo: CveRechazoMotivo); + RsFechaFin,CveTipoProceso:DdlTipoProceso.SelectedValue.ToEntero(), CveRechazoMotivo: CveRechazoMotivo, EnPausa: DdlEnPausa.SelectedValue.ToEntero(), CveGiroClasificacion: DdlGiroClasificacion.SelectedValue.ToEntero(), + EsRechazo: REsRechazo); GVRepAcercamientosDetalle.DataSource = ObjRepA.DtResultados; DTRepAcercamientosDetalle = ObjRepA.DtResultados; ObjRepA.Dispose(); diff --git a/CRM/RepAcercamientosRechazos.aspx.cs b/CRM/RepAcercamientosRechazos.aspx.cs index 09141e086..33f1a9aa7 100644 --- a/CRM/RepAcercamientosRechazos.aspx.cs +++ b/CRM/RepAcercamientosRechazos.aspx.cs @@ -159,12 +159,12 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas if (DdlGrupo1.SelectedValue == "1") { hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1", "CveVendedor" }; strfilstros = string.Format("&cveMedioCaptacion={0}&cveProbabilidadAcercamiento={1}", cveMedioCaptacion, cveProbabilidadAcercamiento); - hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&cveVendedor={{3}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&cveVendedor={{3}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1"; } else { hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" }; strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); - hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&c&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&c&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1"; } switch (idgrupo1) { @@ -183,7 +183,7 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas case 4: test.HeaderText = "Fecha"; Agrupador = "Fecha"; - hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}"; + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1"; break; } GVRepAcercamientosEtapas.Columns.Add(test); @@ -195,7 +195,7 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas hyp.DataTextField = $"C_{row["CveRechazoMotivo"]}"; hyp.HeaderText = $"{row["RechazoMotivo"]}"; hyp.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "CveVendedor" }; - hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&CveVendedor={{2}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&CveRechazoMotivo={row["CveRechazoMotivo"]}"; + hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&CveVendedor={{2}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&CveRechazoMotivo={row["CveRechazoMotivo"]}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1"; GVRepAcercamientosEtapas.Columns.Add(hyp); }