Crm hasta punto de Reportes
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user