APIModel.JsonCompanySerlization CallAPI()
        {
            string username = "******";
            string password = "******";

            APIModel.LoginTokenResult accessToken = APIModel.GetLoginToken(username, password);
            if (accessToken.AccessToken != null)
            {
                //Console.WriteLine(accessToken);
                APIModel.JsonCompanySerlization list = APIModel.GetPendingCompany(accessToken.AccessToken);
                return(list);
            }
            else
            {
                return(null);// "Error Occurred:{0}, {1}", accessToken.Error, accessToken.ErrorDescription;
                //Console.WriteLine("Error Occurred:{0}, {1}", accessToken.Error, accessToken.ErrorDescription);
            }
        }
        public ActionResult GetPendingCRM(int?user, int?OrgId, int?CompanyId)
        {
            //if (Request.UrlReferrer == null || Request.UrlReferrer.Segments[Request.UrlReferrer.Segments.Length - 1] == "")
            //    return RedirectToAction("Login", "Login");
            string username = "******";
            string password = "******";

            APIModel.LoginTokenResult accessToken = APIModel.GetLoginToken(username, password);
            if (accessToken.AccessToken != null)
            {
                //Console.WriteLine(accessToken);
                APIModel.JsonCompanySerlization list = APIModel.GetPendingCompany(accessToken.AccessToken);
                return(Json(new { success = true, Company = list.data }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                Console.WriteLine("Error Occurred:{0}, {1}", accessToken.Error, accessToken.ErrorDescription);
            }

            return(View());
        }