public static ObservableCollection <Goods> getGoods() { using (var db = new MeiMeiContext()) { GoodVM _good; _good = GoodVM.Instance; var query = from b in db.TypeOfGoods join ba in db.Goods on b.Id equals ba.TypeOfGoodsId where b.Id == _good.SelectedTypeOfGoods.Id where b.Id == ba.TypeOfGoodsId select ba; if (db.TypeOfGoods.Count() == 0) { Add_Goods addGoods = new Add_Goods(); addGoods.ShowDialog(); } else { return(new ObservableCollection <Goods>(query)); } return(new ObservableCollection <Goods>()); } }
public void AddGoodOpen(object obj) { Add_Goods addGoods = new Add_Goods(); addGoods.ShowDialog(); }