public ActionResult EditProperties(int id) { ViewBag.Id = id; var config = TheWorkflowConfigurationService.GetConfiguration(id); var ui = TheWorkflowEntityUiResolver.Resolve(config); return(View(ui.Render(config))); }
protected override void OnInit(EventArgs e) { base.OnInit(e); var id = Convert.ToInt32(Request["id"]); _config = TheWorkflowConfigurationService.GetConfiguration(id); _ui = TheWorkflowEntityUiResolver.Resolve(_config); foreach (var control in _ui.Render(_config)) { PropertiesUiPanel.Controls.Add(control); } }
public ActionResult SaveProperties(int id, FormCollection formCollection) { var config = TheWorkflowConfigurationService.GetConfiguration(id); var ui = TheWorkflowEntityUiResolver.Resolve(config); var values = new Dictionary <string, object>(); foreach (var prop in ui.UiProperties) { values[prop.PropertyName] = ControlExtensions.ControlValue(prop.RenderControl, formCollection[prop.PropertyName]); } TheWorkflowConfigurationService.SetConfigurationProperties(id, values); return(RedirectToAction("Index", "Home")); }
protected void Page_Load(object sender, EventArgs e) { var u = umbraco.BusinessLogic.User.GetCurrent(); var workflows = new List <IWorkflowConfiguration>(); foreach (var criteria in TheWorkflowInstantiationCriteriaService.List()) { var hydratedCriteria = TheWorkflowInstantiationCriteriaService.GetCriteria(criteria.Id); if (!hydratedCriteria.Active) { continue; } if (!((UmbracoWorkflowInstantiationCriteria)hydratedCriteria).AllowManualInstantiation) { continue; } if (!TheCriteriaValidationService.IsCriteriaValid((UmbracoWorkflowInstantiationCriteria)hydratedCriteria, u)) { continue; } workflows.Add(TheWorkflowConfigurationService.GetConfiguration(hydratedCriteria.WorkflowConfiguration)); } if (workflows.Count == 0) { NoCriteriasLiteral.Text = TheGlobalisationService.GetString("no_valid_workflow_instantiation_criteria"); NoCriteriasLiteral.Visible = true; } else { AvailableCriteriaDropDownList.DataSource = workflows; AvailableCriteriaDropDownList.DataTextField = "Name"; AvailableCriteriaDropDownList.DataValueField = "Id"; AvailableCriteriaDropDownList.DataBind(); SendToWorkflowPanel.Visible = true; } }
protected override void OnInit(EventArgs e) { base.OnInit(e); SavePropertiesButton.Text = TheGlobalisationService.GetString("save_properties"); this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Util.js", ClientDependencyType.Javascript); this.AddResourceToClientDependency("Moriyama.Workflow.Umbraco6.Web.Workflow.Js.Config.js", ClientDependencyType.Javascript); var id = Convert.ToInt32(Request["id"]); _config = TheWorkflowConfigurationService.GetConfiguration(id); _ui = TheWorkflowEntityUiResolver.Resolve(_config); foreach (var control in _ui.Render(_config)) { PropertiesUiPanel.Controls.Add(control); } }