Beispiel #1
0
        public int FunGetCodigoCabEstrategia(int _codigocabecera, int _codigodetalle)
        {
            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    List <SoftCob_ESTRATEGIA_DETALLE> _estdetalle = _db.SoftCob_ESTRATEGIA_DETALLE.Where(p => p.ESCA_CODIGO ==
                                                                                                         _codigocabecera && p.ESDE_CODIGO == _codigodetalle).ToList();

                    if (_estdetalle.Count > 0)
                    {
                        foreach (var _datos in _estdetalle)
                        {
                            _codigo = _datos.ESDE_CODIGO;
                        }
                    }
                    else
                    {
                        _codigo = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_codigo);
        }
Beispiel #2
0
        public string FunConsultarFonoEstado(int cedecodigo, int codpersona, string telefono)
        {
            try
            {
                using (SoftCobEntities db = new SoftCobEntities())
                {
                    List <SoftCob_TELEFONOS_CEDENTE> phone = db.SoftCob_TELEFONOS_CEDENTE.Where(o => o.tece_cedecodigo == cedecodigo &&
                                                                                                o.tece_perscodigo == codpersona && o.tece_numero == telefono && o.tece_estado == false).ToList();

                    if (phone.Count > 0)
                    {
                        _mensaje = "Existe";
                    }
                    else
                    {
                        _mensaje = "";
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_mensaje);
        }
Beispiel #3
0
        public int FunGetCodigoAccion(int _codigocpce, string _descripcion)
        {
            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    List <SoftCob_ARBOL_ACCION> _accion = _db.SoftCob_ARBOL_ACCION.Where(a => a.CPCE_CODIGO == _codigocpce &&
                                                                                         a.arac_descripcion == _descripcion).ToList();

                    if (_accion.Count > 0)
                    {
                        foreach (var _datos in _accion)
                        {
                            _codigo = _datos.ARAC_CODIGO;
                        }
                    }
                    else
                    {
                        _codigo = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_codigo);
        }
Beispiel #4
0
        public int FunGetExisteTelefono(int _cedecodigo, int _perscodigo, string _telefono)
        {
            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    List <SoftCob_TELEFONOS_CEDENTE> _dato = _db.SoftCob_TELEFONOS_CEDENTE.Where(c => c.tece_cedecodigo == _cedecodigo &&
                                                                                                 c.tece_perscodigo == _perscodigo && c.tece_numero == _telefono).ToList();

                    if (_dato.Count > 0)
                    {
                        _codigo = 1;
                    }
                    else
                    {
                        _codigo = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_codigo);
        }
Beispiel #5
0
        public DataSet FunGetArbolNewEfecto(int _codigoarac)
        {
            List <SoftCob_ARBOL_EFECTO> _campos = new List <SoftCob_ARBOL_EFECTO>();

            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    _campos = _db.SoftCob_ARBOL_EFECTO.Where(t => t.ARAC_CODIGO == _codigoarac &&
                                                             t.aref_estado).OrderBy(t => t.aref_descripcion).ToList();
                }

                _catalogo.Add(new CatalogosDTO()
                {
                    Descripcion = "--Seleccione Efecto--",
                    Codigo      = "0"
                });

                foreach (SoftCob_ARBOL_EFECTO _xdat in _campos)
                {
                    _catalogo.Add(new CatalogosDTO()
                    {
                        Descripcion = _xdat.aref_descripcion,
                        Codigo      = _xdat.AREF_CODIGO.ToString()
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(new FuncionesDAO().FunCambiarDataSet(_catalogo));
        }
Beispiel #6
0
        public DataSet FunGetCamposComboEstrategia()
        {
            List <SoftCob_CAMPOS_ESTRATEGIA> _campos = new List <SoftCob_CAMPOS_ESTRATEGIA>();

            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    _campos = _db.SoftCob_CAMPOS_ESTRATEGIA.Where(t => t.caes_estado == true).ToList();
                }

                _catalogo.Add(new CatalogosDTO()
                {
                    Descripcion = "--Seleccione Cedente--",
                    Codigo      = "0"
                });

                foreach (SoftCob_CAMPOS_ESTRATEGIA _tab in _campos)
                {
                    _catalogo.Add(new CatalogosDTO()
                    {
                        Descripcion = _tab.caes_nombre,
                        Codigo      = _tab.CAES_CODIGO.ToString()
                    });
                }

                return(new FuncionesDAO().FunCambiarDataSet(_catalogo));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #7
0
        public void FunEditarNotasGestion(SoftCob_NOTAS_GESTION _datos)
        {
            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    SoftCob_NOTAS_GESTION _original = _db.SoftCob_NOTAS_GESTION.Where(x => x.NOTA_CODIGO ==
                                                                                      _datos.NOTA_CODIGO).FirstOrDefault();

                    _db.SoftCob_NOTAS_GESTION.Attach(_original);
                    _original.nota_descripcion  = _datos.nota_descripcion;
                    _original.nota_revisarfecha = _datos.nota_revisarfecha;
                    _original.nota_mantener     = _datos.nota_mantener;
                    _original.nota_auxv1        = _datos.nota_auxv1;
                    _original.nota_auxv2        = _datos.nota_auxv2;
                    _original.nota_auxv3        = _datos.nota_auxv3;
                    _original.nota_auxi1        = _datos.nota_auxi1;
                    _original.nota_auxi2        = _datos.nota_auxi2;
                    _original.nota_auxi3        = _datos.nota_auxi3;
                    _db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #8
0
        public int FunGetCodigoSpeechDet(int _codigospca, int _codigospde)
        {
            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    List <SoftCob_SPEECH_DETALLE> datos = _db.SoftCob_SPEECH_DETALLE.Where(x => x.SPCA_CODIGO == _codigospca &&
                                                                                           x.SPDE_CODIGO == _codigospde).ToList();

                    if (datos.Count > 0)
                    {
                        foreach (var datosx in datos)
                        {
                            _codigo = datosx.SPDE_CODIGO;
                        }
                    }
                    else
                    {
                        _codigo = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_codigo);
        }
Beispiel #9
0
        public bool FunGetValorRespuesta(int _arrecodigo, int _opcion)
        {
            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    if (_opcion == 0)
                    {
                        _respuesta = _db.SoftCob_ARBOL_RESPUESTA.Where(r => r.ARRE_CODIGO == _arrecodigo &&
                                                                       r.arre_estado).FirstOrDefault().arre_pago;
                    }

                    if (_opcion == 1)
                    {
                        _respuesta = _db.SoftCob_ARBOL_RESPUESTA.Where(r => r.ARRE_CODIGO == _arrecodigo &&
                                                                       r.arre_estado).FirstOrDefault().arre_llamar;
                    }

                    if (_opcion == 2)
                    {
                        _respuesta = bool.Parse(_db.SoftCob_ARBOL_RESPUESTA.Where(r => r.ARRE_CODIGO == _arrecodigo &&
                                                                                  r.arre_estado == true).FirstOrDefault().arre_auxv2);
                    }
                }
            }
            catch (Exception)
            {
                _respuesta = false;
            }
            return(_respuesta);
        }
Beispiel #10
0
        public DataSet FunGetArbolNewRespuesta(int _codigoaref)
        {
            List <SoftCob_ARBOL_RESPUESTA> _campos = new List <SoftCob_ARBOL_RESPUESTA>();

            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    _campos = _db.SoftCob_ARBOL_RESPUESTA.Where(t => t.AREF_CODIGO == _codigoaref &&
                                                                t.arre_estado).OrderBy(t => t.arre_descripcion).ToList();
                }

                _catalogo.Add(new CatalogosDTO()
                {
                    Descripcion = "--Seleccione Respuesta--",
                    Codigo      = "0"
                });

                foreach (SoftCob_ARBOL_RESPUESTA _xdat in _campos)
                {
                    _catalogo.Add(new CatalogosDTO()
                    {
                        Descripcion = _xdat.arre_descripcion,
                        Codigo      = _xdat.ARRE_CODIGO.ToString()
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(new FuncionesDAO().FunCambiarDataSet(_catalogo));
        }
Beispiel #11
0
        public SoftCob_PAGOSCARTERA FunGetPagados(string numdocumento, string fechapago, string documento)
        {
            DateTime _fechapago = DateTime.ParseExact(fechapago, "yyyy-MM-dd", CultureInfo.InvariantCulture);

            using (SoftCobEntities _db = new SoftCobEntities())
            {
                SoftCob_PAGOSCARTERA _pagos = _db.SoftCob_PAGOSCARTERA.Where(p => p.pacp_numerodocumento == numdocumento &&
                                                                             p.pacp_fechapago == _fechapago && p.pacp_documento == documento).FirstOrDefault();

                return(_pagos);
            }
        }
Beispiel #12
0
        public string FunGrabarMailPersona(int codigopers, string email)
        {
            SoftCob_PERSONA _original = new SoftCob_PERSONA();

            using (SoftCobEntities _db = new SoftCobEntities())
            {
                _original             = _db.SoftCob_PERSONA.Where(p => p.PERS_CODIGO == codigopers).FirstOrDefault();
                _original.pers_auxiv2 = email;
                _db.SaveChanges();
            }

            return("OK");
        }
Beispiel #13
0
        public string FunGrabarMailEmpre(int codigoclde, string email)
        {
            SoftCob_CLIENTE_DEUDOR _original = new SoftCob_CLIENTE_DEUDOR();

            using (SoftCobEntities _db = new SoftCobEntities())
            {
                _original            = _db.SoftCob_CLIENTE_DEUDOR.Where(c => c.CLDE_CODIGO == codigoclde && c.clde_estado).FirstOrDefault();
                _original.clde_auxv1 = email;
                _db.SaveChanges();
            }

            return("OK");
        }
Beispiel #14
0
 public bool FunGetEfectivo(int _araccodigo)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             return(_db.SoftCob_ARBOL_ACCION.Where(x => x.ARAC_CODIGO == _araccodigo).FirstOrDefault().arac_contacto);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #15
0
 public void FunCrearNotasGestion(SoftCob_NOTAS_GESTION _datos)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _db.SoftCob_NOTAS_GESTION.Add(_datos);
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #16
0
 public void FunCrearTelefonoCedente(SoftCob_TELEFONOS_CEDENTE _telefono)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _db.SoftCob_TELEFONOS_CEDENTE.Add(_telefono);
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #17
0
 public void FunInsertarAccionGestion(SoftCob_ACCIONGESTION _accionges)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _db.SoftCob_ACCIONGESTION.Add(_accionges);
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #18
0
 public int FunGetPersCodigoListaDetalle(int _codigoltca, int _codigoclde, int _gestorasignado)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             return(_db.SoftCob_LISTATRABAJO_DETALLE.Where(x => x.LTCA_CODIGO == _codigoltca && x.ltde_cldecodigo == _codigoclde &&
                                                           x.ltde_gestorasignado == _gestorasignado).FirstOrDefault().ltde_perscodigo);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #19
0
 public bool FunGetLlamar(int _arrecodigo, int _codigocpce)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             return(_db.SoftCob_ARBOL_RESPUESTA.Where(x => x.ARRE_CODIGO == _arrecodigo &&
                                                      x.cpcecodigo == _codigocpce).FirstOrDefault().arre_llamar);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #20
0
        public string FunDelSpeech(int codigospde)
        {
            using (SoftCobEntities _db = new SoftCobEntities())
            {
                var _speech = _db.SoftCob_SPEECH_DETALLE.Where(s => s.SPDE_CODIGO == codigospde).FirstOrDefault();

                if (_speech != null)
                {
                    _db.SoftCob_SPEECH_DETALLE.Attach(_speech);
                    _db.SoftCob_SPEECH_DETALLE.Remove(_speech);
                    _db.SaveChanges();
                }

                return("Borrado");
            }
        }
Beispiel #21
0
 public string FunCrearEstrategia(SoftCob_ESTRATEGIA_CABECERA _estrategia)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _db.SoftCob_ESTRATEGIA_CABECERA.Add(_estrategia);
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         _mensaje = ex.ToString();
     }
     return(_mensaje);
 }
Beispiel #22
0
 public string FunCrearEmployee(SoftCob_EMPLOYEE _employee)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _db.SoftCob_EMPLOYEE.Add(_employee);
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         _mensaje = ex.ToString();
     }
     return(_mensaje);
 }
Beispiel #23
0
 public string FunInsertarPagoAbono(SoftCob_PAGOSCARTERA _pagocartera)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _db.SoftCob_PAGOSCARTERA.Add(_pagocartera);
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         _mensaje = ex.ToString();
     }
     return(_mensaje);
 }
