Пример #1
0
        public string GetValue(Type type, object obj)
        {
            if (!string.IsNullOrWhiteSpace(Attribute?.Format))
            {
                var displayText = Attribute.Format;
                var metas       = DataListHelper.GetDataColumnMeta(type);

                return(FormatPlaceholder.Aggregate(displayText, (current, ph) => current.Replace("{" + ph + "}", metas.First(p => p.Name == ph).GetPlainValue(obj)?.ToString())));
            }

            var value = GetPlainValue(obj)?.ToString();

            if (string.IsNullOrWhiteSpace(value))
            {
                return(value);
            }
            if (ValueMap != null && ValueMap.ContainsKey(value))
            {
                var displayText = ValueMap[value];
                var metas       = DataListHelper.GetDataColumnMeta(type);

                return(ValueMapPlaceholder.Aggregate(displayText, (current, ph) => current.Replace("{" + ph + "}", metas.First(p => p.Name == ph).GetPlainValue(obj)?.ToString())));
            }
            return(value);
        }
 private void LoadPhotoList()
 {
     try
     {
         OtherFunctions obj      = new OtherFunctions();
         DataSet        ds       = obj.GetImageListSlideIndex("ImageSlideIndex", Globals.AgentCatID);
         DataListHelper dlHelper = new DataListHelper();
         if (ds.Tables.Count > 0)
         {
             dlHelper.FillData(DataListImage, ds);
         }
     }
     catch { }
 }
Пример #3
0
 private void LoadPhotoList()
 {
     try
     {
         Gallery obj = new Gallery();
         DataSet ds  = obj.GetAllPhoto("GalleryPhoto", Globals.AgentCatID);
         if (ds.Tables.Count > 0)
         {
             DataListHelper dlHelper = new DataListHelper();
             dlHelper.FillData(DataListPhoto, ds);
         }
     }
     catch { }
 }
Пример #4
0
 private void LoadPhotoList(string Lang, int ProductID)
 {
     try
     {
         Product        obj      = new Product();
         DataSet        ds       = obj.GetImageListOfProduct("ProductImage", ProductID, Globals.AgentCatID);
         DataListHelper dlHelper = new DataListHelper();
         if (ds.Tables.Count > 0)
         {
             dlHelper.FillData(DataListPhoto, ds);
         }
     }
     catch { }
 }
Пример #5
0
 protected void ddlAlbum_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Gallery obj     = new Gallery();
         int     AlbumID = Convert.ToInt32(ddlAlbum.SelectedValue);
         if (AlbumID != 0)
         {
             DataSet ds = obj.GetPhotoByAlbumID("GalleryPhoto", Globals.AgentCatID, AlbumID);
             if (ds.Tables.Count > 0)
             {
                 DataListHelper dlHelper = new DataListHelper();
                 dlHelper.FillData(DataListPhoto, ds);
             }
         }
         else
         {
             LoadPhotoList();
         }
     }
     catch { }
 }