/// <summary> /// Assigns the new job id to the link control. /// </summary> /// <param name="form">The SyncConfirmation form.</param> /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param> public static void OnLoadStep(ISyncJobConfirmation form, EventArgs args) { IWebDialogService dialogService = form.Services.Get<IWebDialogService>(); if (dialogService.DialogParameters.ContainsKey("NewSyncJobName")) { var jobName = dialogService.DialogParameters["NewSyncJobName"]; if (jobName != null) { ISyncJob syncJob = EntityFactory.GetRepository<ISyncJob>().FindFirstByProperty("JobName", jobName.ToString()); if (syncJob != null) { form.lnkViewSyncJob.EntityId = syncJob.Id.ToString(); form.lnkViewSyncJob.Text = String.Format(form.GetResource("jobName.Caption").ToString(), jobName); } else { form.lnkViewSyncJob.Visible = false; form.lblMessage.Text = form.GetResource("DialogHeader.Caption").ToString(); } dialogService.DialogParameters.Remove("NewSyncJobName"); } } }
/// <summary> /// Assigns the new job id to the link control. /// </summary> /// <param name="form">The SyncConfirmation form.</param> /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param> public static void OnLoadStep(ISyncJobConfirmation form, EventArgs args) { IWebDialogService dialogService = form.Services.Get <IWebDialogService>(); if (dialogService.DialogParameters.ContainsKey("NewSyncJobName")) { var jobName = dialogService.DialogParameters["NewSyncJobName"]; if (jobName != null) { ISyncJob syncJob = EntityFactory.GetRepository <ISyncJob>().FindFirstByProperty("JobName", jobName.ToString()); if (syncJob != null) { form.lnkViewSyncJob.EntityId = syncJob.Id.ToString(); form.lnkViewSyncJob.Text = String.Format(form.GetResource("jobName.Caption").ToString(), jobName); } else { form.lnkViewSyncJob.Visible = false; form.lblMessage.Text = form.GetResource("DialogHeader.Caption").ToString(); } dialogService.DialogParameters.Remove("NewSyncJobName"); } } }