示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //This creates an administrator for the sample app if it does not exist
     if (Membership.FindUsersByName("admin").Count == 0)
     {
         MembershipUser newUser = Membership.CreateUser("admin", "intuit");
     }
     try { IppRealmOAuthProfile ippRealmOAuthProfile = IppRealmOAuthProfile.Read(); }
     catch { }
 }
 protected void disconnect_Click(object sender, EventArgs e)
 {
     try
     {
         RestHelper.disconnectRealm(IppRealmOAuthProfile.Read());
     }
     catch
     {
     }
     finally { loadVisibleSections(); }
 }
示例#3
0
 public void ToggleBlueDotMenuVisibility()
 {
     if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated && System.Web.HttpContext.Current.User.Identity.Name == "admin" && RestHelper.appTokensSet() && !Request.FilePath.Contains("OAuth"))
     {
         IppRealmOAuthProfile profile = IppRealmOAuthProfile.Read();
         blueDotMenu.Visible = profile.accessToken.Length > 0;
     }
     else
     {
         blueDotMenu.Visible = false;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated || !RestHelper.appTokensSet() || IppRealmOAuthProfile.Read().accessToken.Length == 0)
         {
             Response.Redirect("~/Default.aspx");
         }
         employeesView.DataSource = RestHelper.getEmployeeList(IppRealmOAuthProfile.Read());
         employeesView.DataBind();
     }
     catch
     {
     }
 }
 private void loadVisibleSections()
 {
     notLoggedIn.Visible       = false;
     notConnected.Visible      = false;
     connected.Visible         = false;
     appTokensNotFound.Visible = false;
     if (!RestHelper.appTokensSet())
     {
         appTokensNotFound.Visible = true;
     }
     else if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
     {
         notLoggedIn.Visible = true;
     }
     else
     {
         notConnected.Visible = IppRealmOAuthProfile.Read().accessToken == "";
         connected.Visible    = IppRealmOAuthProfile.Read().accessToken != "";
     }
     (this.Master as SiteMaster).ToggleBlueDotMenuVisibility();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            IppRealmOAuthProfile profile = IppRealmOAuthProfile.Read();

            Response.Write(RestHelper.callPlatform(profile, Constants.IppEndPoints.BlueDotAppMenuUrl));
        }