Beispiel #24
0
        public List <SoftCob_CAMPOS_SPEECH> FunGetCamposSpeech()
        {
            List <SoftCob_CAMPOS_SPEECH> _campos = new List <SoftCob_CAMPOS_SPEECH>();

            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    _campos = _db.SoftCob_CAMPOS_SPEECH.Where(t => t.casp_estado == true).ToList();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_campos);
        }
Beispiel #25
0
        public SoftCob_BRENCH FunGetBrenchAdminPorID(int _codigo)
        {
            SoftCob_BRENCH _datos = new SoftCob_BRENCH();

            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    _datos = _db.SoftCob_BRENCH.Where(x => x.BRCH_CODIGO == _codigo).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_datos);
        }
Beispiel #26
0
        public SoftCob_EMPLOYEE FunGetEmployeePorCodigo(int _codigoemployee)
        {
            SoftCob_EMPLOYEE _employee = new SoftCob_EMPLOYEE();

            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    _employee = _db.SoftCob_EMPLOYEE.Where(e => e.EMPL_CODIGO == _codigoemployee).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_employee);
        }
Beispiel #27
0
 public int FunCrearArbolSpeech(SoftCob_SPEECH_CABECERA _datos)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _db.SoftCob_SPEECH_CABECERA.Add(_datos);
             _db.SaveChanges();
             _codigo = _datos.SPCA_CODIGO;
         }
     }
     catch (Exception)
     {
         _codigo = -1;
     }
     return(_codigo);
 }
