Beispiel #1
0
 public virtual string GetFieldDisplayValue(Durados.Field field, DataRow row, bool forExport)
 {
     if (field.FieldType == FieldType.Children && ((ChildrenField)field).ChildrenHtmlControlType == ChildrenHtmlControlType.CheckList)
     {
         if (DataView == null)
         {
             return(string.Empty);
         }
         if (!checkListTableViewers.ContainsKey(field.Name))
         {
             checkListTableViewers.Add(field.Name, new CheckListTableViewer((ChildrenField)field, DataView));
         }
         Dictionary <string, string> values = checkListTableViewers[field.Name].GetValue(field.View.GetPkValue(row));
         if (values == null)
         {
             return(string.Empty);
         }
         string[] valuesArray = values.Values.ToArray();
         return(valuesArray.Delimited());
     }
     else
     {
         string s = field.ConvertToString(row);
         if (!string.IsNullOrEmpty(s) && forExport && field.FieldType == FieldType.Column && ((ColumnField)field).Rich)
         {
             return(Durados.Web.Mvc.Infrastructure.General.StripTags(s));
         }
         else
         {
             return(s);
         }
     }
 }
Beispiel #2
0
        public virtual string GetDisplayValues(Durados.Field field, DataRow row, bool ignoreChecklistLimit = false)
        {
            if (field.FieldType == FieldType.Children && ((ChildrenField)field).ChildrenHtmlControlType == ChildrenHtmlControlType.CheckList)
            {
                if (DataView == null)
                {
                    return(string.Empty);
                }
                if (!checkListTableViewers.ContainsKey(field.Name))
                {
                    checkListTableViewers.Add(field.Name, new CheckListTableViewer((ChildrenField)field, DataView));
                }
                int limit = ignoreChecklistLimit ? 0 : ((ChildrenField)field).CheckListInTableLimit;

                Dictionary <string, string> values = checkListTableViewers[field.Name].GetValue(field.View.GetPkValue(row));
                if (values == null)
                {
                    return(string.Empty);
                }
                string[] valuesArray = values.Values.ToArray();
                string   title       = valuesArray.Delimited();
                string   display     = title;

                if (limit > 0 && values.Count > limit)
                {
                    valuesArray = valuesArray.Take(limit).ToArray();
                    display     = valuesArray.Delimited();
                }
                return(display);
            }
            else
            {
                return(field.ConvertToString(row));
            }
        }