public bool Delete(Guid Id) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { ProductPhotosEntity _ProductPhotosEntity = new ProductPhotosEntity(Id); if (adapter.FetchEntity(_ProductPhotosEntity)) { adapter.DeleteEntity(_ProductPhotosEntity); toReturn = true; } } return toReturn; }
ProductPhotosEntity getPhoto() { ProductPhotosEntity photo = new ProductPhotosEntity(); photo.Id = Guid.NewGuid(); photo.ProductId = ProductId; photo.PhotoName = Filter.GetMaxString(txtPhotoName.Text.Trim(), ProductPhotosFields.PhotoName.MaxLength); if (uploadPhoto.HasFile) photo.Path = FileUploadControl.FullPath(uploadPhoto, photo.PhotoName, ProductPhotosFields.Path.MaxLength, EnumsFile.Catalogs); else photo.Path = ""; return photo; }
public bool Update(Guid Id, Guid ProductId, string PhotoName, string Path, bool IsVisible) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { ProductPhotosEntity _ProductPhotosEntity = new ProductPhotosEntity(Id); if (adapter.FetchEntity(_ProductPhotosEntity)) { _ProductPhotosEntity.ProductId = ProductId; _ProductPhotosEntity.PhotoName = PhotoName; _ProductPhotosEntity.Path = Path; _ProductPhotosEntity.IsVisible = IsVisible; adapter.SaveEntity(_ProductPhotosEntity, true); toReturn = true; } } return toReturn; }
public bool Update(ProductPhotosEntity _ProductPhotosEntity, RelationPredicateBucket filter) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.UpdateEntitiesDirectly(_ProductPhotosEntity, filter); toReturn = true; } return toReturn; }
public bool Update(ProductPhotosEntity _ProductPhotosEntity) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { RelationPredicateBucket filter = new RelationPredicateBucket(); IPredicateExpression _PredicateExpression = new PredicateExpression(); _PredicateExpression.Add(ProductPhotosFields.Id == _ProductPhotosEntity.Id); filter.PredicateExpression.Add(_PredicateExpression); adapter.UpdateEntitiesDirectly(_ProductPhotosEntity, filter); toReturn = true; } return toReturn; }
public ProductPhotosEntity SelectOne(Guid Id) { ProductPhotosEntity toReturn = null; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { ProductPhotosEntity _ProductPhotosEntity = new ProductPhotosEntity(Id); if (adapter.FetchEntity(_ProductPhotosEntity)) { toReturn = _ProductPhotosEntity; } } return toReturn; }
public ProductPhotosEntity Insert(Guid ProductId, string PhotoName, string Path, bool IsVisible) { ProductPhotosEntity _ProductPhotosEntity = new ProductPhotosEntity(); using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { _ProductPhotosEntity.ProductId = ProductId; _ProductPhotosEntity.PhotoName = PhotoName; _ProductPhotosEntity.Path = Path; _ProductPhotosEntity.IsVisible = IsVisible; adapter.SaveEntity(_ProductPhotosEntity, true); } return _ProductPhotosEntity; }
public ProductPhotosEntity Insert(ProductPhotosEntity _ProductPhotosEntity) { using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.SaveEntity(_ProductPhotosEntity, true); } return _ProductPhotosEntity; }