Exemplo n.º 1
0
        void page_ValidationHandler(ctlPage sender, CommandEventArgs e)
        {
            if (e.CommandArgument == null)
            {
                return;
            }
            var strGroupName = (string)e.CommandArgument;

            if (((MetaValidationGroupName == strGroupName) || (strGroupName == "All")) &&
                MetaValidationRequired)
            {
                //DoValidation
                var errorMessage =
                    CustomValidation.GenericValidation(
                        Checked.ToString(),
                        MetaCaption,
                        MetaMandatory,
                        MetaValidationType.ToString(),
                        MetaValidationErrorCode.ToString(),
                        "ctlRadioButton");
                if (!string.IsNullOrEmpty(errorMessage))
                {
                    sender.ErrorMessage = errorMessage;
                    Attributes.Add("style", StyleConstants.ValidationError);
                }
                else
                {
                    Attributes.Add("style", "");
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Page_s the data load handler.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.CommandEventArgs"/> instance containing the event data.</param>
        void page_DataLoadHandler(ctlPage sender, CommandEventArgs e)
        {
            if (MetaSourceName == null)
            {
                return;
            }

            var data = ((IList <object>)e.CommandArgument).Where(obj => obj.GetType().FullName.Contains(MetaSourceName)).ToList();

            LoadData(data);
        }
Exemplo n.º 3
0
        void page_DataLoadHandler(ctlPage sender, CommandEventArgs e)
        {
            if (string.IsNullOrEmpty(MetaSourceName))
            {
                return;
            }
            var data = ctlPage.GetObjectFromObjectCollection((IList <object>)e.CommandArgument, MetaSourceName);

            DataSource = data;
            DataBind();
            SelectedIndex = -1;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Page_s the data load handler.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.CommandEventArgs"/> instance containing the event data.</param>
        void page_DataLoadHandler(ctlPage sender, CommandEventArgs e)
        {
            if (e.CommandArgument == null)
            {
                return;
            }
            var data = ctlPage.GetObjectFromObjectCollection((IList <object>)e.CommandArgument, MetaSourceName);

            if (data != null)
            {
                var objType  = data.GetType();
                var propInfo = objType.GetProperty(MetaTextField);
                Text = propInfo.GetValue(data, null).ToString();
            }
        }
Exemplo n.º 5
0
        private static string ProcessBreadCrumb(ctlPage parentPage)
        {
            var screenList    = parentPage.MasterPage.GetMenu(parentPage.UserData.RoleId);
            var currentScreen = screenList.FirstOrDefault(x => x.NavigationId.Equals(parentPage.MasterPage.NavigationId));

            if (currentScreen == null)
            {
                return(string.Empty);
            }

            var breadCrumb = new Stack();

            breadCrumb.Push(currentScreen);


            while (currentScreen.ParentId != 0)
            {
                currentScreen = screenList.First(x => x.NavigationId.Equals(currentScreen.ParentId));
                breadCrumb.Push(currentScreen);
            }

            var stringBuilder = new StringBuilder();

            stringBuilder.Append("<li>");
            var totalCrumbs = breadCrumb.Count;

            for (var i = 1; i <= totalCrumbs; i++)
            {
                var screenName = (MenuEntity)breadCrumb.Pop();

                if (i == totalCrumbs)
                {
                    stringBuilder.Append("<span>" + screenName.MenuName + "</span>");
                }
                else
                {
                    stringBuilder.Append(screenName.MenuName);
                    stringBuilder.Append("<i class='fa fa-circle'></i>");
                }
            }

            stringBuilder.Append("</li>");
            return(stringBuilder.ToString());
        }
Exemplo n.º 6
0
        /// <summary>
        /// Page_s the data load handler.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.CommandEventArgs"/> instance containing the event data.</param>
        void page_DataLoadHandler(ctlPage sender, CommandEventArgs e)
        {
            if (e.CommandArgument == null)
            {
                return;
            }
            //below code commented as no MetaSourceName exists as property passed MetaCaption instead - PS
            //var data = sender.GetObjectFromObjectCollection((IList<object>)e.CommandArgument, MetaSourceName);
            var data = ctlPage.GetObjectFromObjectCollection((IList <object>)e.CommandArgument, MetaCaption);

            if (data == null)
            {
                return;
            }
            var objType = data.GetType();
            //below code commented as no MetaTextField exists as property passed MetaCaption instead - PS
            //PropertyInfo propInfo = objType.GetProperty(MetaTextField);
            var propInfo = objType.GetProperty(MetaCaption);

            Text = propInfo.GetValue(data, null).ToString();
        }
Exemplo n.º 7
0
 /// <summary>
 /// Data load handler.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.CommandEventArgs"/> instance containing the event data.</param>
 void page_DataLoadHandler(ctlPage sender, CommandEventArgs e)
 {
     ClearSelection();
 }