public Good(GoodTypes goodType, string name, int currentPrice, int numInStock) { this.goodType = goodType; this.name = name; this.currentPrice = currentPrice; this.numInStock = numInStock; }
public async Task <PaginatedList <Good> > GetWithSpecificType(GoodTypes type) { var goods = getSorted().Where(s => s.Contains(SearchString)).AsNoTracking(); var items = await goods.ToListAsync(); var newList = items.Where(x => x.Type == type).ToList(); var count = newList.Count; var p = new RepositoryPage(count, PageIndex, PageSize); var finalList = newList.Skip(p.FirstItemIndex).Take(p.PageSize).ToList(); return(createList(finalList, p)); }
internal long CreateGroup(GoodGroup group) { using (var db = Base.storeDataBaseContext) { var groupInserting = new GoodTypes { imageUrl = group.imageUrl, info = group.info, name = group.name }; db.GoodTypes.InsertOnSubmit(groupInserting); db.SubmitChanges(); group.id = groupInserting.id; return(groupInserting.id); } }
public static Good Create(string id, string name, string code, string description, string price, GoodTypes type, byte[] imgData = null, string imgName = null, DateTime?validFrom = null, DateTime?validTo = null) { GoodsData o = new GoodsData { ID = id, Name = name, Code = code, Description = description, Type = type, Price = price, ImgData = imgData, ImgName = imgName, ValidFrom = validFrom ?? DateTime.MinValue, ValidTo = validTo ?? DateTime.MaxValue }; return(new Good(o)); }
public DbSet <TEntity> SetOf <TEntity>() where TEntity : Entity { if (Accounts is IEnumerable <TEntity> ) { return(Accounts as DbSet <TEntity>); } else if (Bills is IEnumerable <TEntity> ) { Accounts.Load(); return(Bills as DbSet <TEntity>); } else if (Goods is IEnumerable <TEntity> ) { Importances.Load(); GoodTypes.Load(); return(Goods as DbSet <TEntity>); } else if (Importances is IEnumerable <TEntity> ) { return(Importances as DbSet <TEntity>); } else if (GoodTypes is IEnumerable <TEntity> ) { return(GoodTypes as DbSet <TEntity>); } else if (Users is IEnumerable <TEntity> ) { Bills.Load(); Goods.Load(); return(Users as DbSet <TEntity>); } else { throw new ArgumentException(); } }
public Woman(GoodTypes goodType, string name, int currentPrice, int numInStock) : base(goodType, name, currentPrice, numInStock) { goodType = GoodTypes.Woman; cargoSpaceTaken = 10; }
public Good(string name, decimal price, GoodTypes type) : this(name, price) { Type = new GoodType(type); }
public GoodType(GoodTypes type) { Item = type.ToString(); }