diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index 1b845f870..3545d849f 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -667,7 +667,7 @@ Public Class ClsCRM Optional CveVendedor As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1", Optional NombreAcercamiento As String = "-1", Optional CveMedioCaptacion As Integer = -1, Optional CveRechazoMotivo As Integer = -1, Optional CveProbabilidad As Integer = -1, Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1", Optional TopSelect As Integer = 10000, Optional CvePS As Integer = -1, - Optional CveGiroClasificacion As Integer = -1) As Boolean + Optional CveGiroClasificacion As Integer = -1, Optional EnPausa As Integer = -1, Optional CveEtapaProceso As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoGet") With SqlAdapter.SelectCommand.Parameters @@ -694,6 +694,12 @@ Public Class ClsCRM .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion + + .Add("@EnPausa", SqlDbType.Int).Value = EnPausa + .Add("@CveEtapaProceso", SqlDbType.Int).Value = CveEtapaProceso + '.Add("@CveMedioCaptacion", SqlDbType.Int).Value = CveMedioCaptacion + '.Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso + End With Try SqlAdapter.Fill(Data) @@ -1030,7 +1036,8 @@ Public Class ClsCRM #Region "REPORTES" - Public Function RepAcercamientosEtapas(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1) As Boolean + Public Function RepAcercamientosEtapas(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, + cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1, Optional EnPausa As Integer = -1, Optional CveEtapaProceso As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAcercamientosEtapas", CommandType.StoredProcedure) @@ -1046,6 +1053,13 @@ Public Class ClsCRM .Add("@CveProbabilidadAcercamiento", SqlDbType.Int).Value = cveProbabilidadAcercamiento .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion + + .Add("@EnPausa", SqlDbType.Int).Value = EnPausa + .Add("@CveEtapaProcesoFiltro", SqlDbType.Int).Value = CveEtapaProceso '@CveEtapaProcesoFiltro + '.Add("@CveMedioCaptacion", SqlDbType.Int).Value = cveMedioCaptacion + '.Add("@CveTipoProceso", SqlDbType.Int).Value = cveTipoProceso + + End With Try SqlAdapter.Fill(DSet) @@ -1056,7 +1070,8 @@ Public Class ClsCRM Return retorno End Function - Public Function RepAcercamientosRechazos(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1) As Boolean + Public Function RepAcercamientosRechazos(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, + cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1, Optional EnPausa As Integer = -1, Optional CveEtapaProceso As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAcercamientosRechazos", CommandType.StoredProcedure) @@ -1072,6 +1087,10 @@ Public Class ClsCRM .Add("@CveProbabilidadAcercamiento", SqlDbType.Int).Value = cveProbabilidadAcercamiento .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion + + .Add("@EnPausa", SqlDbType.Int).Value = EnPausa + .Add("@CveEtapaProcesoFiltro", SqlDbType.Int).Value = CveEtapaProceso + End With Try SqlAdapter.Fill(DSet) diff --git a/Bin/ADSNetLibrary.7z b/Bin/ADSNetLibrary.7z new file mode 100644 index 000000000..91e95b751 Binary files /dev/null and b/Bin/ADSNetLibrary.7z differ diff --git a/Bin/ADSNetLibrary.dll b/Bin/ADSNetLibrary.dll index 8adb6bab4..71043c620 100644 Binary files a/Bin/ADSNetLibrary.dll and b/Bin/ADSNetLibrary.dll differ diff --git a/CRM/Acercamiento.aspx b/CRM/Acercamiento.aspx index 8bc859a44..eafaf2f5c 100644 --- a/CRM/Acercamiento.aspx +++ b/CRM/Acercamiento.aspx @@ -349,6 +349,7 @@ +
@@ -410,6 +411,21 @@
+ +
+ + + +
+ +
+ + + + +
+ +
@@ -494,19 +510,7 @@
-
-
- - - -
- -
- - - - -
+
<%--
@@ -521,7 +525,14 @@
-
+ +
+
+ + +
+
+
<%--END DATOS DE EMPRESA CRM --%> diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 941639121..b1778e7cd 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -334,11 +334,12 @@ public partial class CRM_Acercamiento : ClsPaginas TxtNombreAcercamiento.Text = objAcercamiento.Result[0].NombreAcercamiento; TxtDescripcion.Text = objAcercamiento.Result[0].Descripcion; TxtFechaApertura.Text = objAcercamiento.Result[0].FechaApertura.ToDateTime().ToShortDateString(); - TxtFechaCierre.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") ? "" : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString(); + TxtFechaCierre.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") || objAcercamiento.Result[0].FechaCierre.ToString().ToDate() == ModExtensiones.MinFecha ? "" : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString(); TxtImporte.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Importe.ToEntero()); TxtComision.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Comision.ToEntero()); DdlProbabilidadAcercamiento.SelectedValueExist(objAcercamiento.Result[0].CveProbabilidadAcercamiento); DdlPrioridad.SelectedValueExist(objAcercamiento.Result[0].Prioridad); + ChkePausa.Checked = objAcercamiento.Result[0].EnPausa; CargaDdl(); //SECCION DATOS DE LA EMPRESA @@ -689,6 +690,7 @@ public partial class CRM_Acercamiento : ClsPaginas AcercaminetoModel.FechaCierre = FechaCierre != null ? (DateTime)FechaCierre : ModExtensiones.MinFecha; AcercaminetoModel.CvePS = DdlPS.SelectedValue.ToEntero(); AcercaminetoModel.CveRechazoMotivo = CveRechazoMotivo; + AcercaminetoModel.EnPausa = ChkePausa.Checked; if (cRMService.AcercamientoUpdate(AcercaminetoModel)) diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index a186c7ebe..a805e84da 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -248,18 +248,25 @@
- - +   - + + +   + + + + + @@ -563,9 +570,17 @@ --%>
+ +
+ + + + +
+ + @@ -574,6 +589,73 @@ <%-- END MODAL AGREGAR CONTACTO --%> + <%-- MODAL TIPO CONTACTO --%> + + <%-- END MODAL TIPO CONTACTO --%> + + + <%-- MODAL AGREGAR ACERCAMIENTO --%> -
+
+
+
-
- - - - - +
+ + + + + +
+ + + + + +
- - - - +
+
+
+ + + + + +
+ <%----%> + + +
+
+ +
diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index b63b5860a..40ab53418 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -5,6 +5,7 @@ using ADSNetLibrary.SIGAPI.Models.Ventas.Request; using ADSNetLibrary.SIGAPI.Services; using ADSNetLibrary.SIGAPI.Services.CRM; using ADSNetLibrary.SIGAPI.Services.Encuestas; + using Extensiones; using MoreLinq; using System; @@ -938,6 +939,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas TempDTContactos.Columns.Add("FechaIng", typeof(string)); TempDTContactos.Columns.Add("CveContacto", typeof(string)); + TempDTContactos.Columns.Add("CveTipoContacto", typeof(string)); + TempDTContactos.Columns.Add("TipoContacto", typeof(string)); GVContactos.DataSource = TempDTContactos; GVContactos.DataBind(); @@ -996,6 +999,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas TxtTelefonoOficina.Text = ""; TxtCelular.Text = ""; TxtCorreo.Text = ""; + DdlTipocontacto.SelectedValueExist(-1); } protected void BtnAgregarContacto_Click(object sender, EventArgs e) @@ -1004,6 +1008,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas limpiarCamposModalContato(); UPModalContacto.Update(); + CargaGridTipoContacto(); + this.RegistraScript("$('#DivModalContacto').modal();"); } @@ -1020,11 +1026,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas TxtTelefonoOficina.Text = GvRow.DataKey("TelefonoOficina").ToString(); TxtCelular.Text = GvRow.DataKey("Celular").ToString(); TxtCorreo.Text = GvRow.DataKey("Correo").ToString(); + DdlTipocontacto.SelectedValueExist( GvRow.DataKey("CveTipoContacto").ToString()); IndexDTContacto = GvRow.RowIndex; + CargaGridTipoContacto(); + UPModalContacto.Update(); + this.RegistraScript("$('#DivModalContacto').modal();"); } @@ -1057,6 +1067,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas contacto.Correo = Correo; contacto.CveEmpresaCRM = CveEmpresaCRM; contacto.CveUsuarioIng = CveUsuarioIng; + contacto.CveTipoContacto = DdlTipocontacto.SelectedValue.ToEntero(); if (cRMService.EmpresasCRMContactoAdd(contacto)) { @@ -1088,6 +1099,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas contacto.Correo = Correo; contacto.CveContacto = CveContactoEditado; contacto.CveUsuarioIng = CveUsuarioIng; + contacto.CveTipoContacto = DdlTipocontacto.SelectedValue.ToEntero(); if (cRMService.EmpresasCRMContactoUpdate(contacto)) { @@ -1580,6 +1592,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas TxtAcercamiento.Text = ""; TxtDescripcionAcercamiento.Text = ""; TxtFechaApertura.Text = DateTime.Now.ToShortDateString(); + TxtFechaCierre.Text = ""; TxtImporte.Text = "0.00"; TxtComision.Text = "0.00"; @@ -1651,6 +1664,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas int CveRechazoMotivo = -1; DateTime FechaApertura = TxtFechaApertura.Text.ToDateTime(); + DateTime FechaCierre = TxtFechaCierre.Text.ToDateTime(); Double Importe = TxtImporte.Text.ToDouble(); Double Comision = TxtComision.Text.ToDouble(); @@ -1673,8 +1687,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveMedioCaptacion = CveMedioCaptacion, CveRechazoMotivo = CveRechazoMotivo, CveProbabilidadAcercamiento = CveProbabilidadAcercamiento, - FechaApertura = FechaApertura, - FechaCierre = (DateTime)System.Data.SqlTypes.SqlDateTime.Null, + FechaApertura = FechaApertura, + FechaCierre = FechaCierre > ModExtensiones.MinFecha ? FechaCierre : (DateTime)System.Data.SqlTypes.SqlDateTime.Null, NombreAcercamiento = NombreAcercamiento, Descripcion = Descripcion, Importe = Importe, @@ -1833,4 +1847,109 @@ public partial class CRM_EmpresaCRM : ClsPaginas DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlGiroClasificacion.SelectedValueExist(CveGiroClasificacion); } + + + #region "TIPO CONTACTO" + + + protected void LnkAgregartipoContacto_Click(object sender, EventArgs e) + { + + CargaGridTipoContacto(); + RegistraScript("$('#DivModalTipoContacto').modal('show');"); + } + + + private void LimpiaTipoContacto() + { + TxtTipoContacto.Text = ""; + UpModalTipoContacto.Update(); + } + + private void CargaGridTipoContacto() + { + DdlTipocontacto.Items.Clear(); + DdlTipocontacto.SelectedValue = null; + + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + + RequestTipoContacto requestTipoContacto = new RequestTipoContacto(-1,"-1",-1,UsuarioActual.CveEmpresa); + + var ObjTIpocontacto = cRMService.TipoContactoGet(requestTipoContacto); + + if (ObjTIpocontacto.Result.Count > 0) + { + GvModalTipoContacto.DataSource = ObjTIpocontacto.Result; + DdlTipocontacto.DataSource = ObjTIpocontacto.Result; + } + + GvModalTipoContacto.DataBind(); + + DdlTipocontacto.DataBind(); + DdlTipocontacto.Items.Insert(0, new ListItem("Seleccione Uno", "-1")); + + UpModalTipoContacto.Update(); + UPModalContacto.Update(); + + cRMService = null; + } + protected void btnAgregarTipoContacto_Click(object sender, EventArgs e) + { + bool ErrorProceso = false; + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + + TipoContactoModel TipoContacto = new TipoContactoModel(); + + TipoContacto.TipoContacto = TxtTipoContacto.Text; + TipoContacto.CveUsuario = UsuarioActual.CveUsuario; + TipoContacto.CveEmpresa = UsuarioActual.CveEmpresa; + + if (!cRMService.TipoContactoAdd(TipoContacto)) + { + Alert("Se presento un error al agregar el tipo de contacto", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + + if (!ErrorProceso) + { + CargaGridTipoContacto(); + LimpiaTipoContacto(); + } + } + + protected void LnkEliminarTipoContacto_Click(object sender, EventArgs e) + { + bool ErrorProceso = false; + + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + + int CveTipoContactoEliminar = GvRow.DataKey("CveTipoContacto").ToEntero(); + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + + TipoContactoModel TipoContacto = new TipoContactoModel(); + TipoContacto.CveTipoContacto = CveTipoContactoEliminar; + TipoContacto.CveEmpresa = UsuarioActual.CveEmpresa; + + if (cRMService.TipoContactoRemove(TipoContacto)) + { + Alert("Tipo Contacto eliminado correctamente."); + }else{ + Alert("Se presento un error al eliminar el tipo de contacto.", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + + if (!ErrorProceso) + { + CargaGridTipoContacto(); + } + + } + + #endregion + + + + + } \ No newline at end of file diff --git a/CRM/RepAcercamientos.aspx b/CRM/RepAcercamientos.aspx index f3f14be4a..0fab43eb1 100644 --- a/CRM/RepAcercamientos.aspx +++ b/CRM/RepAcercamientos.aspx @@ -30,7 +30,7 @@ -
+
@@ -39,14 +39,14 @@
- -
+ +
- -
-
+ +
+
@@ -56,9 +56,9 @@
- -
-
+ +
+
@@ -68,8 +68,8 @@
- -
+ +
@@ -80,10 +80,40 @@
diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs index 07844b84b..d94cf2787 100644 --- a/CRM/RepAcercamientos.aspx.cs +++ b/CRM/RepAcercamientos.aspx.cs @@ -8,6 +8,10 @@ using Extensiones; using System.Data; using Microsoft.Reporting.WebForms; +using ADSNetLibrary.SIGAPI.Services.CRM; +using ADSNetLibrary.SIGAPI.Models.CRM.Request; +//using ADSNetLibrary.SIGAPI.Helpers; + public partial class CRM_RepAcercamientos : ClsPaginas { #region "PROPIEDADES" @@ -58,8 +62,12 @@ public partial class CRM_RepAcercamientos : ClsPaginas string FechaInicio = TxtFechaInicio.Text == "" ? "-1" : TxtFechaInicio.Text; string FechaFin = TxtFechaFin.Text == "" ? "-1" : TxtFechaFin.Text; int CvePS = DdlPS.SelectedValue.ToEntero() == 0 ? -1 : DdlPS.SelectedValue.ToEntero(); + ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) + + if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, + CveGiroClasificacion: DdlGiroClasificacion.SelectedValue.ToEntero(), CveMedioCaptacion: DdlMedioCaptacion.SelectedValue.ToEntero(), CveTipoProceso: DdlTipoProceso.SelectedValue.ToEntero(), + EnPausa: DdlEnPausa.SelectedValue.ToEntero(), CveEtapaProceso: DdlEtapaProceso.SelectedValue.ToEntero())) { GVDatos.DataSource = ObjCRM.DtResultados; DtDatos = ObjCRM.DtResultados; @@ -100,6 +108,23 @@ public partial class CRM_RepAcercamientos : ClsPaginas DdlGiroClasificacion.DataSource = dtGiroClasificaciones; DdlGiroClasificacion.DataBind(); DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, -1); + RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa); + RequestTipoProceso tipoProceso = new RequestTipoProceso(UsuarioActual.CveEmpresa, 1, -1); + + DdlEtapaProceso .DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetEtapaProcesoCRM(EtapaProceso).Result); + DdlMedioCaptacion.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable( cRMService.GetMedioCaptacionCRM(MedioCaptacion).Result); + DdlTipoProceso.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetTipoProcesoCRM(tipoProceso).Result); + + DdlEtapaProceso.DataBind(); + DdlMedioCaptacion.DataBind(); + DdlTipoProceso.DataBind(); + + DdlEtapaProceso.Items.Insert(0,new ListItem("Todas", "-1")); + DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos", "-1")); + DdlTipoProceso.Items.Insert(0, new ListItem("Todos", "-1")); } #endregion diff --git a/CRM/RepAcercamientosProcesos.aspx b/CRM/RepAcercamientosProcesos.aspx index 7e1ca826a..92527d994 100644 --- a/CRM/RepAcercamientosProcesos.aspx +++ b/CRM/RepAcercamientosProcesos.aspx @@ -58,7 +58,7 @@ -
+
@@ -66,23 +66,23 @@
- -
+ +
- -
+ +
- -
+ +
- -
+ +
@@ -90,8 +90,9 @@