Пример #1
0
        /// <summary>
        /// This method will call the Gift Resource access class method to get the Image list for the passed Tribute Type
        /// </summary>
        /// <param name="objGiftImage">An object which contain the Tribute type for which wants to  
        ///                             get the Image list</param>
        /// <returns>This method will return the Gifts object which contain the list of Image</returns>
        public List<GiftImage> GetImage(GiftImage objGift)
        {
            try
            {
                GiftResource objGiftRes = new GiftResource();

                return objGiftRes.GetImage(objGift);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// This method will populate the Gift Image object from the dataset
        /// Added By Parul Jain
        /// </summary>
        /// <param name="dsGiftImage">A Dataset object which contain Gift Image data</param>
        /// <returns>This method will return the List of Gift Image object populated with the All Image</returns>
        private List<GiftImage> PopulateGiftImageObject(DataSet dsGiftImage)
        {
            try
            {
                List<GiftImage> lstGiftsImage = new List<GiftImage>();

                string virtalPath = GetPath();

                // Get the User role for the tribute
                if (dsGiftImage.Tables.Count > 0)
                {
                    if (dsGiftImage.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow drGift in dsGiftImage.Tables[0].Rows)
                        {
                            GiftImage objGiftImage = new GiftImage();

                            objGiftImage.ImageId = int.Parse(drGift["ImageId"].ToString());
                            objGiftImage.ImageUrl = virtalPath + drGift["ImageUrl"].ToString();

                            lstGiftsImage.Add(objGiftImage);
                            objGiftImage = null;
                        }
                    }
                }

                return lstGiftsImage;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }