Ejemplo n.º 1
0
        public ActionResult RetrieveOverallSentiments()
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RetrieveOverallSentiments");
            try
            {
                ArrayList cases_retrieve = client.RetrieveOverallSentiments();
                if (cases_retrieve != null)
                {
                    ViewBag.cases = cases_retrieve;
                }

                else
                {
                    ViewBag.cases = null;
                }
            }
            catch (Exception e)
            {
                ChannelServices.UnregisterChannel(channel);

                Console.WriteLine(e);
            }
            ChannelServices.UnregisterChannel(channel);
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult AddTweetSentiment()
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RetreiveAllTweetsforSentiment");
            try
            {
                ArrayList tweets_retrieve = client.RetreiveAllTweetsforSentiment();
                if (tweets_retrieve != null)
                {
                    ViewBag.tweet = tweets_retrieve;
                }

                else
                {
                    ViewBag.tweet = null;
                }
            }
            catch (Exception e)
            {
                ChannelServices.UnregisterChannel(channel);

                Console.WriteLine(e);
            }
            ChannelServices.UnregisterChannel(channel);
            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult Verify_retrieveusers_case(RetrieveUsers_case_Data ret)
        {
            ViewBag.check = true;

            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RetrieveUsers_case");
            try
            {
                ArrayList user_retrieve = client.RetrieveUsers_case(ret.case_id);
                if (user_retrieve != null)
                {
                    ViewBag.users = user_retrieve;
                }

                else
                {
                    ViewBag.users = null;
                }
            }
            catch (Exception e)
            {
                ChannelServices.UnregisterChannel(channel);

                Console.WriteLine(e);
            }
            ChannelServices.UnregisterChannel(channel);
            return(View("RetrieveUsers_case"));
        }
Ejemplo n.º 4
0
        public ActionResult Verify_adduser(AddUser_Data add)
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/AddUser");
            try
            {
                string user_check = client.AddUser(add.first_name, add.last_name, add.dob);
                if (user_check == "exsist")
                {
                    ViewBag.user_check = 1;
                }
                else
                {
                    ViewBag.user_check = 0;
                }
            }
            catch (Exception e)
            {
                ChannelServices.UnregisterChannel(channel);

                Console.WriteLine(e);
            }
            ChannelServices.UnregisterChannel(channel);

            return(View("AddUser"));
        }
Ejemplo n.º 5
0
        public ActionResult Home(Users_Data user, int check)
        {
            ViewBag.check    = check;
            ViewBag.username = user;
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RetrieveCases");
            ViewBag.cases = client.RetrieveCases();
            ChannelServices.UnregisterChannel(channel);
            return(View("Home"));
        }
Ejemplo n.º 6
0
        public ActionResult Verify_removeuser(RemoveUser_Data rem)
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RemoveUser");

            client.RemoveUser(rem.id, rem.first_name, rem.last_name);
            ChannelServices.UnregisterChannel(channel);

            return(View("RemoveUser"));
        }
Ejemplo n.º 7
0
        public ActionResult AddSentimentforTweet(AddSentimentforTweet add)
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/AddSentimentforTweet");

            client.AddSentimentforTweet(add.tweet_id, add.sentiment, add.case_id);
            ChannelServices.UnregisterChannel(channel);

            return(View("AddTweetSentiment", AddTweetSentiment()));
        }
Ejemplo n.º 8
0
        public ActionResult Verify_removecase(RemoveCase_Data rem)
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RemoveCase");

            client.RemoveCase(rem.case_id);
            ChannelServices.UnregisterChannel(channel);

            return(View("RemoveCase"));
        }
Ejemplo n.º 9
0
        public ActionResult Verify_addcase(AddCase_Data add)
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/AddCase");

            client.AddCase(add.case_text);
            ChannelServices.UnregisterChannel(channel);

            return(View("AddCase"));
        }
Ejemplo n.º 10
0
        public ActionResult Verify_ParticipateInCase(Users_Data add)
        {
            int         check   = 0;
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/ParticipateCase");

            client.ParticipateCase(add.tweet_text, add.first_name, add.last_name, add.case_id);
            ChannelServices.UnregisterChannel(channel);

            return(this.Home(add, check));
        }
        public ActionResult Verify_addtweet(Users_Data add)
        {
            int         check   = 0;
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/AddTweet");
            try
            {
                client.AddTweet(add.tweet_text, add.first_name, add.last_name);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);

                ChannelServices.UnregisterChannel(channel);
            }
            ChannelServices.UnregisterChannel(channel);

            return(this.Home(add, check));
        }
Ejemplo n.º 12
0
        public ActionResult Verify_retrieveuser(RetrieveUser_Data ret)
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RetrieveUser");

            ArrayList user_retrieve = client.RetrieveUser(ret.id);

            if (user_retrieve != null)
            {
                ViewBag.user = user_retrieve;
            }

            else
            {
                ViewBag.user = null;
            }
            ChannelServices.UnregisterChannel(channel);
            return(View("RetrieveUser"));
        }
        public ActionResult Verify_Login(Users_Data user_data)
        {
            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/CheckUser");


            string check_user = client.CheckUser(user_data.first_name, user_data.last_name);

            if (check_user == "Registered")
            {
                ChannelServices.UnregisterChannel(channel);
                int check = 1;
                return(this.Home(user_data, check));
            }
            else
            {
                ViewBag.check = 0;
                ChannelServices.UnregisterChannel(channel);
                return(View("Login"));
            }
        }
Ejemplo n.º 14
0
        public ActionResult Verify_retrievetweets(RetrieveTweets_Data ret)
        {
            ViewBag.check = true;

            HttpChannel channel = new HttpChannel();

            ChannelServices.RegisterChannel(channel);
            client = (ITwitterSentimentService.ITwitterSentimentService)Activator.GetObject
                         (typeof(ITwitterSentimentService.ITwitterSentimentService), "http://localhost:8080/RetrieveTweets");

            ArrayList tweet_retrieve = client.RetrieveTweets(ret.user_id);

            if (tweet_retrieve != null)
            {
                ViewBag.tweet = tweet_retrieve;
            }

            else
            {
                ViewBag.tweet = null;
            }
            ChannelServices.UnregisterChannel(channel);
            return(View("RetrieveTweets"));
        }