Beispiel #28
0
        public SoftCob_SPEECH_CABECERA FunGetSpeechPorID(int _codigocpce)
        {
            SoftCob_SPEECH_CABECERA _datos = new SoftCob_SPEECH_CABECERA();

            try
            {
                using (SoftCobEntities _db = new SoftCobEntities())
                {
                    _datos = _db.SoftCob_SPEECH_CABECERA.Where(x => x.spca_cpcecodigo == _codigocpce).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_datos);
        }
Beispiel #29
0
 public int FunGetIdParametroDetalle(string _paracabecera, string _paradetalle)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             _codigo = _db.SoftCob_PARAMETRO_DETALLE.Include("GSBPO_PARAMETRO_CABECERA").
                       Where(pd => pd.pade_nombre == _paradetalle &&
                             pd.PARA_CODIGO == pd.SoftCob_PARAMETRO_CABECERA.PARA_CODIGO &&
                             pd.SoftCob_PARAMETRO_CABECERA.para_nombre == _paracabecera).FirstOrDefault().pade_valorI;
         }
     }
     catch (Exception)
     {
         _codigo = 0;
     }
     return(_codigo);
 }
Beispiel #30
0
 public void FunEditArbolAccion(SoftCob_ARBOL_ACCION _datos)
 {
     try
     {
         using (SoftCobEntities _db = new SoftCobEntities())
         {
             SoftCob_ARBOL_ACCION _original = _db.SoftCob_ARBOL_ACCION.Where(x => x.CPCE_CODIGO == _datos.CPCE_CODIGO &&
                                                                             x.ARAC_CODIGO == _datos.ARAC_CODIGO).FirstOrDefault();
             _db.SoftCob_ARBOL_ACCION.Attach(_original);
             _original.arac_descripcion = _datos.arac_descripcion;
             _db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }