Пример #1
0
    //DEBO REUNIRME CON UNIEMPLEO PARA REALIZAR ESTO CORRECTAMENTE PUES TODOS LOS PROYECTOS DEBEN TENER ESTA MISMA CLASE
    //POR DEFECTO LA EMPRESA TENDRA LA IMAGEN DEL USUARIO DESONOCIDO
    public string create_company(string JSON_DATA)
    {
        try
        {
            if (SoapHeader == null)
            {
                throw new Exception("Requiere Validacion");
            }

            if (!SoapHeader.blCredencialesValidas(SoapHeader))
            {
                throw new Exception("Requiere Validacion");
            }
            UEUEmpresa empre = JsonConvert.DeserializeObject <UEUEmpresa>(JSON_DATA);
            //SE CARGA LA IMAGEN POR DEFECTO
            empre.RutaArchivo = "../Archivos/FotosPerfil/";
            empre.NomArchivo  = "PerfilUsrDefault.png";
            L_Registro_Empesa_Serv Logi = new L_Registro_Empesa_Serv();
            string res = Logi.registrar_Empresa(empre);
            return(res);
        }
        catch (Exception ex)
        {
            return("Ha Ocurrido Un Error Inesperado " + ex.Message);
        }
    }
Пример #2
0
    public string publicar_Compramatic(string nomUser, string publicacion, string emailUser)
    {
        try
        {
            if (SoapHeader == null)
            {
                throw new Exception("Requiere Validacion");
            }

            if (!SoapHeader.blCredencialesValidas(SoapHeader))
            {
                throw new Exception("Requiere Validacion");
            }
            try
            {
                UEUPublic_User publica = new UEUPublic_User();
                publica.NombreUs    = nomUser;
                publica.Publicacion = publicacion;
                publica.Email_user  = emailUser;
                //A Terminar este servicio :(
                L_Serv_Public_User logi = new L_Serv_Public_User();
                logi.crear_Publicacion(publica);
                return("Publicacion Correctamente Insertada");
            }
            catch (Exception ex)
            {
                return("Ha Ocurrido Un Error Inesperado " + ex.Message);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #3
0
    public string InsertarDudasEmpresa(String mensaje, int idEmpre, string nomUser, string correoUser)
    {
        try
        {
            if (SoapHeader == null)
            {
                throw new Exception("Requiere Validacion");
            }

            if (!SoapHeader.blCredencialesValidas(SoapHeader))
            {
                throw new Exception("Requiere Validacion");
            }
            L_ServicioComentario logi = new L_ServicioComentario();
            try
            {
                logi.insertar_Comentario(mensaje, idEmpre, nomUser, correoUser);
                return("Comentario Enviado Correctamente");
            }
            catch (Exception ex)
            {
                //ENVIAR MENSAJE DE ERROR
                return("Ha Ocurrido Un Error Inesperado " + ex.Message);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #4
0
    //METODO PARA CALIFICAR A LA EMPRESA
    public string calificarEmpresa(string corre_Usr, int id_Empresa, string nomUser, string apell_usr, string direccion, string telefono, string cedula, double rang)
    {
        try
        {
            if (SoapHeader == null)
            {
                throw new Exception("Requiere Validacion");
            }

            if (!SoapHeader.blCredencialesValidas(SoapHeader))
            {
                throw new Exception("Requiere Validacion");
            }
            L_ServicioCalificacion logi = new L_ServicioCalificacion();
            if (logi.validar_existencia(corre_Usr))
            {
                //Insertar Calificacion
                logi.calificar_empresa(id_Empresa, nomUser, corre_Usr, rang);
                return("Calificacion Exitosa");
            }
            else
            {
                //Insertar Usuario A La DB como Nuevo Usuario
                //Por Defecto La Contraseña Sera 12345678
                UEUsuario user = new UEUsuario();
                user.NomUsr    = nomUser;
                user.ApelUsr   = apell_usr;
                user.TelUsr    = telefono;
                user.CorreoUsr = corre_Usr;
                user.PassUsr   = "******";
                user.CcUsr     = cedula;
                user.DirUsr    = direccion;
                String res = logi.insertar_Usuario(user);
                if (res != "Tu registro se ha sido realizado satisfactoriamente.")
                {
                    //CASO EN QUE EL USUAREIO NO EXISTE
                    return("Ha Ocurrido Un Error Inesperado. " + res);
                }
                else
                {
                    logi.calificar_empresa(id_Empresa, nomUser, corre_Usr, rang);
                    return(res + "Calificacion Exitosa . Debido a que este Usuario No Existe En La DB de Compramatic Su Contraseña Temporal Es 12345678");
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #5
0
    public string loggin_User(string correoUsr, string password)
    {
        try
        {
            if (SoapHeader == null)
            {
                throw new Exception("Requiere Validacion");
            }

            if (!SoapHeader.blCredencialesValidas(SoapHeader))
            {
                throw new Exception("Requiere Validacion");
            }
            L_Loggin_Usr_Service logi = new L_Loggin_Usr_Service();
            return(logi.loggin_user(password, correoUsr));
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #6
0
    public string traer_por_categoria(int id_categoria)
    {
        try
        {
            if (SoapHeader == null)
            {
                throw new Exception("Requiere Validacion");
            }

            if (!SoapHeader.blCredencialesValidas(SoapHeader))
            {
                throw new Exception("Requiere Validacion");
            }
            try
            {
                L_WebService             logi = new L_WebService();
                List <UEUVista_Tot_Prod> inf  = logi.busqueda(id_categoria);
                foreach (UEUVista_Tot_Prod aux in inf)
                {
                    aux._foto = "http://compramatic.hopto.org:88/Archivos/FotosProductos/" + aux._foto;
                }
                ListToDataTable conv   = new ListToDataTable();
                DataTable       retorn = conv.ToDataTable(inf);
                string          res    = JsonConvert.SerializeObject(retorn);
                DataTable       test   = JsonConvert.DeserializeObject <DataTable>(res);
                return(res);
            }
            catch (Exception ex)
            {
                return("Ha Ocurrido Un Error Inesperado " + ex.Message);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }