public override void Process(ActionData actionData)
        {
            var widgetName = actionData.GetAsString("WidgetName");
            var value      = actionData.GetAsString("Value") ?? "";

            if (!string.IsNullOrEmpty(widgetName))
            {
                var data = new WidgetEventData {
                    WidgetName = widgetName, Value = value
                };
                data.PublishEvent(EventTopicNames.SetWidgetValue);
            }
        }
示例#2
0
        private void OnClick(object phoneNumber)
        {
            string str = phoneNumber.ToString();

            if (string.IsNullOrEmpty(this.CustomerType.PrimaryFieldName) && string.IsNullOrEmpty(this.SearchFormat))
            {
                if (this.CustomerType.EntityCustomFields.Any <EntityCustomField>((EntityCustomField x) => x.Name == Resources.Phone))
                {
                    str = string.Concat(Resources.Phone, ":", str);
                }
            }
            if (!string.IsNullOrEmpty(this.SearchFormat))
            {
                str = string.Format(this.SearchFormat, str);
            }
            if (!string.IsNullOrEmpty(this.DepartmentName))
            {
                this._applicationStateSettter.SetCurrentDepartment(this.DepartmentName);
            }
            if (!string.IsNullOrEmpty(this.EntityScreenName))
            {
                this._applicationStateSettter.SetSelectedEntityScreen(this.EntityScreenName);
            }
            if (string.IsNullOrEmpty(this.WidgetName))
            {
                OperationRequest <Entity> .Publish(Entity.GetNullEntity(this.CustomerType.Id), EventTopicNames.SelectEntity, EventTopicNames.EntitySelected, str, false);

                return;
            }
            WidgetEventData widgetEventDatum = new WidgetEventData()
            {
                WidgetName = this.WidgetName,
                Value      = str
            };

            widgetEventDatum.PublishEvent <WidgetEventData>("SetWidgetValue");
        }