Ejemplo n.º 1
0
 protected void googleButton_Click(object sender, EventArgs e)
 {
     if (Session["serStatus"] != null)
     {
         GoogleContactService objService1    = new GoogleContactService();
         List <ContactDetail> contactDetails = objService1.GetContacts((GooglePlusAccessToken)Session["serStatus"]);
         BindDataToDrid(contactDetails);
     }
     else
     {
         RedirectTOGoogle();
     }
 }
Ejemplo n.º 2
0
    public void ListAllContacts()
    {
        string code                 = Request.QueryString["code"];
        string google_client_id     = ConfigurationManager.AppSettings["google_client_id"].ToString();
        string google_client_sceret = ConfigurationManager.AppSettings["google_client_sceret"].ToString();
        string google_redirect_url  = ConfigurationManager.AppSettings["google_redirect_url"].ToString();
        /*Get Access Token and Refresh Token*/
        GoogleContactService  objService = new GoogleContactService();
        GooglePlusAccessToken serStatus  = objService.getAccessToken(code, google_client_id, google_client_sceret, google_redirect_url);
        /*End*/
        List <ContactDetail> contactDetails = objService.GetContacts(serStatus);

        BindDataToDrid(contactDetails);
    }