public ActionResult AuthenticateTumblr()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = (Int16)(Session["ProfileCount"]);
             int totalaccount = (Int16)Session["TotalAccount"];
             if (Convert.ToString(group["GroupName"]) == "Socioboard")
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string            redircturl   = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return(View());
 }
 public ActionResult AuthenticateTumblr()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = 0;
             int totalaccount = 0;
             try
             {
                 profilecount = (Int16)(Session["ProfileCount"]);
                 totalaccount = (Int16)Session["TotalAccount"];
             }
             catch (Exception ex)
             {
                 logger.Error("ex.Message : " + ex.Message);
                 logger.Error("ex.StackTrace : " + ex.StackTrace);
             }
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string redircturl = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else if (profilecount == 0 || totalaccount == 0)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string redircturl = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                     return RedirectToAction("Index", "Home");
                 }
             }
             else 
             {
                 logger.Error("AuthenticateTumblr =>" + Convert.ToString(group["GroupName"]) + "!=" + ConfigurationManager.AppSettings["DefaultGroupName"].ToString());
                 return RedirectToAction("Index", "Home");
             }
         }
         catch (Exception ex)
         {
             logger.Error("AuthenticateTumblr => "+ex.Message);
             logger.Error("AuthenticateTumblr => "+ex.StackTrace);
             return RedirectToAction("Index", "Home");
         }
     }
     catch (Exception ex)
     {
     }
     return RedirectToAction("Index", "Home");
 }
 public ActionResult AuthenticateTumblr()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = 0;
             int totalaccount = 0;
             try
             {
                 profilecount = (Int16)(Session["ProfileCount"]);
                 totalaccount = (Int16)Session["TotalAccount"];
             }
             catch (Exception ex)
             {
                 logger.Error("ex.Message : " + ex.Message);
                 logger.Error("ex.StackTrace : " + ex.StackTrace);
             }
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string            redircturl   = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else if (profilecount == 0 || totalaccount == 0)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string            redircturl   = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                     return(RedirectToAction("Index", "Home"));
                 }
             }
             else
             {
                 logger.Error("AuthenticateTumblr =>" + Convert.ToString(group["GroupName"]) + "!=" + ConfigurationManager.AppSettings["DefaultGroupName"].ToString());
                 return(RedirectToAction("Index", "Home"));
             }
         }
         catch (Exception ex)
         {
             logger.Error("AuthenticateTumblr => " + ex.Message);
             logger.Error("AuthenticateTumblr => " + ex.StackTrace);
             return(RedirectToAction("Index", "Home"));
         }
     }
     catch (Exception ex)
     {
     }
     return(RedirectToAction("Index", "Home"));
 }