public AddGoodsPresenter(AddGoods view, int id) { Categories = new List<ProductCategory>(); Categories.AddRange(service.CategoryDao.GetAll()); this.view = view; if (id < 1) { thisGoods = new Goods() { Category = Categories[0]}; } else { thisGoods = service.GoodsDao.GetById(id); } }
public AddGoodsPresenter(AddGoods view, int id) { foreach (ProductCategory pc in modelCategory.GetAll()) { productCategoryList.Add(pc.CategoryName); } this.view = view; if (id < 1) { thisGoods = new Goods(); } else { thisGoods = model.GetById(id); } }
private void addGoodsBarButton_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var form = new GoodsAll.AddGoods.AddGoods(); form.MdiParent = this; form.Show(); }