/// <summary> /// Opens the data item browse /// </summary> /// <returns></returns> protected override IQOpResult <int> OpenEditor(int currentValue, IQVarElementTarget target) { WidgetContract wc = new WidgetContract(NTStrings.IQCareplanVarActivity_CarePlanBrowseWidget_ClassName, NTStrings.IQCareplanVarActivity_CarePlanBrowseWidget_InstanceName, WidgetContract.RequestOptions.DialogResult); // If the current value is 0 do not pass it into the control since we internalize 0 as not valid if (currentValue != 0) { wc.CustomData.Add(CarePlanBrowseWidget.CustomDataKeys.SELECTED_SET_ID, currentValue.ToString()); } wc.SecEnums = SecurityEnums.EC_GEN; wc.WidgetTitle = Strings.IQCareplanVarActivity_WidgetTitle; WidgetManager.AddWidgetModule(NTStrings.IQCareplanVarActivity_CarePlanBroweseWidget_AssemblyName); WidgetManager.ActivateWidget(null, wc); // Open the browse as a modal window wc.ActiveWidget.ShowDialog(); //If the user hit "close", don't update the primaryKeyValue return(wc.Result == WidgetContract.ResultOptions.Completed ? new IQOpResult <int> { Result = OpResultEnum.Completed, Value = (int)wc.CustomData[CarePlanBrowseWidget.CustomDataKeys.SELECTED_SET_ID] } : new IQOpResult <int> { Result = OpResultEnum.Cancelled }); }
/// <summary> /// Displays the staff browse /// </summary> /// <returns></returns> protected override IQOpResult <int> OpenEditor(int defaultValue, IQVarElementTarget target) { var wc = new WidgetContract(NTStrings.IQStaffLocVarActivity_StaffBrowseWidget_ClassName, NTStrings.IQStaffLocVarActivity_StaffBrowseWidget_InstanceName, WidgetContract.RequestOptions.DialogResult); // If the current value is 0 do not pass it into the control since we internalize 0 as not valid if (defaultValue != 0) { wc.CustomData.Add(Mosaiq.Core.Defs.Constants.StringConstants.KEY_SELECTEDID, defaultValue); } var staffProperties = new StaffProperties { HideFavorites = true, HideInactive = true, ShowLocations = StaffLocationBrowseMode.StaffAndLocations, IncludeAllDepartments = true, NoEdit = true }; wc.CustomData.Add(NTStrings.IQStaffLocVarActivity_StaffBrowseWidget_Properties, staffProperties); wc.SecEnums = SecurityEnums.EC_GEN; wc.WidgetTitle = Strings.IQStaffLocVarActivity_WidgetTitle; WidgetManager.AddWidgetModule(NTStrings.IQStaffLocVarActivity_StaffBrowseWidget_AssemblyName); WidgetManager.ActivateWidget(null, wc); // Open the browse as a modal window wc.ActiveWidget.ShowDialog(); //If the user hit "close", don't update the primaryKeyValue return(wc.Result == WidgetContract.ResultOptions.Completed ? new IQOpResult <int> { Result = OpResultEnum.Completed, Value = (int)wc.CustomData[Mosaiq.Core.Defs.Constants.StringConstants.KEY_SELECTEDID] } : new IQOpResult <int> { Result = OpResultEnum.Cancelled }); }