Exemple #1
0
        public void PruebaVerificarRespuesta(int idPregunta, string respuesta)
        {
            Interaccion Interaccion1 = Substitute.For <Interaccion>();

            Interaccion1.leerArchivo("C:\\Temp\\preguntas.csv");
            Assert.IsTrue(Interaccion1.verificarRespuesta(idPregunta, respuesta));
        }
Exemple #2
0
        public void PruebaPuntajeFinal_Mas4_Retorna4()
        {
            Interaccion interaccion = new Interaccion();

            interaccion.PUNTUACION_FINAL += 4;
            Assert.AreEqual(interaccion.PUNTUACION_FINAL, 4);
        }
Exemple #3
0
        public static void SetTipoInteraccion(Interaccion interaccion, Enums.eTipoInteraccion tipoInteraccion)
        {
            TipoInteraccion tipo = TipoInteraccion.FindByPrimaryKey((int)tipoInteraccion);

            interaccion.TipoInteraccion_CodigoSAP    = tipo.CodigoSAP;
            interaccion.TipoInteraccion_CategoriaSAP = tipo.CategoriaSAP;
        }
Exemple #4
0
 public static Enums.eTipoInteraccion GetTipoInteraccion(Interaccion interaccion)
 {
     //if(interaccion.TipoInteraccion_CodigoSAP == Constants.)
     //TipoInteraccion tipo = TipoInteraccion.FindByPrimaryKey((int)tipoInteraccion);
     //interaccion.TipoInteraccion_CodigoSAP = tipo.CodigoSAP;
     //interaccion.TipoInteraccion_CategoriaSAP = tipo.CategoriaSAP;
     return(Enums.eTipoInteraccion.TareaCliente);
 }
Exemple #5
0
        private void loadMonthData(DateTime date, bool loadSidesMonths)
        {
            DateTime monthStart = new DateTime(date.Year, date.Month, 1);
            DateTime monthEnd   = new DateTime(date.Year, date.Month, 1).AddMonths(1);

            if (loadSidesMonths)
            {
                AppointmentsMes.Clear();
            }
            //AppointmentsMes = new ObservableCollection<Appointment>();

            // Por cada dia del mes
            for (DateTime d = monthStart; d < monthEnd; d = d.AddDays(1))
            {
                // Por cada tipo de interaccion
                foreach (var enumValue in Enum.GetValues(typeof(Enums.eTipoInteraccion)))
                {
                    Enums.eTipoInteraccion tipoInteraccion = (Enums.eTipoInteraccion)enumValue;
                    int count = 0;
                    switch (tipoInteraccion)
                    {
                    case Enums.eTipoInteraccion.VisitaRRCC:
                        count = Interaccion.FindVisitaRRCCByDate(d, App.Locator.SessionStatic.RepresentanteComercial.CodigoInterlocutor).Count;
                        break;

                    case Enums.eTipoInteraccion.TareaRRCC:
                        count = Interaccion.FindTareaRRCCByDate(d, App.Locator.SessionStatic.RepresentanteComercial.CodigoInterlocutor).Count;
                        break;

                    case Enums.eTipoInteraccion.TareaCliente:
                        count = Interaccion.FindTareaClienteByDate(d, App.Locator.SessionStatic.RepresentanteComercial.CodigoInterlocutor).Count;
                        break;

                    default:
                        break;
                    }

                    if (count <= 0)
                    {
                        continue;
                    }


                    // Se agrega una cita en el calendario con la cantidad de interacciones por tipo
                    addAppointment(d, (int)tipoInteraccion, count);
                }
            }

            //if (loadSidesMonths)
            //{
            //    // Carga asincronica del mes anterior
            //    DispatcherHelper.UIDispatcher.InvokeAsync(() => { loadMonthData(date.AddMonths(-1), false); });
            //    // Carga asincronica del mes siguiente
            //    DispatcherHelper.UIDispatcher.InvokeAsync(() => { loadMonthData(date.AddMonths(1), false); });
            //}
        }
Exemple #6
0
        public void PruebaVerificarMostrarSiguientePregunta()
        {
            Interaccion Interaccion1 = Substitute.For <Interaccion>();

            Interaccion1.leerArchivo("C:\\Temp\\preguntas.csv");
            Interaccion1.asignarPreguntasRandom(5);
            string pregunta = Interaccion1.mostrarSiguientePregunta();

            Assert.IsNotEmpty(pregunta);
        }
