private void frmEditGoods_Load(object sender, EventArgs e) { Dong.BLL.Category catebll = new Dong.BLL.Category(); ddlCategory.DataSource = catebll.GetAllList().Tables[0]; ddlCategory.DisplayMember = "Name"; ddlCategory.ValueMember = "Id"; //绑定单位 Dong.BLL.Unit unitbll = new Dong.BLL.Unit(); ddlUnit.DataSource = unitbll.GetAllList().Tables[0]; ddlUnit.DisplayMember = "Name"; ddlUnit.ValueMember = "Id"; //绑定供应商 Dong.BLL.Supplier supplierbll = new Dong.BLL.Supplier(); ddlSupper.DataSource = supplierbll.GetAllList().Tables[0]; ddlSupper.DisplayMember = "Name"; ddlSupper.ValueMember = "Id"; Dong.BLL.GoodsInfo bll = new Dong.BLL.GoodsInfo(); Dong.Model.GoodsInfo model = new Dong.Model.GoodsInfo(); model = bll.GetModelById(int.Parse(this.Tag.ToString())); if (model != null) { tbCode.Text = model.Code; tbName.Text = model.GoodsName; tbFactory.Text = model.Factory; ddlCategory.SelectedValue = model.Category; ddlUnit.SelectedValue = model.Unit; ddlSupper.SelectedValue = model.Supplier; txtPrice0.Text = model.Price0 == null ? "" : model.Price0.ToString(); txtPrice1.Text = model.Price1 == null ? "" : model.Price1.ToString(); txtPrice2.Text = model.Price2 == null ? "" : model.Price2.ToString(); } }
private void fillGVList() { Dong.BLL.Unit bVip = new Dong.BLL.Unit(); DataSet ds = new DataSet(); ds = bVip.GetAllList(); gvList.DataSource = ds.Tables[0]; if (ds.Tables[0].Rows.Count > 0) { } else { MessageBoxEx.Show("对不起,没有您搜索的记录!"); } }
private void frmAddGoods_Load(object sender, EventArgs e) { //绑定商品类别 Dong.BLL.Category catebll = new Dong.BLL.Category(); ddlCategory.DataSource = catebll.GetAllList().Tables[0]; ddlCategory.DisplayMember = "Name"; ddlCategory.ValueMember = "Id"; //绑定单位 Dong.BLL.Unit unitbll = new Dong.BLL.Unit(); ddlUnit.DataSource = unitbll.GetAllList().Tables[0]; ddlUnit.DisplayMember = "Name"; ddlUnit.ValueMember = "Id"; //绑定供应商 Dong.BLL.Supplier supplierbll = new Dong.BLL.Supplier(); ddlSupper.DataSource = supplierbll.GetAllList().Tables[0]; ddlSupper.DisplayMember = "Name"; ddlSupper.ValueMember = "Id"; }