Exemple #1
0
    private bool IsSyncRunning(Int64 profID)
    {
        SyncHandlerController controller = new SyncHandlerController();
        SyncHandlerController.ResultCode result;
        Profile profile = controller.IsSyncInProgress(out result);

        if (profile != null && profID == profile.Id)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
Exemple #2
0
    protected void SaveClick(object sender, EventArgs e)
    {
        // Demo POC Only
        SyncHandlerController.CreateRelationshipResult result;
        SyncHandlerController _controller = new SyncHandlerController();
        ConnectionInfo LocalConnection = new ConnectionInfo(_siteApi.RequestInformationRef.ConnectionString);

        if (this.cloudRelationship == null)
        {
            Relationship relationship = _controller.CreateCloudRelationship(
                LocalConnection.DatabaseName,
                LocalConnection.ServerName,
                tbLocalSitePath.Text,
                -1,
                tbSQLServer.Text,
                tbIPAddress.Text,
                tbBlobStorage.Text,
                tbAccountName.Text,
                tbContainerName.Text,
                tbAccountKey.Text,
                tbCloudDomain.Text,
                "",//parameters.Certificate,
                Ektron.Cms.Sync.Client.SyncDirection.Upload,
                out result);

            cloudRelationship = getCloudRelationship();
            //cloudRelationship.Delete();
        }
        else
        {
            cloudRelationship.LocalSite.SitePath = tbLocalSitePath.Text;
            cloudRelationship.RemoteSite.ConnectionString = tbSQLServer.Text;
            cloudRelationship.RemoteSite.Address =  tbContainerName.Text +
                 "|" + tbAccountName.Text +
                "|" + tbAccountKey.Text;

            cloudRelationship.Save("Azure");
        }

        ltrMessages.Text = "Relationship Saved";
    }