public static MvcHtmlString BallyTextArea <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, StylePropertyBag style = null, short tabIndex = 0, string onLeaveFunction = "", string onKeyUpFunction = "", string onKeyDownFunction = "", string onChangeFunction = "", string cssClass = "", bool?isEnabled = null, bool?isReadOnly = null, IDictionary <string, object> attributes = null) { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string textAreaHTMLString = string.Empty; string configKey = string.Empty; Dictionary <string, string> overrideSettings; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetTextAreaOverrideSettings(style, tabIndex, onLeaveFunction, onKeyUpFunction, onKeyDownFunction, onChangeFunction, cssClass); var fillers = ControlPropertyFillerFactory.Get(); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, isEnabled: isEnabled, isReadOnly: isReadOnly, attributes: attributes, configKey: configKey); var textAreapropertyBag = new TextAreaPropertyBag(fillerParams); textAreapropertyBag.Accept(fillers); textAreapropertyBag.ErrorMessage = errMsg; textAreapropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; var textAreaHTMLEmitter = new TextAreaHTMLEmitter(value != null ? value.ToString() : string.Empty, textAreapropertyBag); textAreaHTMLEmitter.Emit(out textAreaHTMLString); return(MvcHtmlString.Create(textAreaHTMLString)); }
public override void Fill(LabelPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.DisplayType = (DisplayType)Enum.Parse(typeof(DisplayType), fillerParams.OverrideSettings[ControlLibConstants.DISPLAY_TYPE], true); propertyBag.IsCurrency = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.IS_CURRENCY]); if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } propertyBag.OverrideToolTip = fillerParams.OverrideSettings[ControlLibConstants.OVERRIDE_TOOLTIP]; } propertyBag.Attributes = fillerParams.Attributes; propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public override void Fill(TextBoxPropertyBag propertyBag, FillerParams fillerParams) { propertyBag.ControlName = fillerParams.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyTextBox); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; propertyBag.ValidationErrorCssClass = controlDefault.ValidationErrorCssClass; propertyBag.ControlErrorCssClass = controlDefault.ControlErrorCssClass; if (propertyBag.AutoCompleteProperties == null) { propertyBag.AutoCompleteProperties = new AutoCompleteBehaviourPropertyBag(new Dictionary<string, string>() { { ControlLibConstants.ACTION_URL, controlDefault.AutoCompleteProperty.ActionURL }, { ControlLibConstants.ACTION_NAME, controlDefault.AutoCompleteProperty.ActionName }, { ControlLibConstants.CONTROLLER_NAME, controlDefault.AutoCompleteProperty.ControllerName}, { ControlLibConstants.MIN_CHAR_REQUIRED, controlDefault.AutoCompleteProperty.MinCharRequired.ToString() }, { ControlLibConstants.MAX_RESULT_COUNT, controlDefault.AutoCompleteProperty.MaxResultCount.ToString() }, { ControlLibConstants.ORDER_BY, controlDefault.AutoCompleteProperty.OrderBy.ToString() }, { ControlLibConstants.SEARCH_TYPE, controlDefault.AutoCompleteProperty.SearchType.ToString() }}); } if (propertyBag.MaskingProperties == null) { propertyBag.MaskingProperties = new MaskingBehaviourPropertyBag(new Dictionary<string, string>() { { "MaskingChar", controlDefault.MaskingProperty.MaskingChar.ToString() }, { "MaskingType", controlDefault.MaskingProperty.MaskingType.ToString() }, { "MaskCharLength", controlDefault.MaskingProperty.MaskCharLength.ToString() }, { "MaskingPosition", controlDefault.MaskingProperty.MaskingPosition.ToString() } }); } } }
public static MvcHtmlString BallyNumericTextBox <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, bool isCurrency = false, bool isAutoComplete = false, StylePropertyBag style = null, short tabIndex = 0, string onLeaveFunction = "", string onKeyUpFunction = "", string onKeyDownFunction = "", string onChangeFunction = "", string cssClass = "", string autoCompleteInputFunction = "", IDictionary <string, object> attributes = null, bool?isEnabled = null, bool?isReadOnly = null) { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string textBoxHTMLString = string.Empty; string configKey = string.Empty; Dictionary <string, string> overrideSettings; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetNumericTextBoxOverrideSettings(isCurrency, style, tabIndex, onLeaveFunction, onKeyUpFunction, onKeyDownFunction, onChangeFunction, cssClass, autoCompleteInputFunction); var fillers = ControlPropertyFillerFactory.Get(); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, attributes: attributes, isEnabled: isEnabled, isReadOnly: isReadOnly, configKey: configKey); var textBoxpropertyBag = new NumericTextBoxPropertyBag(fillerParams); // THe below line of code needs to be placed before calling the Accept() method - dont change this textBoxpropertyBag.AutoComplete = isAutoComplete; textBoxpropertyBag.Accept(fillers); textBoxpropertyBag.ErrorMessage = errMsg; textBoxpropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; value = GetNumericTextBoxMaskingData <TModel>(value, textBoxpropertyBag); var textBoxHTMLEmitter = new NumericTextBoxHTMLEmitter(value != null ? value.ToString() : string.Empty, textBoxpropertyBag); textBoxHTMLEmitter.Emit(out textBoxHTMLString); return(MvcHtmlString.Create(textBoxHTMLString)); }
public override void Fill(TextBoxPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.OnLeaveFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_LEAVE_FUNCTION]; propertyBag.OnKeyUpFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_KEY_UP_FUNCTION]; propertyBag.OnKeyDownFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_KEY_DOWN_FUNCTION]; propertyBag.OnChangeFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CHANGE_FUNCTION]; propertyBag.AutoCompleteInputFunction = fillerParams.OverrideSettings[ControlLibConstants.AUTOCOMPLETE_INPUT_FUNCTION]; if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.Attributes = fillerParams.Attributes; propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public override void Fill(DateTimePropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipBehaviourFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); propertyBag.ShowDate = false; propertyBag.ShowTime = false; if (propertyConfig != null && propertyConfig.PropertyConfiguration != null) { if (propertyConfig.PropertyConfiguration.DateProperties != null) { ///******** Adding config properties to datePropertyBag **********/ propertyBag.DateProperties = propertyConfig.PropertyConfiguration.DateProperties; propertyBag.ShowDate = true; } if (propertyConfig.PropertyConfiguration.TimeProperties != null) { ///******** Adding config properties to datePropertyBag **********/ /// propertyBag.TimeProperties = propertyConfig.PropertyConfiguration.TimeProperties; propertyBag.ShowTime = true; } } } }
public static MvcHtmlString BallyButton <TModel>(this HtmlHelper <TModel> htmlHelper, ButtonType buttonType, string controlName, string parentID, bool validateForm = true, StylePropertyBag style = null, short tabIndex = 0, string onClickFunction = "", string cssClass = "", bool?isEnabled = null, List <Security> taskCodes = null) { object value = string.Empty; string errMsg = string.Empty; string buttonHTMLString = string.Empty; string modelName = htmlHelper.ViewData.Model.GetType().Name; Dictionary <string, string> overrideSettings; overrideSettings = GetButtonOverrideSettings(buttonType, parentID, validateForm, string.Empty, style, tabIndex, onClickFunction, cssClass: cssClass); var fillers = ControlPropertyFillerFactory.Get(); FillerParams fillerParams = new FillerParams(modelName, controlName, overrideSettings, isEnabled: isEnabled, userTaskCodes: taskCodes); var buttonpropertyBag = new ButtonPropertyBag(fillerParams); buttonpropertyBag.ButtonCatagory = ButtonCatagory.BallyButton; buttonpropertyBag.Accept(fillers); buttonpropertyBag.ErrorMessage = errMsg; buttonpropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; var buttonHTMLEmitter = new ButtonHTMLEmitter(value != null ? value.ToString() : string.Empty, buttonpropertyBag); buttonHTMLEmitter.Emit(out buttonHTMLString); return(MvcHtmlString.Create(buttonHTMLString)); }
public static MvcHtmlString BallyCheckBoxList <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, ItemDataSource dataSource, int listLength = -1, string[] disabled = null, StylePropertyBag style = null, short tabIndex = 0, string onClickFunction = "", bool isVerticalAllign = false, string cssClass = "") { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string chkBoxListHTMLString = string.Empty; Dictionary <string, string> overrideSettings; string configKey = string.Empty; CheckBoxListHTMLEmitter checkBoxListHTMLEmitter; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetCheckBoxListOverrideSettings(listLength, style, tabIndex, onClickFunction, isVerticalAllign, value, cssClass); FillerParams fillerParams = null; if (dataSource != null) { fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: dataSource.DataSource, valueMember: dataSource.ValueMember, displayMember: dataSource.DisplayMember, configKey: configKey); } else { fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: null, valueMember: string.Empty, displayMember: string.Empty, configKey: configKey); } var fillers = ControlPropertyFillerFactory.Get(); var chkListpropertyBag = new CheckBoxListPropertyBag(fillerParams); chkListpropertyBag.Accept(fillers); chkListpropertyBag.ErrorMessage = errMsg; chkListpropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; checkBoxListHTMLEmitter = new CheckBoxListHTMLEmitter(value != null ? value.ToString() : string.Empty, chkListpropertyBag); checkBoxListHTMLEmitter.Emit(out chkBoxListHTMLString); return(MvcHtmlString.Create(chkBoxListHTMLString)); }
public override void Fill(NumericTextBoxPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipBehaviourFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); //propertyBag.AutoComplete = false; propertyBag.Masking = false; if (propertyConfig != null && propertyConfig.PropertyConfiguration != null) { if (propertyConfig.PropertyConfiguration.AutoCompleteProperties != null && propertyBag.AutoComplete) { propertyBag.AutoCompleteProperties = new AutoCompleteBehaviourPropertyBag(new Dictionary<string, string>() { { ControlLibConstants.ACTION_URL, propertyConfig.PropertyConfiguration.AutoCompleteProperties.ActionURL }, { ControlLibConstants.ACTION_NAME, propertyConfig.PropertyConfiguration.AutoCompleteProperties.ActionName }, { ControlLibConstants.CONTROLLER_NAME, propertyConfig.PropertyConfiguration.AutoCompleteProperties.ControllerName}, { ControlLibConstants.MIN_CHAR_REQUIRED, propertyConfig.PropertyConfiguration.AutoCompleteProperties.MinCharRequired > 0 ? propertyConfig.PropertyConfiguration.AutoCompleteProperties.MinCharRequired.ToString() : propertyBag.AutoCompleteProperties.MinCharRequired.ToString()}, { ControlLibConstants.MAX_RESULT_COUNT, propertyConfig.PropertyConfiguration.AutoCompleteProperties.MaxResultCount > 0 ? propertyConfig.PropertyConfiguration.AutoCompleteProperties.MaxResultCount.ToString() : propertyBag.AutoCompleteProperties.MaxResultCount.ToString() }, { ControlLibConstants.ORDER_BY, propertyConfig.PropertyConfiguration.AutoCompleteProperties.OrderBy.ToString() }, { ControlLibConstants.SEARCH_TYPE, propertyConfig.PropertyConfiguration.AutoCompleteProperties.SearchType.ToString() }}); //propertyBag.AutoComplete = true; } if (propertyConfig.PropertyConfiguration.MaskingProperties != null) { propertyBag.MaskingProperties = new MaskingBehaviourPropertyBag(new Dictionary<string, string>() { { ControlLibConstants.MASKING_CHAR, !string.IsNullOrEmpty(propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString()) ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString() : propertyBag.MaskingProperties.MaskingChar.ToString() }, { ControlLibConstants.MASKING_TYPE, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingType.ToString() }, { ControlLibConstants.MASKING_CHAR_LENGTH, propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength > 0 ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength.ToString() : propertyBag.MaskingProperties.MaskCharLength.ToString() }, { ControlLibConstants.MASKING_POSITION, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingPosition.ToString() } }); } } } }
public override void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParams) { //Filling implementation code if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.ActionUrl = fillerParams.OverrideSettings[ControlLibConstants.ACTION_URL]; propertyBag.ValueMember = fillerParams.OverrideSettings[ControlLibConstants.VALUE_MEMBER]; propertyBag.DisplayMember = fillerParams.OverrideSettings[ControlLibConstants.DISPLAY_MEMBER]; propertyBag.OnChangeFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CHANGE_FUNCTION]; propertyBag.ShuttleParam = fillerParams.InputParam; if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public override void Fill(NumericTextBoxPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipSecurityFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); if (propertyConfig != null && propertyConfig.PropertyConfiguration != null) { IAccessPolicy accessSecurity = GetAccess(propertyConfig.PropertyConfiguration.Security); if (accessSecurity != null) { propertyBag.Enabled = accessSecurity.Enabled; propertyBag.ReadOnly = accessSecurity.ReadOnly; propertyBag.Masking = accessSecurity.Masking; propertyBag.Visibility = accessSecurity.Visibility; } } else { setDefalutSecurity(propertyBag); } } else { setDefalutSecurity(propertyBag); } }
public static MvcHtmlString BallyGrid <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string valueMember, string GridDataColumnDefinitionName, IDictionary <string, object> gridParam = null, string hiddenColumns = "", string actionUrl = "", StylePropertyBag style = null, short tabIndex = 0, int pageSize = 10, int gridHeight = 400, bool enableFilter = false, bool enableSorting = false, bool enableExport = false, bool pagination = true, bool serverPagination = false, bool selectOption = true, string defaultSortField = "", string imageSizeClass = "", string statusProperty = "", string onDataRowSelectFunction = "", string onDataRowSelectionChangeFunctionName = "", string cssClass = "") { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string controlHtmlString = string.Empty; string configKey = string.Empty; Dictionary <string, string> overrideSettings; GridHTMLEmitter controlHtmlEmitter; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetGridOverrideSettings(valueMember, actionUrl, style, tabIndex, onDataRowSelectFunction, onDataRowSelectionChangeFunctionName, value, GridDataColumnDefinitionName, hiddenColumns, pageSize, gridHeight, enableFilter, enableSorting, enableExport, pagination, serverPagination, selectOption, defaultSortField, imageSizeClass, statusProperty, cssClass); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, inputParam: gridParam, configKey: configKey); var fillers = ControlPropertyFillerFactory.Get(); var controlPropertyBag = new GridPropertyBag(fillerParams); controlPropertyBag.Accept(fillers); controlPropertyBag.ErrorMessage = errMsg; controlPropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; controlHtmlEmitter = new GridHTMLEmitter(value != null ? value.ToString() : string.Empty, controlPropertyBag); controlHtmlEmitter.Emit(out controlHtmlString); return(MvcHtmlString.Create(controlHtmlString)); }
public static MvcHtmlString BallyCheckBox <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, StylePropertyBag style = null, short tabIndex = 0, string onClickFunction = "", string cssClass = "", IDictionary <string, object> attributes = null, bool?isEnabled = null) { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string checkBoxHTMLString = string.Empty; string configKey = string.Empty; Dictionary <string, string> overrideSettings; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); if (value == null) { value = false; } overrideSettings = GetCheckBoxOverrideSettings(style, tabIndex, onClickFunction, cssClass); var fillers = ControlPropertyFillerFactory.Get(); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, attributes: attributes, isEnabled: isEnabled, configKey: configKey); var checkBoxpropertyBag = new CheckBoxPropertyBag(fillerParams); checkBoxpropertyBag.Accept(fillers); checkBoxpropertyBag.ErrorMessage = errMsg; checkBoxpropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; var checkBoxHTMLEmitter = new CheckBoxHTMLEmitter(value != null ? value.ToString() : string.Empty, checkBoxpropertyBag); checkBoxHTMLEmitter.Emit(out checkBoxHTMLString); return(MvcHtmlString.Create(checkBoxHTMLString)); }
public override void Fill(ButtonPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.OnClickFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CLICK_FUNCTION]; propertyBag.ParentID = fillerParams.OverrideSettings[ControlLibConstants.PARENT_ID]; propertyBag.ValidateForm = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.VALIDATE_FORM]); propertyBag.ActionName = fillerParams.OverrideSettings[ControlLibConstants.ACTION_NAME]; propertyBag.ImagePath = fillerParams.OverrideSettings[ControlLibConstants.IMAGE_PATH]; propertyBag.ButtonType = (ButtonType)Enum.Parse(typeof(ButtonType), fillerParams.OverrideSettings[ControlLibConstants.BUTTON_TYPE]); propertyBag.AlignLeft = fillerParams.AlignLeft; if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public static MvcHtmlString BallyShuttleList <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string actionUrl, string valueMember, string displayMember, IDictionary <string, object> shuttleParam = null, StylePropertyBag style = null, short tabIndex = 0, string onChangeFunction = "", string cssClass = "") { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string controlHTMLString = string.Empty; Dictionary <string, string> overrideSettings; string configKey = string.Empty; ShuttleHTMLEmitter controlHTMLEmitter; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetBallyShuttleListOverrideSettings(actionUrl, valueMember, displayMember, style, tabIndex, onChangeFunction, value, cssClass); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, inputParam: shuttleParam, configKey: configKey); var fillers = ControlPropertyFillerFactory.Get(); var controlpropertyBag = new ShuttlePropertyBag(fillerParams); controlpropertyBag.Accept(fillers); controlpropertyBag.ErrorMessage = errMsg; controlpropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; controlHTMLEmitter = new ShuttleHTMLEmitter(value != null ? value.ToString() : string.Empty, controlpropertyBag); controlHTMLEmitter.Emit(out controlHTMLString); return(MvcHtmlString.Create(controlHTMLString)); }
public static MvcHtmlString BallyLabel <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, StylePropertyBag style = null, string cssClass = "", IDictionary <string, object> attributes = null) { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string labelHTMLString = string.Empty; string configKey = string.Empty; Dictionary <string, string> overrideSettings; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey, false); overrideSettings = GetLabelOverrideSettings(DisplayType.Label, style, cssClass: cssClass); var fillers = ControlPropertyFillerFactory.Get(); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, attributes: attributes, configKey: configKey); var labelPropertyBag = new LabelPropertyBag(fillerParams); labelPropertyBag.Accept(fillers); var labelHTMLEmitter = new LabelHTMLEmitter(value != null ? value.ToString() : string.Empty, labelPropertyBag); labelHTMLEmitter.Emit(out labelHTMLString); return(MvcHtmlString.Create(labelHTMLString)); }
public override void Fill(CheckBoxPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.OnClickFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CLICK_FUNCTION]; propertyBag.Attributes = fillerParams.Attributes; if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public override void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParams) { //Filling implementation code if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.IsVerticalAllign = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.IS_VERTICAL_ALLIGN]); propertyBag.ListDisplayLength = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.LIST_LENGTH]); propertyBag.OnClickFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CLICK_FUNCTION]; propertyBag.ListItem = ControlHelper.GetOptions(fillerParams.List, fillerParams.ValueMember, fillerParams.DisplayMember, fillerParams.OverrideSettings[ControlLibConstants.SELECTED_VALUE], fillerParams.Disabled); if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public override void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParam) { propertyBag.ControlName = fillerParam.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyShuttle); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; propertyBag.ValidationErrorCssClass = controlDefault.ValidationErrorCssClass; propertyBag.ControlErrorCssClass = controlDefault.ControlErrorCssClass; } }
public override void Fill(TemplateDropDownPropertyBag propertyBag, FillerParams fillerParam) { propertyBag.ControlName = fillerParam.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyTemplateDropDown); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; propertyBag.ValidationErrorCssClass = controlDefault.ValidationErrorCssClass; propertyBag.ControlErrorCssClass = controlDefault.ControlErrorCssClass; //propertyBag.ListTemplateCssClass = controlDefault.ListTemplateCssClass; } }
public override void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams) { propertyBag.ControlName = fillerParams.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyDenomList); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; propertyBag.HeaderCssClass = controlDefault.DenomHeaderCssClass; propertyBag.FooterCssClass = controlDefault.DenomFooterCssClass; propertyBag.ValidationErrorCssClass = controlDefault.ValidationErrorCssClass; } }
private void fillValidators(ControlPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipValidationFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); if (propertyConfig != null) { propertyBag.Mandatory = false; var isHavingConfigKey = false; if (propertyConfig.PropertyConfiguration != null && propertyConfig.PropertyConfiguration.Validators != null) { propertyBag.Validators = propertyConfig.PropertyConfiguration.Validators; if (propertyConfig.PropertyConfiguration.SiteConfig != null && propertyConfig.PropertyConfiguration.SiteConfig.Count > 0) { var siteConfig = propertyConfig.PropertyConfiguration.SiteConfig.Find(o => o.SiteConfigType == SiteConfigType.Mandatory); if (siteConfig != null) { ISiteConfigSetting siteConfigSetting = this.GetSiteConfigSetting(siteConfig.ConfigKey); if (siteConfigSetting != null) { if (siteConfigSetting.ConfigValue == true) { propertyBag.Mandatory = true; } isHavingConfigKey = true; } } } if (!isHavingConfigKey && propertyBag.Mandatory == false) { if (propertyBag.Validators != null && propertyBag.Validators.Count > 0) { var requiredValidation = propertyBag.Validators.Find(o => o.Type == ValidatorsType.Required); if (requiredValidation != null) { propertyBag.Mandatory = true; } } } } } } }
public override void Fill(ButtonPropertyBag propertyBag, FillerParams fillerParams) { propertyBag.ControlName = fillerParams.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration((ControlNames)Enum.Parse(typeof(ControlNames), Convert.ToString(propertyBag.ButtonCatagory))); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; if (propertyBag.ButtonCatagory == ButtonCatagory.BallyImageButton) { propertyBag.ImageButtonDisableClass = controlDefault.ImageButtonDisableClass; propertyBag.ImageButtonLabelDisableClass = controlDefault.ImageButtonLabelDisableClass; propertyBag.ImageButtonLeftAlignClass = controlDefault.ImageButtonLeftAlignClass; propertyBag.ImageClass = controlDefault.ImageClass; } } }
public override void Fill(LabelPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipBehaviourFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); propertyBag.Masking = false; if (propertyConfig != null && propertyConfig.PropertyConfiguration != null) { if (propertyConfig.PropertyConfiguration.MaskingProperties != null) { propertyBag.MaskingProperties = new MaskingBehaviourPropertyBag(new Dictionary<string, string>() { {ControlLibConstants.MASKING_CHAR, !string.IsNullOrEmpty(propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString()) ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString() : propertyBag.MaskingProperties.MaskingChar.ToString() }, { ControlLibConstants.MASKING_TYPE, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingType.ToString() }, { ControlLibConstants.MASKING_CHAR_LENGTH, propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength > 0 ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength.ToString() : propertyBag.MaskingProperties.MaskCharLength.ToString() }, { ControlLibConstants.MASKING_POSITION, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingPosition.ToString() } }); } } } }
public override void Fill(TemplateListPropertyBag propertyBag, FillerParams fillerParams) { //Filling implementation code if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.ListItem = ControlHelper.GetListItems(fillerParams.List, fillerParams.ValueMember, fillerParams.Param); propertyBag.ListDisplayLength = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.LIST_LENGTH]); propertyBag.OnClickFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CLICK_FUNCTION]; propertyBag.TemplateNameKey = fillerParams.OverrideSettings[ControlLibConstants.TEMPLATE_NAME_KEY]; if (!string.IsNullOrEmpty(fillerParams.OverrideSettings[ControlLibConstants.LISTITEM_TEMPLATE_CSSCLASS])) { propertyBag.ListItemTemplateCssClass = fillerParams.OverrideSettings[ControlLibConstants.LISTITEM_TEMPLATE_CSSCLASS]; } if (!string.IsNullOrEmpty(fillerParams.OverrideSettings[ControlLibConstants.LISTITEM_SELECTED_CSSCLASS])) { propertyBag.ListItemSelectedCssClass = fillerParams.OverrideSettings[ControlLibConstants.LISTITEM_SELECTED_CSSCLASS]; } IControlTemplateConfiguration templateObject = ControlLibraryConfig.ControlConfigReader.GetTemplateConfiguration(fillerParams.TemplateNameKey); if (templateObject != null) { propertyBag.TemplateHTML = templateObject.TemplateHTML; } if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
private void SetVisibility(ControlPropertyBag propertyBag, FillerParams fillerParams) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); if (propertyConfig != null && propertyConfig.PropertyConfiguration != null && propertyConfig.PropertyConfiguration.SiteConfig != null && propertyConfig.PropertyConfiguration.SiteConfig.Count > 0) { var siteConfig = propertyConfig.PropertyConfiguration.SiteConfig.Find(o => o.SiteConfigType == SiteConfigType.Visible); if (siteConfig != null) { ISiteConfigSetting siteConfigSetting = this.GetSiteConfigSetting(siteConfig.ConfigKey); if (siteConfigSetting != null) { if (siteConfigSetting.ConfigValue == false) { propertyBag.Visibility = false; } } } } }
public override void Fill(LabelPropertyBag propertyBag, FillerParams fillerParams) { propertyBag.ControlName = fillerParams.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyLabel); if (controlDefault != null) { propertyBag.MandatoryChar = controlDefault.MandatoryChar; propertyBag.MandatoryCharCssClass = controlDefault.MandatoryCssClass; propertyBag.CssClass = controlDefault.CssClass; if (propertyBag.MaskingProperties == null) { propertyBag.MaskingProperties = new MaskingBehaviourPropertyBag(new Dictionary<string, string>() { { ControlLibConstants.MASKING_CHAR, controlDefault.MaskingProperty.MaskingChar.ToString() }, { ControlLibConstants.MASKING_TYPE, controlDefault.MaskingProperty.MaskingType.ToString() }, { ControlLibConstants.MASKING_CHAR_LENGTH, controlDefault.MaskingProperty.MaskCharLength.ToString() }, { ControlLibConstants.MASKING_POSITION, controlDefault.MaskingProperty.MaskingPosition.ToString() } }); } } }
public override void Fill(LabelPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipBehaviourFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); propertyBag.Masking = false; if (propertyConfig != null && propertyConfig.PropertyConfiguration != null) { if (propertyConfig.PropertyConfiguration.MaskingProperties != null) { propertyBag.MaskingProperties = new MaskingBehaviourPropertyBag(new Dictionary <string, string>() { { ControlLibConstants.MASKING_CHAR, !string.IsNullOrEmpty(propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString()) ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString() : propertyBag.MaskingProperties.MaskingChar.ToString() }, { ControlLibConstants.MASKING_TYPE, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingType.ToString() }, { ControlLibConstants.MASKING_CHAR_LENGTH, propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength > 0 ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength.ToString() : propertyBag.MaskingProperties.MaskCharLength.ToString() }, { ControlLibConstants.MASKING_POSITION, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingPosition.ToString() } }); } } } }
/// <summary> /// /// </summary> /// <param name="htmlHelper"></param> /// <param name="controlName"></param> /// <param name="denomTemplateName"></param> /// <param name="dataSource"></param> /// <param name="tenderInfoParam"></param> /// <param name="actionUrl"></param> /// <param name="style"></param> /// <param name="onRowSelectFunction"></param> /// <param name="headerCssClass"></param> /// <param name="footerCssClass"></param> /// <param name="grantTotalRequired"></param> /// <param name="cssClass"></param> /// <param name="otherAmountRequired"></param> /// <param name="otherAmountPosition"></param> /// <param name="otherAmountLabelKey"></param> /// <param name="isViewMode"></param> /// <param name="validationMessageKey"></param> /// <param name="denomMode"></param> /// <param name="undefinedRowReadonlyColumns">Readonly columns name with , seperated</param> /// <returns></returns> public static MvcHtmlString BallyTenderInfoList(this HtmlHelper htmlHelper, string controlName, string denomTemplateName, DenomDataSource dataSource, IDictionary<string, object> tenderInfoParam = null, string actionUrl = "", StylePropertyBag style = null, string onRowSelectFunction = "", string headerCssClass = "", string footerCssClass = "", bool grantTotalRequired = true, string cssClass = "", bool otherAmountRequired = false, PositionType otherAmountPosition = PositionType.Bottom, string otherAmountLabelKey = "other_amount", bool isViewMode = false, string validationMessageKey = "", DenomModeType denomMode = DenomModeType.Full, string undefinedRowReadonlyColumns = "", string undefinedRowEditableColumns = "", bool movementIndicatorRequired = false, string movementIndicatorColumn="") { string propertyName = controlName; string modelName = string.Empty; string controlHtmlString = string.Empty; Dictionary<string, string> overrideSettings; TenderInfoListHTMLEmitter controlHtmlEmitter; overrideSettings = GetBallyTenderInfoListOverrideSettings(denomTemplateName, style, onRowSelectFunction, headerCssClass, footerCssClass, grantTotalRequired, cssClass, otherAmountRequired, otherAmountLabelKey, actionUrl, otherAmountPosition, isViewMode, validationMessageKey, denomMode, undefinedRowReadonlyColumns, undefinedRowEditableColumns, movementIndicatorRequired, movementIndicatorColumn); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, inputParam: tenderInfoParam); var fillers = ControlPropertyFillerFactory.Get(); var controlPropertyBag = new DenomControlPropertyBag(fillerParams); controlPropertyBag.Accept(fillers); controlHtmlEmitter = new TenderInfoListHTMLEmitter(dataSource, controlPropertyBag); controlHtmlEmitter.Emit(out controlHtmlString); return MvcHtmlString.Create(controlHtmlString); }
/// <summary> /// /// </summary> /// <param name="htmlHelper"></param> /// <param name="controlName"></param> /// <param name="denomTemplateName"></param> /// <param name="dataSource"></param> /// <param name="tenderInfoParam"></param> /// <param name="actionUrl"></param> /// <param name="style"></param> /// <param name="onRowSelectFunction"></param> /// <param name="headerCssClass"></param> /// <param name="footerCssClass"></param> /// <param name="grantTotalRequired"></param> /// <param name="cssClass"></param> /// <param name="otherAmountRequired"></param> /// <param name="otherAmountPosition"></param> /// <param name="otherAmountLabelKey"></param> /// <param name="isViewMode"></param> /// <param name="validationMessageKey"></param> /// <param name="denomMode"></param> /// <param name="undefinedRowReadonlyColumns">Readonly columns name with , seperated</param> /// <returns></returns> public static MvcHtmlString BallyTenderInfoList(this HtmlHelper htmlHelper, string controlName, string denomTemplateName, DenomDataSource dataSource, IDictionary <string, object> tenderInfoParam = null, string actionUrl = "", StylePropertyBag style = null, string onRowSelectFunction = "", string headerCssClass = "", string footerCssClass = "", bool grantTotalRequired = true, string cssClass = "", bool otherAmountRequired = false, PositionType otherAmountPosition = PositionType.Bottom, string otherAmountLabelKey = "other_amount", bool isViewMode = false, string validationMessageKey = "", DenomModeType denomMode = DenomModeType.Full, string undefinedRowReadonlyColumns = "", string undefinedRowEditableColumns = "", bool movementIndicatorRequired = false, string movementIndicatorColumn = "") { string propertyName = controlName; string modelName = string.Empty; string controlHtmlString = string.Empty; Dictionary <string, string> overrideSettings; TenderInfoListHTMLEmitter controlHtmlEmitter; overrideSettings = GetBallyTenderInfoListOverrideSettings(denomTemplateName, style, onRowSelectFunction, headerCssClass, footerCssClass, grantTotalRequired, cssClass, otherAmountRequired, otherAmountLabelKey, actionUrl, otherAmountPosition, isViewMode, validationMessageKey, denomMode, undefinedRowReadonlyColumns, undefinedRowEditableColumns, movementIndicatorRequired, movementIndicatorColumn); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, inputParam: tenderInfoParam); var fillers = ControlPropertyFillerFactory.Get(); var controlPropertyBag = new DenomControlPropertyBag(fillerParams); controlPropertyBag.Accept(fillers); controlHtmlEmitter = new TenderInfoListHTMLEmitter(dataSource, controlPropertyBag); controlHtmlEmitter.Emit(out controlHtmlString); return(MvcHtmlString.Create(controlHtmlString)); }
public static MvcHtmlString BallyLabel(this HtmlHelper htmlHelper, string controlID, string externalizationKey, bool isMandatory = false, StylePropertyBag style = null, string cssClass = "", IDictionary <string, object> attributes = null) { string propertyName = controlID; string modelName = string.Empty; string labelHTMLString = string.Empty; Dictionary <string, string> overrideSettings; overrideSettings = GetLabelOverrideSettings(DisplayType.Label, style, cssClass: cssClass); var fillers = ControlPropertyFillerFactory.Get(); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, skipBehaviourFill: true, skipSecurityFill: true, skipValidationFill: true, isBindingControl: false, externalizationKey: externalizationKey, attributes: attributes); var labelPropertyBag = new LabelPropertyBag(fillerParams); labelPropertyBag.Accept(fillers); labelPropertyBag.IsMandatory = isMandatory; labelPropertyBag.IsBindingControl = false; var labelHTMLEmitter = new LabelHTMLEmitter(string.Empty, labelPropertyBag); labelHTMLEmitter.Emit(out labelHTMLString); return(MvcHtmlString.Create(labelHTMLString)); }
public override void Fill(TextBoxPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipBehaviourFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); //propertyBag.AutoComplete = false; propertyBag.Masking = false; if (propertyConfig != null && propertyConfig.PropertyConfiguration != null) { if (propertyConfig.PropertyConfiguration.AutoCompleteProperties != null && propertyBag.AutoComplete) { propertyBag.AutoCompleteProperties = new AutoCompleteBehaviourPropertyBag(new Dictionary <string, string>() { { ControlLibConstants.ACTION_URL, propertyConfig.PropertyConfiguration.AutoCompleteProperties.ActionURL }, { ControlLibConstants.ACTION_NAME, propertyConfig.PropertyConfiguration.AutoCompleteProperties.ActionName }, { ControlLibConstants.CONTROLLER_NAME, propertyConfig.PropertyConfiguration.AutoCompleteProperties.ControllerName }, { ControlLibConstants.MIN_CHAR_REQUIRED, propertyConfig.PropertyConfiguration.AutoCompleteProperties.MinCharRequired > 0 ? propertyConfig.PropertyConfiguration.AutoCompleteProperties.MinCharRequired.ToString() : propertyBag.AutoCompleteProperties.MinCharRequired.ToString() }, { ControlLibConstants.MAX_RESULT_COUNT, propertyConfig.PropertyConfiguration.AutoCompleteProperties.MaxResultCount > 0 ? propertyConfig.PropertyConfiguration.AutoCompleteProperties.MaxResultCount.ToString() : propertyBag.AutoCompleteProperties.MaxResultCount.ToString() }, { ControlLibConstants.ORDER_BY, propertyConfig.PropertyConfiguration.AutoCompleteProperties.OrderBy.ToString() }, { ControlLibConstants.SEARCH_TYPE, propertyConfig.PropertyConfiguration.AutoCompleteProperties.SearchType.ToString() } }); //propertyBag.AutoComplete = true; } if (propertyConfig.PropertyConfiguration.MaskingProperties != null) { propertyBag.MaskingProperties = new MaskingBehaviourPropertyBag(new Dictionary <string, string>() { { ControlLibConstants.MASKING_CHAR, !string.IsNullOrEmpty(propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString()) ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskingChar.ToString() : propertyBag.MaskingProperties.MaskingChar.ToString() }, { ControlLibConstants.MASKING_TYPE, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingType.ToString() }, { ControlLibConstants.MASKING_CHAR_LENGTH, propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength > 0 ? propertyConfig.PropertyConfiguration.MaskingProperties.MaskCharLength.ToString() : propertyBag.MaskingProperties.MaskCharLength.ToString() }, { ControlLibConstants.MASKING_POSITION, propertyConfig.PropertyConfiguration.MaskingProperties.MaskingPosition.ToString() } }); } } } }
public override void Fill(NumericTextBoxPropertyBag propertyBag, FillerParams fillerParams) { propertyBag.ControlName = fillerParams.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyNumericTextBox); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; propertyBag.ValidationErrorCssClass = controlDefault.ValidationErrorCssClass; propertyBag.ControlErrorCssClass = controlDefault.ControlErrorCssClass; propertyBag.CurrencyFormatString = controlDefault.CurrencyFormatString; if (propertyBag.AutoCompleteProperties == null) { propertyBag.AutoCompleteProperties = new AutoCompleteBehaviourPropertyBag(new Dictionary <string, string>() { { ControlLibConstants.ACTION_URL, controlDefault.AutoCompleteProperty.ActionURL }, { ControlLibConstants.ACTION_NAME, controlDefault.AutoCompleteProperty.ActionName }, { ControlLibConstants.CONTROLLER_NAME, controlDefault.AutoCompleteProperty.ControllerName }, { ControlLibConstants.MIN_CHAR_REQUIRED, controlDefault.AutoCompleteProperty.MinCharRequired.ToString() }, { ControlLibConstants.MAX_RESULT_COUNT, controlDefault.AutoCompleteProperty.MaxResultCount.ToString() }, { ControlLibConstants.ORDER_BY, controlDefault.AutoCompleteProperty.OrderBy.ToString() }, { ControlLibConstants.SEARCH_TYPE, controlDefault.AutoCompleteProperty.SearchType.ToString() } }); } if (propertyBag.MaskingProperties == null) { propertyBag.MaskingProperties = new MaskingBehaviourPropertyBag(new Dictionary <string, string>() { { ControlLibConstants.MASKING_CHAR, controlDefault.MaskingProperty.MaskingChar.ToString() }, { ControlLibConstants.MASKING_TYPE, controlDefault.MaskingProperty.MaskingType.ToString() }, { ControlLibConstants.MASKING_CHAR_LENGTH, controlDefault.MaskingProperty.MaskCharLength.ToString() }, { ControlLibConstants.MASKING_POSITION, controlDefault.MaskingProperty.MaskingPosition.ToString() } }); } } }
public override void Fill(DateTimePropertyBag propertyBag, FillerParams fillerParams) { //Filling implementation code if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.DateProperties.DateFormat = fillerParams.OverrideSettings[ControlLibConstants.DATE_FORMAT]; propertyBag.TimeProperties.ShowAmPm = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.SHOW_AM_PM]); propertyBag.TimeProperties.Step = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.STEP]); propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.OnChangeFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CHANGE_FUNCTION]; propertyBag.ShowDate = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.SHOW_DATE]); propertyBag.ShowTime = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.SHOW_TIME]); propertyBag.DateProperties.YearRange = fillerParams.OverrideSettings[ControlLibConstants.YEAR_RANGE]; propertyBag.DateProperties.MinDate = fillerParams.minDate.HasValue ? fillerParams.minDate.Value.ToShortDateString() : string.Empty; propertyBag.DateProperties.MaxDate = fillerParams.maxDate.HasValue ? fillerParams.maxDate.Value.ToShortDateString() : string.Empty; if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.DATE_CSS_CLASS] != string.Empty) { propertyBag.DateProperties.DateCssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } if (fillerParams.OverrideSettings[ControlLibConstants.TIME_CSS_CLASS] != string.Empty) { propertyBag.TimeProperties.TimeCssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public static MvcHtmlString BallyListBox <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, ItemDataSource dataSource, int listLength = -1, StylePropertyBag style = null, short tabIndex = 0, string onClickFunction = "", string listItemTemplateCssClass = "", string listItemMouseOverCssClass = "", string listItemSelectedCssClass = "") { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string controlHtmlString = string.Empty; Dictionary <string, string> overrideSettings; string configKey = string.Empty; ListBoxHTMLEmitter controlHtmlEmitter; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetBallyListBoxOverrideSettings(listLength, style, tabIndex, onClickFunction, value, listItemTemplateCssClass, listItemMouseOverCssClass, listItemSelectedCssClass); FillerParams fillerParams = null; if (dataSource != null) { string[] displayParam = new string[1]; displayParam[0] = dataSource.DisplayMember; fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: dataSource.DataSource, valueMember: dataSource.ValueMember, param: displayParam, templateKeyName: DefaultTemplate.SimpleListTemplate.ToString(), listType: ListBoxType.SimpleList, configKey: configKey); } else { fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: null, valueMember: string.Empty, param: null, templateKeyName: DefaultTemplate.SimpleListTemplate.ToString(), listType: ListBoxType.SimpleList, configKey: configKey); } var fillers = ControlPropertyFillerFactory.Get(); var controlPropertyBag = new TemplateListPropertyBag(fillerParams); controlPropertyBag.Accept(fillers); controlPropertyBag.ErrorMessage = errMsg; controlPropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; controlHtmlEmitter = new ListBoxHTMLEmitter(value != null ? value.ToString() : string.Empty, controlPropertyBag); controlHtmlEmitter.Emit(out controlHtmlString); return(MvcHtmlString.Create(controlHtmlString)); }
public virtual void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParams) { }
public virtual void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams) { }
public virtual void Fill(PasswordBoxPropertyBag propertyBag, FillerParams fillerParams) { }
public virtual void Fill(LabelPropertyBag propertyBag, FillerParams fillerParams) { }
public virtual void Fill(ButtonPropertyBag propertyBag, FillerParams fillerParams) { }
public override void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParams) { fillValidators(propertyBag, fillerParams); }
public override void Fill(ButtonPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipSecurityFill == false) { IAccessPolicy accessSecurity = null; if (fillerParams.UserTaskCodes != null) { accessSecurity = GetAccess(fillerParams.UserTaskCodes); if (accessSecurity != null) { propertyBag.Enabled = accessSecurity.Enabled; propertyBag.Visibility = accessSecurity.Visibility; } } else { setDefalutSecurity(propertyBag); } } else { setDefalutSecurity(propertyBag); } }
public override void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParams) { fillValidators(propertyBag, fillerParams); }
public virtual void Fill(TemplateListPropertyBag propertyBag, FillerParams fillerParams) { }
public virtual void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParams) { }
public virtual void Fill(GridPropertyBag propertyBag, FillerParams fillerParams) { }
public virtual void Fill(TemplateDropDownPropertyBag propertyBag, FillerParams fillerParams) { }
public override void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams) { setDefalutSecurity(propertyBag); }
public override void Fill(CheckBoxListPropertyBag propertyBag, FillerParams fillerParams) { fillValidators(propertyBag, fillerParams); }
public virtual void Fill(CheckBoxListPropertyBag propertyBag, FillerParams fillerParams) { }
public override void Fill(TextBoxPropertyBag propertyBag, FillerParams fillerParams) { fillValidators(propertyBag, fillerParams); }
public virtual void Fill(DateTimePropertyBag propertyBag, FillerParams fillerParams) { }
public override void Fill(TemplateDropDownPropertyBag propertyBag, FillerParams fillerParams) { fillValidators(propertyBag, fillerParams); }
public ButtonPropertyBag(FillerParams fillerParams) : base(fillerParams) { }
public virtual void Fill(TextBoxPropertyBag propertyBag, FillerParams fillerParams) { }
public ControlPropertyBag(FillerParams fillerParams) { this._fillerParams = fillerParams; this.IsBindingControl = true; }