Exemple #7
0
        public void PruebaVerificarDecrementoPuntaje()
        {
            Interaccion         Interaccion = new Interaccion();
            EstructuraRespuesta respuesta   = new EstructuraRespuesta("respuesta", "distractor", "distractor", "distractor");
            EstructuraPregunta  pregunta    = new EstructuraPregunta(1, "Pregunta 1", 1, respuesta);

            Run.Instance.PreguntasCargadas.Add(pregunta);
            Interaccion.cambiarPuntaje(1, "distractor");
            Assert.Equals(Interaccion.PUNTUACION_FINAL, 0);
        }
Exemple #8
0
        static void Main(string[] args)
        {
            Interaccion i = new Interaccion();

            i.leerArchivo("C:\\Temp\\preguntas.csv");
            i.asignarPreguntasRandom(5);
            i.mostrarRespuestas(14);
            i.mostrarRespuestas(16);
            i.mostrarRespuestas(19);
        }
        protected static void Execute(DireccionEntregaModel dirEntrega)
        {
            Interaccion newInteraccion = new Interaccion();

            InteraccionBusiness.InitializeNewInteraccion(newInteraccion, Enums.eTipoInteraccion.TareaCliente, dirEntrega);
            App.Locator.InteraccionViewModelStatic.InteraccionActual = InteraccionModel <InteraccionBusiness> .Create(newInteraccion);

            MainViewModel.MainViewModelMsg.Send(new MainViewModel.MainViewModelMsg(MainViewModel.eMainViewModelMsg.CollapseLeftPanel));
            NavigationHelper.Navigate <InteraccionView>();
        }
        protected static void Execute()
        {
            Interaccion newInteraccion = new Interaccion();

            InteraccionBusiness.InitializeNewInteraccion(newInteraccion, Enums.eTipoInteraccion.TareaRRCC);
            App.Locator.InteraccionViewModelStatic.InteraccionActual = InteraccionModel <InteraccionBusiness> .Create(newInteraccion);

            var list = TipoInteraccion.FindAll();

            MainViewModel.MainViewModelMsg.Send(new MainViewModel.MainViewModelMsg(MainViewModel.eMainViewModelMsg.CollapseLeftPanel));
            NavigationHelper.Navigate <InteraccionView>();
        }
Exemple #11
0
        public async Task <string> Post()
        {
            RESPUESTA_HTTP = await PETICION_HTTP.PostAsync(URL + DIRECTORIO_API, ContenidoHttp(this));

            if (RESPUESTA_HTTP.IsSuccessStatusCode)
            {
                return(null);
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, REQUEST_ISSUES)));
            }
        }
        public async Task <string> Delete()
        {
            RESPUESTA_HTTP = await PETICION_HTTP.DeleteAsync(URL + DIRECTORIO_API + "/" + id);

            if (RESPUESTA_HTTP.IsSuccessStatusCode)
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(true, "Oferta de trabajo Eliminada con Exito !")));
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, REQUEST_ISSUES)));
            }
        }
        public async Task <string> Put()
        {
            RESPUESTA_HTTP = await PETICION_HTTP.PutAsync(URL + DIRECTORIO_API, ContenidoHttp(this));

            if (RESPUESTA_HTTP.IsSuccessStatusCode)
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(true, "Oferta de trabajo Actualizada con Exito !")));
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, REQUEST_ISSUES)));
            }
        }
Exemple #14
0
        public void LoadLeftPanelData()
        {
            _loadingLeftPanelData = true;
            string codInterlocutor = App.Locator.SessionStatic.RepresentanteComercial.CodigoInterlocutor;

            Visitas            = new InteraccionModelCollection(Interaccion.FindVisitaRRCCByDate(FechaSeleccionada, codInterlocutor));
            VisitaSeleccionada = null;

            TareasRRCC            = new InteraccionModelCollection(Interaccion.FindTareaRRCCByDate(FechaSeleccionada, codInterlocutor));
            TareaRRCCSeleccionada = null;

            TareasCliente            = new InteraccionModelCollection(Interaccion.FindTareaClienteByDate(FechaSeleccionada, codInterlocutor));
            TareaClienteSeleccionada = null;

            _loadingLeftPanelData = false;
        }
Exemple #15
0
    public void OnTriggerEnter(Collider collider)
    {
        switch (collider.name)
        {
        case "Button_Exit":
        {
            objetoSelec = null;
            if (seleccionado == true)
            {
                DestruirArchivoActual(ref temp_file);
                seleccionado = false;
                Interaccion.ModificarComponentesCanvas(true, ref canvasMenuPrincipal);          // Reactivo el canvas de Seleccion de Objeto
            }
            else
            {
                if (Interaccion.dedos.Extended().Count == 0)
                {
                    SceneManager.LoadScene(7);
                }
            }
        }
        break;

        case "Button_ZoomIn":
            ZoomIn();
            break;

        case "Button_ZoomOut":
            ZoomOut();
            break;

        case "Character":
        case "Car":
        case "Starship":
        case "Wall E":
        {
            if (!seleccionado)
            {
                Interaccion.ModificarComponentesCanvas(false, ref canvasMenuPrincipal);         // Desactivo el canvas de Seleccion de Objeto
                objetoSelec = collider.name;
            }
        }
        break;
        }
    }
