Mejoras CRM
This commit is contained in:
@@ -176,59 +176,62 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas
|
||||
string Correo = row["Correo"].ToString();
|
||||
|
||||
int CveMedioCaptacion = -1;
|
||||
if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DataRow MediosCaptacion = ObjCRM.DtResultados.FiltroPrimero(String.Format("MedioCaptacion = '{0}'",MedioCaptacion));
|
||||
if(MediosCaptacion != null)
|
||||
if (MedioCaptacion != "" || Agente != "") {
|
||||
|
||||
if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CveMedioCaptacion = MediosCaptacion["CveMedioCaptacion"].ToString().ToEntero();
|
||||
DataRow MediosCaptacion = ObjCRM.DtResultados.FiltroPrimero(String.Format("MedioCaptacion = '{0}'",MedioCaptacion));
|
||||
if(MediosCaptacion != null)
|
||||
{
|
||||
CveMedioCaptacion = MediosCaptacion["CveMedioCaptacion"].ToString().ToEntero();
|
||||
}else
|
||||
{
|
||||
Alert(String.Format("El medio de captación '{0}' no fue encontrado", MedioCaptacion), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CveVendedor = -1;
|
||||
DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("Vendedor = '{0}'",Agente));
|
||||
if (Vendedor != null)
|
||||
{
|
||||
CveVendedor = Vendedor["CveVendedor"].ToString().ToEntero();
|
||||
}else
|
||||
{
|
||||
Alert(String.Format("El medio de captación '{0}' no fue encontrado", MedioCaptacion), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
Alert(String.Format("El vendedor '{0}' no fue encontrado", Agente), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CveVendedor = -1;
|
||||
DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("Vendedor = '{0}'",Agente));
|
||||
if (Vendedor != null)
|
||||
{
|
||||
CveVendedor = Vendedor["CveVendedor"].ToString().ToEntero();
|
||||
}else
|
||||
{
|
||||
Alert(String.Format("El vendedor '{0}' no fue encontrado", MedioCaptacion), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
int CveSubProyecto = -1;
|
||||
DataRow SubProyecto = get_GlobalDTSubProyectos(-1,CveEmpresa:UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("SubProyecto = '{0}'",Sucursal));
|
||||
if(SubProyecto != null)
|
||||
{
|
||||
CveSubProyecto = SubProyecto["CveSubProyecto"].ToString().ToEntero();
|
||||
}else
|
||||
{
|
||||
Alert(String.Format("El SubProyecto '{0}'", Sucursal), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
int CveSubProyecto = -1;
|
||||
DataRow SubProyecto = get_GlobalDTSubProyectos(-1,CveEmpresa:UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("SubProyecto = '{0}'",Sucursal));
|
||||
if(SubProyecto != null)
|
||||
{
|
||||
CveSubProyecto = SubProyecto["CveSubProyecto"].ToString().ToEntero();
|
||||
}else
|
||||
{
|
||||
Alert(String.Format("El SubProyecto '{0}'", Sucursal), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
int CveGiro = -1;
|
||||
DataRow GiroDt = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("ClienteClasificacion = '{0}'", Giro));
|
||||
if (GiroDt != null)
|
||||
{
|
||||
CveGiro = GiroDt["CveClienteClasificacion"].ToString().ToEntero();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert(String.Format("El Giro de Empresa '{0}', No está especificado", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
int CveGiro = -1;
|
||||
DataRow GiroDt = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("ClienteClasificacion = '{0}'", Giro));
|
||||
if (GiroDt != null)
|
||||
{
|
||||
CveGiro = GiroDt["CveClienteClasificacion"].ToString().ToEntero();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert(String.Format("El Giro de Empresa '{0}', No está especificado", Giro), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
TieneError = (!(ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, -1, CveVendedor, CveSubProyecto, Mail, CveGiro) > 0));
|
||||
TieneError = (!(ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, -1, CveVendedor, CveSubProyecto, Mail, CveGiro) > 0));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (TieneError)
|
||||
|
||||
Reference in New Issue
Block a user