public IEnumerable <Offer> GetAllPublishedByTypeTake(Parameter.OfferType OfferTypeCode, int Take) { return(_context.Offer.Where(p => p.IsActive == true && p.OfferTypeCode == (int)OfferTypeCode && p.IsDeleted == false && (p.StartDate == null || (p.StartDate <= DateTime.Now)) && (p.EndDate == null || (p.EndDate > DateTime.Now))) .OrderBy(p => p.Order == null ? GlobalVars.OrderMax : p.Order) .ThenBy(p => p.Id).Take(Take).ToList()); }
private void ImageResizing(int OfferTypeCode, string FileName) { Parameter.OfferType OfferType = (Parameter.OfferType)OfferTypeCode; int W = 0; int H = 0; var OriginalPath = PathHelper.Images.OfferPhysc(FileName, Parameter.ImageSizeNaming.Original); var DefaultPath = PathHelper.Images.OfferPhysc(FileName); LIB.ImageHelper imgHelper = new LIB.ImageHelper(); W = (int)Parameter.ImageSizes.Offer_Default_W; H = (int)Parameter.ImageSizes.Offer_Default_H; imgHelper.Crop(OriginalPath, DefaultPath, W, H, true); }
public IEnumerable <Offer> GetAllPublishedByType(Parameter.OfferType OfferTypeCode, int Take) { return(repository.GetAllPublishedByTypeTake(OfferTypeCode, Take)); }