Exemple #16
0
        public async Task <string> TryLogin()
        {
            var lst = await Get();

            int idUsuario = lst.ToList().
                            Where(x => x.Username == Username && x.Contraseña == Contraseña).
                            Select(x => x.ID).FirstOrDefault();

            if (idUsuario != 0 && idUsuario.ToString() != null)
            {
                return(Interaccion.Redireccion("PosterDashboard", idUsuario));
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, "Username o Contraseña Incorrecta")));
            }
        }
        public void interactionManager_InteractionEvent(object sender, EventArgs <IInteraction> e)
        {
            var datosInteraccion        = new Interaccion();
            var interaccionActiva       = e.Value;
            var ultimoEventoInteraccion = interaccionActiva.EntrepriseLastInteractionEvent;
            var tipoInteraccion         = interaccionActiva.Type;

            switch (tipoInteraccion)
            {
            case "InteractionVoice":
                ConvierteClase(ultimoEventoInteraccion.Id, ultimoEventoInteraccion, interaccionActiva);
                _metodos.InsertaRegistroMarkDoneModule(interaccionActiva);
                break;

            case "InteractionPullPreview":
            case "InteractionPushPreview":
                ConvierteClaseCampana(interaccionActiva);
                _metodos.InsertaRegistroMarkDoneModule(interaccionActiva);
                break;

            case "InteractionWorkItem":
                break;

            case "InteractionChat":
                break;

            case "InteractionCallback":
                ConvierteClase(ultimoEventoInteraccion.Id, ultimoEventoInteraccion, interaccionActiva);
                _metodos.InsertaRegistroMarkDoneModule(interaccionActiva);
                break;

            case "InteractionInboundEmail":
                break;

            case "InteractionOutboundEmail":
                break;

            case "whatsappsession":
                break;
            }
        }
        protected static void Execute(InteraccionModel interaccion)
        {
            // Creates a copy to not edit the interaction passed as parameter.
            Interaccion supEntityClone = new Interaccion();

            supEntityClone.CopyAll(interaccion.SUPEntity);

            InteraccionModel <InteraccionBusiness> newInteraccion = InteraccionModel <InteraccionBusiness> .Create(supEntityClone);

            App.Locator.InteraccionViewModelStatic.InteraccionActual = newInteraccion;

            // Clear selection of the left panel.
            NavigationHelper.Navigate <InteraccionView>();
            DispatcherHelper.UIDispatcher.InvokeAsync(() => {
                App.Locator.MainViewModelStatic.VisitaSeleccionada       = null;
                App.Locator.MainViewModelStatic.TareaRRCCSeleccionada    = null;
                App.Locator.MainViewModelStatic.TareaClienteSeleccionada = null;
            });

            MainViewModel.MainViewModelMsg.Send(new MainViewModel.MainViewModelMsg(MainViewModel.eMainViewModelMsg.CollapseLeftPanel));
        }
Exemple #19
0
        public static void InitializeNewInteraccion(Interaccion interaccion, Enums.eTipoInteraccion tipoInteraccion, DireccionEntregaModel dirEntrega = null)
        {
            DateTime fecha = App.Locator.MainViewModelStatic.FechaSeleccionada;

            if (interaccion.IsNew)
            {
                interaccion.IdInteraccion = ModelHelper.GetGUID();
                interaccion.RepresentanteComercial_CodigoInterlocutor = Session.RepresentanteComercialStatic.CodigoInterlocutor;
                interaccion.Responsable_CodigoInterlocutor            = Session.RepresentanteComercialStatic.CodigoInterlocutor;
                interaccion.EstadoInteraccion_CodigoSAP = Constants.EstadoInteraccionCodigoSAP.PENDIENTE;

                interaccion.FechaInicioPlanificada = ModelHelper.DateTime_ToDate(fecha);
                interaccion.HoraInicioPlanificada  = ModelHelper.DateTime_ToTime(fecha);
                interaccion.FechaFinPlanificada    = ModelHelper.DateTime_ToDate(fecha);
                interaccion.HoraFinPlanificada     = ModelHelper.DateTime_ToTime(fecha);

                if (dirEntrega != null)
                {
                    interaccion.IdDireccionEntrega = dirEntrega.IdDireccionEntrega;
                }
                InteraccionBusiness.SetTipoInteraccion(interaccion, tipoInteraccion);
            }
        }
