public void twitter(string msg) { try { Session["twittermsg"] = msg; SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml"); TwitterHelper twthelper = new TwitterHelper(); string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); Response.Redirect(twtredirecturl); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void AuthenticateTwitter(object sender, EventArgs e) { TwitterHelper twthelper = new TwitterHelper(); string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); Response.Redirect(twtredirecturl); oAuthTwitter OAuth = new oAuthTwitter(); if (Request["oauth_token"] == null) { OAuth.AccessToken = string.Empty; OAuth.AccessTokenSecret = string.Empty; OAuth.CallBackUrl = ConfigurationManager.AppSettings["callbackurl"].ToString(); this.TwitterOAuth.HRef = OAuth.AuthorizationLinkGet(); Response.Redirect(OAuth.AuthorizationLinkGet()); } }
public void AuthenticateTwitter(object sender, EventArgs e) { try { int profilecount = (int)Session["ProfileCount"]; int totalaccount = (int)Session["TotalAccount"]; if (profilecount < totalaccount) { TwitterHelper twthelper = new TwitterHelper(); string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); Response.Redirect(twtredirecturl); } else { Response.Write("<script>SimpleMessageAlert('Change the Plan to Add More Accounts');</script>"); } } catch (Exception ex) { logger.Error(ex.Message); } }
public void AuthenticateTwitter(object sender, EventArgs e) { try { GroupRepository objGroupRepository = new GroupRepository(); SocioBoard.Domain.Team team = (SocioBoard.Domain.Team)Session["GroupName"]; Groups lstDetails = objGroupRepository.getGroupName(team.GroupId); try { int profilecount = (int)Session["ProfileCount"]; int totalaccount = (int)Session["TotalAccount"]; if (lstDetails.GroupName == "Socioboard") { if (profilecount < totalaccount) { TwitterHelper twthelper = new TwitterHelper(); string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); Response.Redirect(twtredirecturl); } else { //Response.Write("<script>SimpleMessageAlert('Change the Plan to Add More Accounts');</script>"); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Change the Plan to Add More Accounts');", true); } } } catch (Exception ex) { logger.Error(ex.Message); } } catch (Exception ex) { logger.Error(ex.Message); } }
public void TwitterOAuthRedirect(object sender, EventArgs e) { User user = (User)Session["LoggedUser"]; oAuthTwitter OAuth = new oAuthTwitter(); if (ddlGroup.SelectedIndex > 0) { HiddenFieldGroupNameInDDl.Value = ddlGroup.SelectedItem.Text; if (!string.IsNullOrEmpty(HiddenFieldGroupNameInDDl.Value)) { GroupRepository grouprepo = new GroupRepository(); Groups group = grouprepo.getGroupDetails(user.Id, HiddenFieldGroupNameInDDl.Value.ToString()); Session["GroupName"] = group; TwitterHelper twthelper = new TwitterHelper(); string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); Response.Redirect(twtredirecturl); } } else { try { string txtgroup = Page.Request.Form["txtGroupName"].ToString().Trim(); if (!string.IsNullOrEmpty(txtgroup)) { GroupRepository grouprepo = new GroupRepository(); Groups group = new Groups(); group.Id = Guid.NewGuid(); group.GroupName = txtgroup; group.UserId = user.Id; group.EntryDate = DateTime.Now; if (!grouprepo.checkGroupExists(user.Id, txtgroup)) { grouprepo.AddGroup(group); Groups grou = grouprepo.getGroupDetails(user.Id, txtgroup); Session["GroupName"] = grou; } else { Groups grou = grouprepo.getGroupDetails(user.Id, txtgroup); Session["GroupName"] = grou; } if (Request["oauth_token"] == null) { Session["UserAndGroupsForTwitter"] = "twitter"; TwitterHelper twthelper = new TwitterHelper(); string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); Response.Redirect(twtredirecturl); } } else { Response.Write("<script>alert(\"Please fill Group Name\");</script>"); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } }
public void AuthenticateTwitter(object sender, EventArgs e) { TwitterHelper twthelper = new TwitterHelper(); string twtredirecturl = twthelper.TwitterRedirect(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); Response.Redirect(twtredirecturl); }