public List <String> LoadImageList(Guid contextId, Enums.PhotoCategory PhotoCategoryId) { List <String> images = null; try { List <Photo> PhotoList = SelectAllByPhotoCategoryId(contextId, PhotoCategoryId); if (PhotoList.Count > 0) { images = new List <string>(PhotoList.Count); foreach (Photo _List in PhotoList) { if (File.Exists(System.Web.HttpContext.Current.Server.MapPath(_List.FilePath))) { images.Add(_List.FilePath); } } } } catch (Exception ec) { } return(images); }
public string LoadImage(Guid contextId, Enums.PhotoCategory PhotoCategoryId) { List <String> images = null; string imagePath = "~/Images/Sample/Noimage.jpg"; if (PhotoCategoryId == Enums.PhotoCategory.Cover_Picture) { imagePath = "~/Images/Sample/Bannerimage.jpg"; } if (PhotoCategoryId == Enums.PhotoCategory.Profile_Picture) { imagePath = "~/Images/Sample/Noimage.jpg"; } if (PhotoCategoryId == Enums.PhotoCategory.House_Picture) { imagePath = "~/Images/Sample/House.jpg"; } try { List <Photo> PhotoList = SelectAllByPhotoCategoryId(contextId, PhotoCategoryId); if (PhotoList.Count > 0) { images = new List <string>(PhotoList.Count); foreach (Photo _List in PhotoList) { if (File.Exists(System.Web.HttpContext.Current.Server.MapPath(_List.FilePath))) { imagePath = _List.FilePath; } } } } catch (Exception ec) { } return(imagePath); }
public string LoadHouseImage(Guid contextId, Guid ContextSubId, Enums.ContextSubType ContextSubTypeId, Enums.PhotoCategory PhotoCategoryId) { List <String> images = null; string imagePath = "~/Images/Sample/House.jpg"; try { List <Photo> PhotoList = SelectAllByContextSubTypeId(contextId, ContextSubId, ContextSubTypeId, PhotoCategoryId); if (PhotoList.Count > 0) { images = new List <string>(PhotoList.Count); foreach (Photo _List in PhotoList) { if (File.Exists(System.Web.HttpContext.Current.Server.MapPath(_List.FilePath))) { imagePath = _List.FilePath; } } } } catch (Exception ec) { } return(imagePath); }
public List <Photo> SelectAllByContextSubTypeId(Guid contextId, Guid ContextSubId, Enums.ContextSubType ContextSubTypeId, Enums.PhotoCategory PhotoCategoryId) { return(PhotoDAO.GetAllByFieldValue("ContextId", contextId, "ContextSubId", ContextSubId, ContextSubTypeId, PhotoCategoryId)); }
public List <Photo> SelectAllByPhotoCategoryId(Guid contextId, Enums.PhotoCategory PhotoCategoryId) { return(PhotoDAO.GetAllByFieldValue("ContextId", contextId, PhotoCategoryId)); }
public Photo(Enums.PhotoCategory photoCategory) { PhotoCategoryId = (int)photoCategory; }
public static List <Photo> GetAllByFieldValue(string fieldName, Guid fieldValue, string fieldName2, Guid fieldValue2, Enums.ContextSubType ContextSubTypeId, Enums.PhotoCategory PhotoCategoryId) { List <Photo> returnEntityCollection = new List <Photo>(); Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING); DbCommand dbCommand = db.GetStoredProcCommand("usp_PhotoSelectAllBy" + fieldName2); db.AddInParameter(dbCommand, fieldName, DbType.Guid, fieldValue); db.AddInParameter(dbCommand, fieldName2, DbType.Guid, fieldValue2); db.AddInParameter(dbCommand, "ContextSubTypeId", DbType.Int32, (int)ContextSubTypeId); db.AddInParameter(dbCommand, "PhotoCategoryId", DbType.Int32, (int)PhotoCategoryId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { Photo entity = new Photo(); Utility.Generic.AssignDataReaderToEntity(dataReader, entity); returnEntityCollection.Add(entity); } } return(returnEntityCollection); }