Exemple #20
0
        public ActionResult Whatsapp(int id)
        {
            Interaccion interaccion = new Interaccion();

            try
            {
                ViewBag.ID = id;

                ViewBag.botonDisabled = "disabled";

                // subcanals
                ViewBag.SubCanalId = new SelectList(db.SubCanales.OrderBy(w => w.SubCanalNombre), "SubCanalId", "SubCanalNombre");

                // Desarrollo
                ViewBag.DesarrolloId = new SelectList(db.Desarrollo.OrderBy(w => w.DesarrolloNombre), "DesarrolloId", "DesarrolloNombre");

                // Modelo
                ViewBag.DesarrolloModeloId = new SelectList(db.DesarrolloModelo.OrderBy(w => w.DesarrolloModeloNombre), "DesarrolloModeloId", "DesarrolloModeloNombre");

                // Causa no Interesado
                ViewBag.CausaNoInterId = new SelectList(db.CausaNoInter.OrderBy(w => w.CausaNoInterNombre), "CausaNoInterId", "CausaNoInterNombre");


                // estatus
                ViewBag.EstatusBIDAId = new SelectList(db.View_EstatusBida_Whatsapp.OrderBy(w => w.EstatusBidaNombre), "EstatusBIDAId", "EstatusNombre");



                // Lee datos del CONTACTO
                int Desarrollo_Id = 0;
                int subCanalId    = 0;

                var DatLead = from x in db.View_Datos_Contacto
                              where x.ContactoId == id
                              select x;
                int EstatusBIDA = 0;

                foreach (var item in DatLead)
                {
                    interaccion.id = id;
                    interaccion.NombreContactoCompleto = item.NombreContacto + " " + item.Apellidos;
                    EstatusBIDA   = item.EstatusBIDA;
                    Desarrollo_Id = item.DesarrolloId;
                    subCanalId    = item.SubCanalId;
                }

                ViewBag.Desarrollo_Id = Desarrollo_Id;
                ViewBag.Subcanal      = subCanalId;



                if (EstatusBIDA == 5)
                {
                    ViewBag.botonDisabled = string.Empty;
                }


                ViewBag.ContactoNombre = interaccion.NombreContactoCompleto;
                ViewBag.EstatusBida    = EstatusBIDA;

                // Lee datos reales del Lead
                var datReal = from x in db.DatosReales
                              where x.ContactoId == id
                              select x;
                foreach (var item in datReal)
                {
                    interaccion.NombreReal          = item.Nombre;
                    interaccion.ApellidoPaternoReal = item.ApellidoPaterno;
                    interaccion.ApellidoMaternoReal = item.ApellidoMaterno;
                    interaccion.TelefonoReal        = item.Telefono;
                    interaccion.CorreoReal          = item.Correo;
                }


                // lee interaccion final
                var interacc = db.Interacciones.OrderByDescending(w => w.InteraccionId).FirstOrDefault(w => w.ContactoId == id);

                if (interacc != null)
                {
                    interaccion.Descripcion         = interacc.Descripcion;
                    interaccion.ResumenConversacion = interacc.Comentarios;
                }
            }
            catch (Exception ex)
            {
            }
            return(View(interaccion));
        }
        public ActionResult Interaccion(Interaccion modelo, int SubCanalIdH, int numTab = 0)
        {
            try
            {
                int DatosReales = 0;
                DatosReales = db.DatosReales.Where(w => w.ContactoId == modelo.id).Count();

                var contac           = db.View_Lista_Contactos.Where(w => w.ContactoId == modelo.id).FirstOrDefault();
                int StatusBIDAActual = contac.EstatusBIDA;

                string Usuario_ID = Session["Usuario_ID"].ToString();

                Interacciones interacciones = new Interacciones();

                interacciones.ContactoId    = modelo.id;
                interacciones.SubCanalId    = SubCanalIdH;
                interacciones.UsuarioHOST   = Usuario_ID;
                interacciones.EstatusBIDAId = 5;

                if ((StatusBIDAActual == 1) && (DatosReales > 0))
                {
                    interacciones.EstatusBIDAId = 5;

                    // actualliza estatusbida en contactos
                    var contacto1 = db.Contactos.Where(w => w.ContactoId == modelo.id).FirstOrDefault();
                    contacto1.EstatusBIDA = 5;
                    db.SaveChanges();
                }
                else if ((StatusBIDAActual == 1) && (DatosReales == 0))
                {
                    interacciones.EstatusBIDAId = 2;
                    // actualliza estatusbida en contactos
                    var contacto1 = db.Contactos.Where(w => w.ContactoId == modelo.id).FirstOrDefault();
                    contacto1.EstatusBIDA = 2;
                    db.SaveChanges();
                }

                interacciones.FechaInteraccion = DateTime.Now;
                interacciones.Descripcion      = modelo.Descripcion;
                interacciones.Comentarios      = modelo.ResumenConversacion;
                interacciones.Interes          = false;

                if (numTab == 2)
                {
                    interacciones.CausaNoInterId      = modelo.CausaNoInterId;
                    interacciones.ComentarioNoInteres = modelo.ComentariosNoIntetres;
                    interacciones.EstatusBIDAId       = 4;


                    // actualliza estatusbida en contactos
                    var contacto1 = db.Contactos.Where(w => w.ContactoId == modelo.id).FirstOrDefault();
                    contacto1.EstatusBIDA = 4;
                    db.SaveChanges();
                }

                if (numTab == 3)
                {
                    // actualliza estatusbida en contactos
                    var contacto1 = db.Contactos.Where(w => w.ContactoId == modelo.id).FirstOrDefault();
                    contacto1.EstatusBIDA = 4;
                    db.SaveChanges();
                }

                if (numTab == 4)
                {
                    // actualliza estatusbida en contactos
                    var contacto1 = db.Contactos.Where(w => w.ContactoId == modelo.id).FirstOrDefault();
                    contacto1.EstatusBIDA = 3;
                    db.SaveChanges();
                }


                db.Interacciones.Add(interacciones);
                db.SaveChanges();

                // ejecuta el store procedure sp_SiguienteInteraccion
                string   ConStr  = WebConfigurationManager.ConnectionStrings["ConStr"].ToString();
                ADO_Core adoC    = new ADO_Core(ConStr);
                string   mensaje = string.Empty;

                string sqlStr = String.Format("Exec sp_SiguienteInteraccion {0}, {1}", modelo.id, 0);

                SqlDataReader dr = adoC.GetDataReader(sqlStr);
                if (dr.HasRows)
                {
                    dr.Read();
                    mensaje = dr["Mensaje"].ToString();
                }

                adoC.Dispose();
                adoC = null;



                // liberar contacto
                var rcont = db.Contactos.Where(w => w.ContactoId == modelo.id).FirstOrDefault();
                rcont.UsuarioHOST = null;
                db.SaveChanges();



                ViewBag.botonDisabled = string.Empty;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(RedirectToAction("Interaccion", "Host", new { id = modelo.id }));
        }
        public ActionResult InteraccionTelefono(int id, string back)
        {
            Interaccion interaccion = new Interaccion();

            try
            {
                ViewBag.ID                 = id;
                ViewBag.Regreso            = back;
                ViewBag.botonDisabled      = "disabled";
                ViewBag.DesarrolloIdAsigna = new SelectList(db.Desarrollo.OrderBy(w => w.DesarrolloNombre), "DesarrolloId", "DesarrolloNombre");

                // subcanals
                ViewBag.SubCanalId        = new SelectList(db.SubCanales.OrderBy(w => w.SubCanalNombre), "SubCanalId", "SubCanalNombre");
                ViewBag.SubCanalIdAcuerdo = new SelectList(db.SubCanales.OrderBy(w => w.SubCanalNombre), "SubCanalId", "SubCanalNombre");

                // Desarrollo
                ViewBag.DesarrolloId = new SelectList(db.Desarrollo.OrderBy(w => w.DesarrolloNombre), "DesarrolloId", "DesarrolloNombre");

                // Modelo
                ViewBag.DesarrolloModeloId = new SelectList(db.DesarrolloModelo.OrderBy(w => w.DesarrolloModeloNombre), "DesarrolloModeloId", "DesarrolloModeloNombre");

                // Causa no Interesado
                ViewBag.CausaNoInterId = new SelectList(db.CausaNoInter.OrderBy(w => w.CausaNoInterNombre), "CausaNoInterId", "CausaNoInterNombre");


                // Lee datos del CONTACTO
                int Desarrollo_Id = 0;
                int subCanalId    = 0;

                var DatLead = from x in db.View_Datos_Contacto
                              where x.ContactoId == id
                              select x;
                int EstatusBIDA = 0;

                foreach (var item in DatLead)
                {
                    interaccion.id = id;
                    interaccion.NombreContactoCompleto = item.NombreContacto + " " + item.Apellidos;
                    EstatusBIDA   = item.EstatusBIDA;
                    Desarrollo_Id = item.DesarrolloId;
                    subCanalId    = item.SubCanalId;
                }

                ViewBag.Desarrollo_Id = Desarrollo_Id;
                ViewBag.Subcanal      = subCanalId;



                if (EstatusBIDA == 5)
                {
                    ViewBag.botonDisabled = string.Empty;
                }


                ViewBag.ContactoNombre = interaccion.NombreContactoCompleto;
                ViewBag.EstatusBida    = EstatusBIDA;

                // Lee datos reales del Lead
                var datReal = from x in db.DatosReales
                              where x.ContactoId == id
                              select x;
                foreach (var item in datReal)
                {
                    interaccion.NombreReal          = item.Nombre;
                    interaccion.ApellidoPaternoReal = item.ApellidoPaterno;
                    interaccion.ApellidoMaternoReal = item.ApellidoMaterno;
                    interaccion.TelefonoReal        = item.Telefono;
                    interaccion.CorreoReal          = item.Correo;
                }


                // lee interaccion final
                var interacc = db.Interacciones.OrderByDescending(w => w.InteraccionId).FirstOrDefault(w => w.ContactoId == id);

                var IdInteraccion = 0;

                if (interacc != null)
                {
                    IdInteraccion                   = interacc.InteraccionId;
                    interaccion.Descripcion         = interacc.Descripcion;
                    interaccion.ResumenConversacion = interacc.Comentarios;

                    // ejecuta la siguiente interaccion
                    string   conStr    = WebConfigurationManager.ConnectionStrings["ConStr"].ToString();
                    ADO_Core AdoC      = new ADO_Core(conStr);
                    string   stringCmd = string.Format("Exec sp_SiguienteInteraccion {0}, {1}", id, IdInteraccion);

                    string        Mensaje = string.Empty;
                    SqlDataReader dr      = AdoC.GetDataReader(stringCmd);
                    if (dr.HasRows)
                    {
                        dr.Read();
                        Mensaje = dr["mensaje"].ToString();
                    }
                    AdoC.Dispose();


                    ViewBag.SiguienteInteraccion = Mensaje;
                }
            }
            catch (Exception ex)
            {
            }

            return(View(interaccion));
        }
        public ActionResult Interactuar_ni(int id, int pSubCanalId, string pSubCanal)
        {
            // pagina de regreso
            // ViewBag.Regreso = back;

            ViewBag.MedioDeContacto = pSubCanal;
            ViewBag.SubCanal_ID     = pSubCanalId;


            ViewBag.DisableWhatsApp = "disabled='disabled'";
            if (pSubCanalId == 1)
            {
                ViewBag.DisableWhatsApp = "";
            }


            ViewBag.SubCanalx = 1; // whatsapp

            //if (tel == 1)
            //    ViewBag.SubCanalx = 2; // Telefono


            // id = InteraccionId
            ViewBag.ID = id;

            ViewBag.botonDisabled = "disabled";

            // subcanals
            ViewBag.SubCanalId = new SelectList(db.SubCanales.Where(w => w.CanalId == 1).OrderBy(w => w.SubCanalNombre), "SubCanalId", "SubCanalNombre", pSubCanalId);



            // Causa no Interesado
            ViewBag.CausaNoInterId = new SelectList(db.CausaNoInter.OrderBy(w => w.CausaNoInterNombre), "CausaNoInterId", "CausaNoInterNombre");



            // causa no interes
            ViewBag.CausaNoInterId = new SelectList(db.CausaNoInter.OrderBy(w => w.CausaNoInterNombre), "CausaNoInterId", "CausaNoInterNombre");



            ViewBag.Telefono = 0;
            //if(tel == 1)
            //    ViewBag.Telefono = 1;



            // Lee datos del CONTACTO
            int Desarrollo_Id = 0;
            int subCanalId    = 0;
            int contactoId    = 0;

            // obtenet el contactoId
            // var contactId = db.InteraccionesContacto.Where(w => w.ContactoId == id).FirstOrDefault();
            var contactId = db.Contactos.Where(w => w.ContactoId == id).FirstOrDefault();

            contactoId = contactId.ContactoId;

            Interaccion interaccion = new Interaccion();

            var DatLead = from x in db.View_Datos_Contacto
                          where x.ContactoId == contactoId
                          select x;
            int EstatusBIDA      = 0;
            int SubEstatusBIDAId = 0;

            foreach (var item in DatLead)
            {
                interaccion.id = id;
                interaccion.NombreContactoCompleto = item.NombreContacto + " " + item.Apellidos;
                EstatusBIDA      = item.EstatusBIDA;
                Desarrollo_Id    = item.DesarrolloId;
                subCanalId       = item.SubCanalId;
                SubEstatusBIDAId = (int)item.SubEstatusBIDAId;
            }

            ViewBag.SubEstatusBIDAId = SubEstatusBIDAId;
            ViewBag.Desarrollo_Id    = Desarrollo_Id;
            ViewBag.Subcanal         = subCanalId;



            if (EstatusBIDA == 5)
            {
                ViewBag.botonDisabled = "";
            }


            ViewBag.ContactoNombre = interaccion.NombreContactoCompleto;
            ViewBag.EstatusBida    = EstatusBIDA;

            // Lee datos reales del Lead
            var datReal = from x in db.DatosReales
                          where x.ContactoId == id
                          select x;

            foreach (var item in datReal)
            {
                interaccion.NombreReal          = item.Nombre;
                interaccion.ApellidoPaternoReal = item.ApellidoPaterno;
                interaccion.ApellidoMaternoReal = item.ApellidoMaterno;
                interaccion.TelefonoReal        = item.Telefono;
                interaccion.CorreoReal          = item.Correo;
            }


            // lee interaccion final
            // var interacc = db.Interacciones.OrderByDescending(w => w.InteraccionId).FirstOrDefault(w => w.ContactoId == contactoId && w.InteraccionId == id);
            var interacc = db.Interacciones.OrderByDescending(w => w.InteraccionId).FirstOrDefault(w => w.ContactoId == contactoId);

            if (interacc != null)
            {
                interaccion.Descripcion         = interacc.Descripcion;
                interaccion.ResumenConversacion = interacc.Comentarios;
            }

            // OBTIENE DATOS REALES
            ViewBag.TieneDatosRales = 0;

            var datos_reales = from x in db.DatosReales
                               where x.ContactoId == id
                               select x;

            DatosReales datReales = new DatosReales();

            foreach (var item in datos_reales)
            {
                datReales.DatosRealesId   = item.DatosRealesId;
                datReales.ContactoId      = Convert.ToInt32(item.ContactoId);
                datReales.Nombre          = item.Nombre;
                datReales.ApellidoPaterno = item.ApellidoPaterno;
                datReales.ApellidoMaterno = item.ApellidoMaterno;
                datReales.Telefono        = item.Telefono;
                datReales.Correo          = item.Correo;

                ViewBag.TieneDatosRales = 1;
            }

            ViewBag.DatosReales = datReales;

            // estatus
            ViewBag.EstatusBIDAId = new SelectList(db.EstatusBIDA.Where(w => w.EstatusBIDAId < 3).OrderBy(w => w.EstatusBidaNombre), "EstatusBIDAId", "EstatusNombre", EstatusBIDA);



            // lee datos del contacto
            var rsContacto       = db.Contactos.Where(w => w.ContactoId == id).FirstOrDefault();
            int DesarrolloID     = rsContacto.DesarrolloId;
            int DesarrolloModelo = rsContacto.DesarrolloId;


            // Desarrollo
            ViewBag.DesarrolloId = new SelectList(db.Desarrollo.OrderBy(w => w.DesarrolloNombre), "DesarrolloId", "DesarrolloNombre", DesarrolloID);

            // Modelo
            ViewBag.DesarrolloModeloId = new SelectList(db.DesarrolloModelo.OrderBy(w => w.DesarrolloModeloNombre), "DesarrolloModeloId", "DesarrolloModeloNombre", DesarrolloModelo);

            return(View(interaccion));
        }
Exemple #24
0
        public void PruebaPuntajeFinalInicial_Retorna0()
        {
            Interaccion interaccion = new Interaccion();

            Assert.AreEqual(interaccion.PUNTUACION_FINAL, 0);
        }
Exemple #25
0
        public void PruebaMostrarRespuesta_RetornaExcepcion(int numeroPregunta)
        {
            Interaccion interaccion = new Interaccion();

            Assert.Throws <ArgumentException>(() => interaccion.mostrarRespuestas(numeroPregunta));
        }
Exemple #26
0
        public ItemGenerico InsertarInteraccion(Interaccion item)
        {
            InteraccionDatos obj = new InteraccionDatos();

            return(obj.InsertarInteraccion(item));
        }
Exemple #27
0
        public ItemGenerico InsertarInteraccion(Interaccion item)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_CONTACTOBJID_1",  DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_SITEOBJID_1",     DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_ACCOUNT",         DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_PHONE",           DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_TIPO",            DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_CLASE",           DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_SUBCLASE",        DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_METODO_CONTACTO", DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_TIPO_INTER",      DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_AGENTE",          DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_USR_PROCESO",     DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_HECHO_EN_UNO",    DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_NOTAS",           DbType.String,                      4000,ParameterDirection.Input),
                new DAABRequest.Parameter("P_FLAG_CASO",       DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("P_RESULTADO",       DbType.String,                       255,ParameterDirection.Input),
                new DAABRequest.Parameter("ID_INTERACCION",    DbType.String,                       255,ParameterDirection.Output),
                new DAABRequest.Parameter("FLAG_CREACION",     DbType.String,                       255,ParameterDirection.Output),
                new DAABRequest.Parameter("MSG_TEXT",          DbType.String,                       255,ParameterDirection.Output)
            };
            for (int j = 0; j < arrParam.Length; j++)
            {
                arrParam[j].Value = System.DBNull.Value;
            }

            int i = 0;

            if (item.OBJID_CONTACTO != null)
            {
                arrParam[i].Value = Funciones.CheckInt64(item.OBJID_CONTACTO);               // P_CONTACTOBJID_1
            }
            i++;
            if (item.OBJID_SITE != null)
            {
                arrParam[i].Value = Funciones.CheckInt64(item.OBJID_SITE);               // P_SITEOBJID_1
            }
            i++;
            if (item.CUENTA != null)
            {
                arrParam[i].Value = item.CUENTA;               // P_ACCOUNT
            }
            i++;
            if (item.TELEFONO != null)
            {
                arrParam[i].Value = item.TELEFONO;               // P_PHONE
            }
            i++;
            if (item.TIPO != null)
            {
                arrParam[i].Value = item.TIPO;               // P_TIPO
            }
            i++;
            if (item.CLASE != null)
            {
                arrParam[i].Value = item.CLASE;               // P_CLASE
            }
            i++;
            if (item.SUBCLASE != null)
            {
                arrParam[i].Value = item.SUBCLASE;               // P_SUBCLASE
            }
            i++;
            if (item.METODO != null)
            {
                arrParam[i].Value = item.METODO;               // P_METODO_CONTACTO
            }
            i++;
            if (item.TIPO_INTER != null)
            {
                arrParam[i].Value = item.TIPO_INTER;               // P_TIPO_INTER
            }
            i++;
            if (item.AGENTE != null)
            {
                arrParam[i].Value = item.AGENTE;               // P_AGENTE
            }
            i++;
            if (item.USUARIO_PROCESO != null)
            {
                arrParam[i].Value = item.USUARIO_PROCESO;               // P_USR_PROCESO
            }
            i++;
            if (item.HECHO_EN_UNO != null)
            {
                arrParam[i].Value = item.HECHO_EN_UNO;                // P_HECHO_EN_UNO
            }
            i++;
            if (item.NOTAS != null)
            {
                arrParam[i].Value = item.NOTAS;                // P_NOTAS
            }
            i++;
            if (item.FLAG_CASO != null)
            {
                arrParam[i].Value = item.FLAG_CASO;                // P_FLAG_CASO
            }
            i++;
            if (item.RESULTADO != null)
            {
                arrParam[i].Value = item.RESULTADO;                // P_RESULTADO
            }
            ItemGenerico itemDatos  = new ItemGenerico();
            Clarify      objClarify = new Clarify(BaseDatos.BD_CLARIFY);
            DAABRequest  obRequest  = objClarify.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.NOMBRE_PACKAGE_INTERCCION_CLFY + ".SP_CREATE_INTERACT";
            obRequest.Parameters.AddRange(arrParam);
            obRequest.Transactional = true;
            try
            {
                obRequest.Factory.ExecuteNonQuery(ref obRequest);
                obRequest.Factory.CommitTransaction();
            }
            catch (Exception ex)
            {
                obRequest.Factory.RollBackTransaction();
                itemDatos.estado      = Funciones.CheckStr(ex.Source);
                itemDatos.Descripcion = Funciones.CheckStr(ex.Message);
            }
            finally
            {
                IDataParameter parSalida1, parSalida2, parSalida3;
                parSalida1 = (IDataParameter)obRequest.Parameters[obRequest.Parameters.Count - 3];
                parSalida2 = (IDataParameter)obRequest.Parameters[obRequest.Parameters.Count - 2];
                parSalida3 = (IDataParameter)obRequest.Parameters[obRequest.Parameters.Count - 1];
                // ItemGenerico
                itemDatos.Codigo      = Funciones.CheckStr(parSalida1.Value);
                itemDatos.estado      = Funciones.CheckStr(parSalida2.Value);
                itemDatos.Descripcion = Funciones.CheckStr(parSalida3.Value);

                obRequest.Factory.Dispose();
            }
            return(itemDatos);
        }
Exemple #28
0
        public void PruebaVerificarExtensionArchivo(string nombreArchivo)
        {
            Interaccion Interaccion1 = Substitute.For <Interaccion>();

            Assert.Throws <Exception>(() => Interaccion1.leerArchivo(nombreArchivo));
        }