Пример #1
0
        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;
            }
        }
Пример #2
0
        public TenderInfoListHTMLEmitter(DenomDataSource dataSource, DenomControlPropertyBag propertyBag)
            : base(propertyBag.Validators, propertyBag.Mandatory)
        {
            this._propertyBag          = propertyBag;
            this._data                 = dataSource != null ? dataSource.DataSource : null;
            this._undefinedColumnName  = dataSource != null ? dataSource.UndefinedColumnName : string.Empty;
            this._undefinedColumnValue = dataSource != null ? dataSource.UndefinedColumnValue : string.Empty;
            this._primaryID            = dataSource.PrimaryKey;
            if (propertyBag.UndefinedRowReadonlyColumns != null && propertyBag.UndefinedRowReadonlyColumns.Length > 0)
            {
                this._undefinedRowReadonlyComunsList = new List <string>(propertyBag.UndefinedRowReadonlyColumns.Split(','));
            }

            if (propertyBag.UndefinedRowEditableColumns != null && propertyBag.UndefinedRowEditableColumns.Length > 0)
            {
                this._undefinedRowEditableComunsList = new List <string>(propertyBag.UndefinedRowEditableColumns.Split(','));
            }
        }
Пример #3
0
        public TenderInfoListHTMLEmitter(DenomDataSource dataSource, DenomControlPropertyBag propertyBag)
            : base(propertyBag.Validators, propertyBag.Mandatory)
        {
            this._propertyBag = propertyBag;
            this._data = dataSource != null ? dataSource.DataSource : null;
            this._undefinedColumnName = dataSource != null ? dataSource.UndefinedColumnName : string.Empty;
            this._undefinedColumnValue = dataSource != null ? dataSource.UndefinedColumnValue : string.Empty;
            this._primaryID = dataSource.PrimaryKey;
            if (propertyBag.UndefinedRowReadonlyColumns != null && propertyBag.UndefinedRowReadonlyColumns.Length > 0)
            {
                this._undefinedRowReadonlyComunsList = new List<string>(propertyBag.UndefinedRowReadonlyColumns.Split(','));
            }

            if (propertyBag.UndefinedRowEditableColumns != null && propertyBag.UndefinedRowEditableColumns.Length > 0)
            {
                this._undefinedRowEditableComunsList = new List<string>(propertyBag.UndefinedRowEditableColumns.Split(','));
            }
        }
        /// <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 override void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams)
        {
            if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0)
            {
                propertyBag.OnRowSelectFunction         = fillerParams.OverrideSettings[ControlLibConstants.DENOM_ON_ROWSELECT_FUNCTION];
                propertyBag.TemplateNameKey             = fillerParams.OverrideSettings[ControlLibConstants.DENOM_TEMPLATE_KEY];
                propertyBag.GrantTotalRequired          = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.DENOM_GRANT_TOTAL_REQUIRED]);
                propertyBag.OtherAmountRequired         = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.DENOM_OTHERAMOUNT_REQUIRED]);
                propertyBag.OtherAmountLabelKey         = fillerParams.OverrideSettings[ControlLibConstants.DENOM_OTHERAMOUNT_LABELKEY];
                propertyBag.IsViewMode                  = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.IS_VIEW_MODE]);
                propertyBag.ValidationMessageKey        = fillerParams.OverrideSettings[ControlLibConstants.VALIDATION_MESSAGE_KEY];
                propertyBag.UndefinedRowReadonlyColumns = fillerParams.OverrideSettings[ControlLibConstants.UNDEFINEDROW_READONLY_COLUMNS];
                propertyBag.UndefinedRowEditableColumns = fillerParams.OverrideSettings[ControlLibConstants.UNDEFINEDROW_EDITABLE_COLUMNS];
                propertyBag.MovementIndicatorColumn     = fillerParams.OverrideSettings[ControlLibConstants.MOVEMENT_INDICATOR_COLUMN];
                propertyBag.MovementIndicatorRequired   = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.MOVEMENT_INDICATOR_REQUIRED]);

                if (fillerParams.OverrideSettings[ControlLibConstants.DENOM_HEADER_CSS] != string.Empty)
                {
                    propertyBag.HeaderCssClass = fillerParams.OverrideSettings[ControlLibConstants.DENOM_HEADER_CSS];
                }
                if (fillerParams.OverrideSettings[ControlLibConstants.DENOM_FOOTER_CSS] != string.Empty)
                {
                    propertyBag.FooterCssClass = fillerParams.OverrideSettings[ControlLibConstants.DENOM_FOOTER_CSS];
                }

                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);
            propertyBag.DenomTemplate = ControlLibraryConfig.ControlConfigReader.GetDenomTemplate(propertyBag.TemplateNameKey);
            //if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.DENOM_PRIMARY_ID))
            //    propertyBag.PrimaryIdMember = fillerParams.OverrideSettings[ControlLibConstants.DENOM_PRIMARY_ID];

            if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.ACTION_URL))
            {
                propertyBag.ActionUrl = fillerParams.OverrideSettings[ControlLibConstants.ACTION_URL];
            }

            if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.OTHER_AMOUNT_POSITION))
            {
                propertyBag.OtherAmountPosition = (PositionType)Enum.Parse(typeof(PositionType), fillerParams.OverrideSettings[ControlLibConstants.OTHER_AMOUNT_POSITION], true);
            }

            if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.DENOM_MODE))
            {
                propertyBag.DenomMode = (DenomModeType)Enum.Parse(typeof(DenomModeType), fillerParams.OverrideSettings[ControlLibConstants.DENOM_MODE], true);
            }

            if (fillerParams.InputParam != null)
            {
                propertyBag.TenderInfoParam = fillerParams.InputParam;
            }
        }
