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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
        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));
        }
Esempio n. 8
0
        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));
        }
Esempio n. 9
0
        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));
        }
        /// <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));
        }
Esempio n. 11
0
        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));
        }
Esempio n. 12
0
        public static MvcHtmlString BallyCascadeDropDown <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, NameGenerator controlId, string actionUrl, ItemDataSource dataSource, string[] disabled = null, int listLength = -1, StylePropertyBag style = null, short tabIndex = 0, string onChangeFunction = "", string cssClass = "", string cascadeInputFunction = "", IDictionary <string, object> attributes = null)
        {
            string propertyName       = string.Empty;
            string targetControlID    = controlId.ControlID;
            string modelName          = string.Empty;
            object value              = string.Empty;
            string errMsg             = string.Empty;
            string dropDownHTMLString = string.Empty;
            Dictionary <string, string> overrideSettings;
            string configKey = string.Empty;
            DropDownHTMLEmitter dropDownHTMLEmitter;

            ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey);

            overrideSettings = GetBallyDropdownListOverrideSettings(DropDownType.CascadeSelect, listLength, targetControlID, actionUrl, style, tabIndex, onChangeFunction, value, cssClass, cascadeInputFunction);
            FillerParams fillerParams = null;

            if (dataSource != null)
            {
                fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: dataSource.DataSource, valueMember: dataSource.ValueMember, displayMember: dataSource.DisplayMember, disabled: disabled, attributes: attributes, configKey: configKey);
            }
            else
            {
                fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: null, valueMember: string.Empty, displayMember: string.Empty, disabled: disabled, attributes: attributes, configKey: configKey);
            }

            var fillers             = ControlPropertyFillerFactory.Get();
            var dropDownpropertyBag = new DropDownPropertyBag(fillerParams);

            dropDownpropertyBag.Accept(fillers);
            dropDownpropertyBag.ErrorMessage = errMsg;
            dropDownpropertyBag.IsDirty      = string.IsNullOrEmpty(errMsg) ? false : true;
            dropDownHTMLEmitter = new DropDownHTMLEmitter(value != null ? value.ToString() : string.Empty, dropDownpropertyBag);

            dropDownHTMLEmitter.Emit(out dropDownHTMLString);
            return(MvcHtmlString.Create(dropDownHTMLString));
        }
Esempio n. 13
0
        public static MvcHtmlString BallyDateTimePicker <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, bool showDate = true, bool showTime = true, string dateFormat = "yy-mm-dd", bool showAmPm = false, int step = 5, StylePropertyBag style = null, short tabIndex = 0, string onChangeFunction = "", string dateCssClass = "", string timeCssClass = "", int minYear = -1, int maxYear = -1, DateTime?minDate = null, DateTime?maxDate = null)//bool UTCConversion = true,
        {
            string propertyName       = string.Empty;
            string modelName          = string.Empty;
            object value              = string.Empty;
            string errMsg             = string.Empty;
            string dateTimeHTMLString = string.Empty;
            Dictionary <string, string> overrideSettings;
            string configKey = string.Empty;
            DateTimeHTMLEmitter dateTimeHTMLEmitter;

            ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey);

            overrideSettings = GetBallyDateTimePickerOverrideSettings(showDate, showTime, dateFormat, showAmPm, step, style, tabIndex, onChangeFunction, dateCssClass, timeCssClass, getYearRange(minYear, maxYear));
            var          fillers             = ControlPropertyFillerFactory.Get();
            FillerParams fillerParams        = new FillerParams(modelName, propertyName, overrideSettings, configKey: configKey, minDate: minDate, maxDate: maxDate);
            var          dateTimepropertyBag = new DateTimePropertyBag(fillerParams);

            dateTimepropertyBag.Accept(fillers);
            dateTimepropertyBag.ErrorMessage = errMsg;
            dateTimepropertyBag.IsDirty      = string.IsNullOrEmpty(errMsg) ? false : true;
            //dateTimepropertyBag.UTCDateTime = UTCValue;
            //dateTimepropertyBag.UTCConversion = UTCConversion;
            DateTime dt = DateTime.MinValue;

            if (value != null)
            {
                DateTime.TryParse(value.ToString(), out dt);
                // dateTimepropertyBag.DateTimeKind = dt.Kind; /*Check the values- UTC,LOCAL,Unspecified*/
            }

            // dateTimeHTMLEmitter = new DateTimeHTMLEmitter(!showTime ? ( default(DateTime) == dt ? string.Empty : dt.ToShortDateString()) : (!showDate ? dt.ToShortTimeString() : dt.ToString()), dateTimepropertyBag);
            dateTimeHTMLEmitter = new DateTimeHTMLEmitter(dt.ToString(), dateTimepropertyBag);
            dateTimeHTMLEmitter.Emit(out dateTimeHTMLString);
            return(MvcHtmlString.Create(dateTimeHTMLString));
        }
Esempio n. 14
0
        public static MvcHtmlString BallyTemplateDropDown <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string templateNameKey, ItemDataSource dataSource, int listLength = -1, 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;
            string configKey         = string.Empty;
            Dictionary <string, string> overrideSettings;
            TemplateDropDownHTMLEmitter controlHtmlEmitter;

            ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey);

            overrideSettings = GetBallyMultiColumnDropDownOverrideSettings(templateNameKey, listLength, style, tabIndex, onChangeFunction, value, cssClass);
            FillerParams fillerParams = null;

            if (dataSource != null)
            {
                fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: dataSource.DataSource, valueMember: dataSource.ValueMember, param: dataSource.DisplayParams, templateKeyName: templateNameKey, configKey: configKey);
            }
            else
            {
                fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: null, valueMember: string.Empty, param: null, templateKeyName: templateNameKey, configKey: configKey);
            }

            var fillers            = ControlPropertyFillerFactory.Get();
            var controlPropertyBag = new TemplateDropDownPropertyBag(fillerParams);

            controlPropertyBag.Accept(fillers);
            controlPropertyBag.ErrorMessage = errMsg;
            controlPropertyBag.IsDirty      = string.IsNullOrEmpty(errMsg) ? false : true;
            controlHtmlEmitter = new TemplateDropDownHTMLEmitter(value != null ? value.ToString() : string.Empty, controlPropertyBag);

            controlHtmlEmitter.Emit(out controlHtmlString);
            return(MvcHtmlString.Create(controlHtmlString));
        }
Esempio n. 15
0
        public static MvcHtmlString BallyTextBlock(this HtmlHelper htmlHelper, object value, string controlID, string externalizationKey, bool isCurrency = false, bool masking = false, StylePropertyBag style = null, string cssClass = "", IDictionary <string, object> attributes = null, string toolTip = "")
        {
            string propertyName    = controlID;
            string modelName       = string.Empty;
            string labelHTMLString = string.Empty;
            Dictionary <string, string> overrideSettings;

            overrideSettings = GetLabelOverrideSettings(DisplayType.TextBlock, style, isCurrency: isCurrency, cssClass: cssClass, overrideToolTip: toolTip);

            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.IsBindingControl = false;
            labelPropertyBag.Masking          = masking;
            value = GetLabelMaskingData(propertyName, modelName, value, labelPropertyBag);

            var labelHTMLEmitter = new LabelHTMLEmitter(value != null ? value.ToString() : string.Empty, labelPropertyBag);

            labelHTMLEmitter.Emit(out labelHTMLString);
            return(MvcHtmlString.Create(labelHTMLString));
        }