Correcciones CRM

This commit is contained in:
Oscar Irigoyen
2022-11-18 23:53:41 -07:00
parent b021734e26
commit c07c2b7454
7 changed files with 66 additions and 11 deletions

View File

@@ -1102,7 +1102,8 @@ Public Class ClsCRM
End Function 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, 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 Dim retorno As Boolean = False
DataAdapter("PA_CRM_RepAcercamientosDetalle", CommandType.StoredProcedure) DataAdapter("PA_CRM_RepAcercamientosDetalle", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -1116,6 +1117,9 @@ Public Class ClsCRM
.Add("@SFechaFin", SqlDbType.VarChar).Value = sFechaFin .Add("@SFechaFin", SqlDbType.VarChar).Value = sFechaFin
.Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso .Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso
.Add("@CveRechazoMotivo", SqlDbType.Int).Value = CveRechazoMotivo .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 End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -312,7 +312,7 @@ public partial class CRM_Acercamiento : ClsPaginas
CargaCheckLis(); CargaCheckLis();
} }
CargarPS(); CargarPS();
BtnGuardarAcercamiento.Visible = true; //BtnGuardarAcercamiento.Visible = true;
} }
} }

View File

@@ -1015,6 +1015,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas
protected void LnkEditarContacto_Click(object sender, EventArgs e) protected void LnkEditarContacto_Click(object sender, EventArgs e)
{ {
CargaGridTipoContacto();
EsEditarContacto = true; EsEditarContacto = true;
limpiarCamposModalContato(); limpiarCamposModalContato();
@@ -1030,7 +1032,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
IndexDTContacto = GvRow.RowIndex; IndexDTContacto = GvRow.RowIndex;
CargaGridTipoContacto();
UPModalContacto.Update(); UPModalContacto.Update();

View File

@@ -178,7 +178,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
hypt.HeaderText = $"Total"; hypt.HeaderText = $"Total";
hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1" }; hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1" };
string strfilstros =string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); 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) switch (idgrupo1)
{ {
case 1: case 1:
@@ -196,7 +196,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
case 4: case 4:
test.HeaderText = "Fecha"; test.HeaderText = "Fecha";
Agrupador = "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; break;
case 6: case 6:
test.HeaderText = "Giro"; test.HeaderText = "Giro";
@@ -216,7 +216,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
hyp.DataTextField = $"C_{row["CveEtapaProceso"]}"; hyp.DataTextField = $"C_{row["CveEtapaProceso"]}";
hyp.HeaderText = $"{row["EtapaProceso"]}"; hyp.HeaderText = $"{row["EtapaProceso"]}";
hyp.DataNavigateUrlFields = new string[]{ "CveGrupo1","CveGrupo2"}; 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); GVRepAcercamientosEtapas.Columns.Add(hyp);
} }
} }

View File

