Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        parseParameters();

        _userId = (Guid)Membership.GetUser().ProviderUserKey;
        _db     = Global.GetDbConnection();

        //Load the report
        _report = _db.ORManager.Get <CustomReport>(_customReportId);

        //Set the URL for the preview link
        initPreviewLink();

        lstReportParts.SelectedIndexChanged += lstReportParts_SelectedIndexChanged;
        ddlReportType.SelectedIndexChanged  += ddlReportType_SelectedIndexChanged;

        cmdAdd.Click    += cmdAdd_Click;
        cmdDelete.Click += cmdDelete_Click;
        cmdSave.Click   += cmdSave_Click;

        //Verify that the report belongs to this user
        if (_report.UserId != _userId)
        {
            throw new ApplicationException("Report does not belong to the logged in user - Security violation");
        }

        if (!Page.IsPostBack)
        {
            populateReportPartList();

            //Confirm deletes
            JavaScriptBlock.ConfirmClick(cmdDelete, "Are you sure you want to delete the selected report part from this report?");
        }
    }
Ejemplo n.º 2
0
    private void initDeleteConfirm()
    {
        string msg;

        msg =
            "Are you sure you want to PERMANENTLY delete this category and all associated events? If any event subscriptions are using this category, they will be reassigned to the default category";

        JavaScriptBlock.ConfirmClick(cmdDelete, msg);
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            initUserInformation();
            populateTimeZoneList();

            JavaScriptBlock.ConfirmClick(CancelAccount,
                                         @"If you cancel your account, you will no longer be able to log in to our system and all of the data gathered for your account will be deleted.\nAre you sure you want to cancel your account? (OK = Yes, Cancel = No)");
        }

        cmdUpdateTimezone.Click += cmdUpdateTimezone_Click;
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _userId = (Guid)Membership.GetUser().ProviderUserKey;
        _db     = Global.GetDbConnection();

        lstSites.SelectedIndexChanged += lstSites_SelectedIndexChanged;
        cmdAdd.Click    += cmdAdd_Click;
        cmdDelete.Click += cmdDelete_Click;
        cmdSave.Click   += cmdSave_Click;

        if (!Page.IsPostBack)
        {
            populateSiteList();
            displaySite(getSelectedSite());

            //Confirm the delete click
            JavaScriptBlock.ConfirmClick(cmdDelete, "Are you sure you want to delete this site and all data associated with it?");
        }
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _userId = (Guid)Membership.GetUser().ProviderUserKey;
        getDbConnection();

        cmdLoad.Click   += cmdLoad_Click;
        cmdDelete.Click += cmdDelete_Click;

        if (!Page.IsPostBack)
        {
            PopulateReportList();

            //Confirm the delete click
            JavaScriptBlock.ConfirmClick(cmdDelete,
                                         "Are you sure you want to delete this saved report? It will also be removed from any custom reports that it belongs to.");

            //Enable double-click loading
            lstReports.Attributes["ondblclick"] = Page.ClientScript.GetPostBackClientHyperlink(this, "lstReports_doubleClick");

            //Load the default settings
            raiseSettingsLoaded();
        }
    }
Ejemplo n.º 6
0
        public static ICollection <JavaScriptBlock> GetAll(kCura.Relativity.Client.IRSAPIClient client)
        {
            var javaScriptBlocks = new List <JavaScriptBlock>();

            var qry = new kCura.Relativity.Client.DTOs.Query <kCura.Relativity.Client.DTOs.RDO>();

            qry.ArtifactTypeGuid = Helper.Constants.Javascripts.ObjectTypeGuid;
            //qry.Fields = kCura.Relativity.Client.DTOs.FieldValue.AllFields;
            qry.Fields = new List <kCura.Relativity.Client.DTOs.FieldValue> {
                new kCura.Relativity.Client.DTOs.FieldValue(Helper.Constants.Javascripts.Fields.Text)
                , new kCura.Relativity.Client.DTOs.FieldValue(Helper.Constants.Javascripts.Fields.ViewMode)
            };

            BooleanCondition onlyActiveJavaScript = new BooleanCondition(Helper.Constants.Javascripts.Fields.Disabled, BooleanConditionEnum.EqualTo, false);

            qry.Condition = onlyActiveJavaScript;


            try
            {
                var ActiveJavaScriptsResults = client.Repositories.RDO.Query(qry);

                if (ActiveJavaScriptsResults.Success)
                {
                    foreach (var result in ActiveJavaScriptsResults.Results)
                    {
                        var javaScript     = new JavaScriptBlock();
                        var resultArtifact = result.Artifact;
                        javaScript.Text       = resultArtifact.Fields.First(x => x.Guids.Contains(Helper.Constants.Javascripts.Fields.Text)).ValueAsLongText;
                        javaScript.ArtifactID = resultArtifact.ArtifactID;
                        var viewModeChoiceField = resultArtifact.Fields.First(x => x.Guids.Contains(Helper.Constants.Javascripts.Fields.ViewMode)).ValueAsSingleChoice;


                        javaScript.ViewMode = JavaScriptBlock.ViewModeValue.All;
                        if (viewModeChoiceField != null)
                        {
                            var viewModeChoice = client.Repositories.Choice.ReadSingle(viewModeChoiceField.ArtifactID);
                            if (viewModeChoice.Guids.Contains(Helper.Constants.Javascripts.Choices.ViewMode.ViewOnly))
                            {
                                javaScript.ViewMode = JavaScriptBlock.ViewModeValue.ViewOnly;
                            }
                            else if (viewModeChoice.Guids.Contains(Helper.Constants.Javascripts.Choices.ViewMode.EditOnly))
                            {
                                javaScript.ViewMode = JavaScriptBlock.ViewModeValue.EditOnly;
                            }
                        }
                        javaScriptBlocks.Add(javaScript);


                        //var jS = new JavaScripts();
                        //jS.text = text;
                    }
                }
                else
                {
                    Console.WriteLine(string.Format("An error occurred reading results: {0}", ActiveJavaScriptsResults.Message));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(string.Format("An error occurred: {0}", ex.Message));
            }

            return(javaScriptBlocks);
        }
Ejemplo n.º 7
0
 private void initJavascript()
 {
     JavaScriptBlock.ConfirmClick(Save,
                                  "Performing this action will effectively cause all users to be reset on their acceptance of this legal notice.\\nAre you sure you want to perform this action?");
 }