Exemplo n.º 1
0
 protected void btnAddGoods_Click(object sender, EventArgs e)
 {
     GoodsUnit u = ulogic.GetUnitByID(int.Parse(ddlUnits.SelectedValue));
     Brand b = blogic.GetBrandByID(int.Parse(this.ddlBrand.SelectedValue));
     if (u != null && b != null)
     {
         Goods goods = new Goods();
         goods.Unit = u;
         goods.Brand = b;
         goods.GoodsName = txtGoodsName.Text.Trim();
         goods.UserKey = this.ContextUserKey;
         if (logic.AddGoods(goods))
         {
             ddlUnits.SelectedValue = "-1";
             txtGoodsName.Text = "";
             BindGridView();
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 创建新的 Goods 对象。
 /// </summary>
 /// <param name="id">ID 属性的初始值。</param>
 /// <param name="userKey">UserKey 属性的初始值。</param>
 /// <param name="modified">Modified 属性的初始值。</param>
 /// <param name="goodsName">GoodsName 属性的初始值。</param>
 /// <param name="quantity">Quantity 属性的初始值。</param>
 public static Goods CreateGoods(global::System.Int32 id, global::System.String userKey, global::System.DateTime modified, global::System.String goodsName, global::System.Decimal quantity)
 {
     Goods goods = new Goods();
     goods.ID = id;
     goods.UserKey = userKey;
     goods.Modified = modified;
     goods.GoodsName = goodsName;
     goods.Quantity = quantity;
     return goods;
 }