@@ -252,6 +252,27 @@
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlGiroClasificacion" Width="100%" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" AppendDataBoundItems="true" CssClass="form-control select2me"></asp:DropDownList> <asp:DropDownList ID="DdlGiroClasificacion" Width="100%" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" AppendDataBoundItems="true" CssClass="form-control select2me"></asp:DropDownList>
</div> </div>
<label class="col-md-1" >En Pausa:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEnPausa" Width="100%" runat="server" CssClass="form-control input-sm select2me" >
<asp:ListItem Value="-1">Todo</asp:ListItem>
<asp:ListItem Value="0">Activos</asp:ListItem>
<asp:ListItem Value="1">En Pausa</asp:ListItem>
</asp:DropDownList>
</div>
<%-- <label class="col-md-1" >Etapa:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEtapaProceso" Width="100%" runat="server" CssClass="form-control input-sm select2me" DataTextField="EtapaProceso" DataValueField="CveEtapaProceso">
</asp:DropDownList>
</div>--%>
<%-- <asp:Label class="col-md-1 " style=" margin-top: 5px;" runat="server" Text="Giro:" AssociatedControlID="DdlGiroClasificacion"></asp:Label>
<div class="col-md-1">
<asp:DropDownList ID="DropDownList1" Width="100%" runat ="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" AppendDataBoundItems="true" CssClass="form-control select2me"></asp:DropDownList>
</div>--%>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -9,6 +9,8 @@ using System.Data;
using System.Text; using System.Text;
using System.IO; using System.IO;
using Microsoft.Reporting.WebForms; using Microsoft.Reporting.WebForms;
using ADSNetLibrary.SIGAPI.Models.CRM.Request;
using ADSNetLibrary.SIGAPI.Services.CRM;
public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
{ {
@@ -62,6 +64,21 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
set { ViewState["RsFechaFin"] = value; } 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 private DataTable DtMedioCaptacion
{ {
get get
@@ -112,15 +129,20 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
CveRechazoMotivo = Request["CveRechazoMotivo"] == null ? -1 : Request["CveRechazoMotivo"].ToString().ToEntero(); 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(); RsFecha = Request["Fecha"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["Fecha"].ToString();
RsFechaIni = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString(); RsFechaIni = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString();
RsFechaFin = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString(); RsFechaFin = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString();
TxtFechaInicio.Text = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].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(); 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"); } try { RsFechaIni = RsFechaIni.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaInicio.Text = RsFechaIni.ToDateTime().ToString("dd/MM/yyyy"); }
catch (Exception) { RsFechaIni = ""; } catch (Exception) { RsFechaIni = ""; }
try { RsFechaFin = RsFechaFin.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaFin.Text = RsFechaFin.ToDateTime().ToString("dd/MM/yyyy"); } try { RsFechaFin = RsFechaFin.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaFin.Text = RsFechaFin.ToDateTime().ToString("dd/MM/yyyy"); }
catch (Exception) { RsFechaFin = ""; } catch (Exception) { RsFechaFin = ""; }
switch (RCveTipoProceso) switch (RCveTipoProceso)
{ {
case 1: case 1:
@@ -145,6 +167,10 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
DdlVendedor.SelectedValueExist(RcveVendedor); DdlVendedor.SelectedValueExist(RcveVendedor);
DdlMedioCaptacion.SelectedValueExist(RcveMedioCaptacion); DdlMedioCaptacion.SelectedValueExist(RcveMedioCaptacion);
DdlProbabilidad.SelectedValueExist(RcveProbabilidadAcercamiento); 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(); cargarDatos();
} }
} }
@@ -214,6 +240,7 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
DdlTipoProceso.SelectedValue = CveTipoProceso; DdlTipoProceso.SelectedValue = CveTipoProceso;
} }
upDatosRepA.Update(); upDatosRepA.Update();
} }
protected void DdlTipoProceso_Change(object sender, EventArgs e) protected void DdlTipoProceso_Change(object sender, EventArgs e)
@@ -234,7 +261,8 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
{ {
ClsCRM ObjRepA = new ClsCRM(); ClsCRM ObjRepA = new ClsCRM();
ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni, 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; GVRepAcercamientosDetalle.DataSource = ObjRepA.DtResultados;
DTRepAcercamientosDetalle = ObjRepA.DtResultados; DTRepAcercamientosDetalle = ObjRepA.DtResultados;
ObjRepA.Dispose(); ObjRepA.Dispose();

View File

@@ -159,12 +159,12 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
if (DdlGrupo1.SelectedValue == "1") { if (DdlGrupo1.SelectedValue == "1") {
hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1", "CveVendedor" }; hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1", "CveVendedor" };
strfilstros = string.Format("&cveMedioCaptacion={0}&cveProbabilidadAcercamiento={1}", cveMedioCaptacion, cveProbabilidadAcercamiento); 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 { else {
hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" }; hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" };
strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); 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) switch (idgrupo1)
{ {
@@ -183,7 +183,7 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
case 4: case 4:
test.HeaderText = "Fecha"; test.HeaderText = "Fecha";
Agrupador = "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; break;
} }
GVRepAcercamientosEtapas.Columns.Add(test); GVRepAcercamientosEtapas.Columns.Add(test);
@@ -195,7 +195,7 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
hyp.DataTextField = $"C_{row["CveRechazoMotivo"]}"; hyp.DataTextField = $"C_{row["CveRechazoMotivo"]}";
hyp.HeaderText = $"{row["RechazoMotivo"]}"; hyp.HeaderText = $"{row["RechazoMotivo"]}";
hyp.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "CveVendedor" }; 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); GVRepAcercamientosEtapas.Columns.Add(hyp);
} }