Пример #7
0
 public override void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams)
 {
     setDefalutSecurity(propertyBag);
 }
Пример #8
0
 public override void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams)
 {
     setDefalutSecurity(propertyBag);
 }
Пример #9
0
 public virtual void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams) { }
Пример #10
0
 public virtual void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams)
 {
 }
Пример #11
0
        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;
            }
        }
        public override void Fill(DenomControlPropertyBag propertyBag, FillerParams fillerParams)
        {
            if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0)
            {
                propertyBag.OnRowSelectFunction = fillerParams.OverrideSettings[ControlLibConstants.DENOM_ON_ROWSELECT_FUNCTION];
                propertyBag.TemplateNameKey = fillerParams.OverrideSettings[ControlLibConstants.DENOM_TEMPLATE_KEY];
                propertyBag.GrantTotalRequired = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.DENOM_GRANT_TOTAL_REQUIRED]);
                propertyBag.OtherAmountRequired = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.DENOM_OTHERAMOUNT_REQUIRED]);
                propertyBag.OtherAmountLabelKey = fillerParams.OverrideSettings[ControlLibConstants.DENOM_OTHERAMOUNT_LABELKEY];
                propertyBag.IsViewMode = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.IS_VIEW_MODE]);
                propertyBag.ValidationMessageKey = fillerParams.OverrideSettings[ControlLibConstants.VALIDATION_MESSAGE_KEY];
                propertyBag.UndefinedRowReadonlyColumns = fillerParams.OverrideSettings[ControlLibConstants.UNDEFINEDROW_READONLY_COLUMNS];
                propertyBag.UndefinedRowEditableColumns = fillerParams.OverrideSettings[ControlLibConstants.UNDEFINEDROW_EDITABLE_COLUMNS];
                propertyBag.MovementIndicatorColumn = fillerParams.OverrideSettings[ControlLibConstants.MOVEMENT_INDICATOR_COLUMN];
                propertyBag.MovementIndicatorRequired = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.MOVEMENT_INDICATOR_REQUIRED]);

                if (fillerParams.OverrideSettings[ControlLibConstants.DENOM_HEADER_CSS] != string.Empty)
                {
                    propertyBag.HeaderCssClass = fillerParams.OverrideSettings[ControlLibConstants.DENOM_HEADER_CSS];
                }
                if (fillerParams.OverrideSettings[ControlLibConstants.DENOM_FOOTER_CSS] != string.Empty)
                {
                    propertyBag.FooterCssClass = fillerParams.OverrideSettings[ControlLibConstants.DENOM_FOOTER_CSS];
                }

                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);
            propertyBag.DenomTemplate = ControlLibraryConfig.ControlConfigReader.GetDenomTemplate(propertyBag.TemplateNameKey);
            //if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.DENOM_PRIMARY_ID))
            //    propertyBag.PrimaryIdMember = fillerParams.OverrideSettings[ControlLibConstants.DENOM_PRIMARY_ID];

            if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.ACTION_URL))
                propertyBag.ActionUrl = fillerParams.OverrideSettings[ControlLibConstants.ACTION_URL];

            if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.OTHER_AMOUNT_POSITION))
                propertyBag.OtherAmountPosition = (PositionType)Enum.Parse(typeof(PositionType), fillerParams.OverrideSettings[ControlLibConstants.OTHER_AMOUNT_POSITION], true);

            if (fillerParams.OverrideSettings.ContainsKey(ControlLibConstants.DENOM_MODE))
                propertyBag.DenomMode = (DenomModeType)Enum.Parse(typeof(DenomModeType), fillerParams.OverrideSettings[ControlLibConstants.DENOM_MODE], true);

            if (fillerParams.InputParam != null)
                propertyBag.TenderInfoParam = fillerParams.InputParam;
        }