/// <summary> /// 创建新的 goods_type 对象。 /// </summary> /// <param name="type_id">type_id 的初始值。</param> /// <param name="type_code">type_code 的初始值。</param> /// <param name="type_name">type_name 的初始值。</param> public static goods_type Creategoods_type(int type_id, string type_code, string type_name) { goods_type goods_type = new goods_type(); goods_type.type_id = type_id; goods_type.type_code = type_code; goods_type.type_name = type_name; return(goods_type); }
static void Main(string[] args) { TestContext context = new TestContext(connString); goods_type myType = new goods_type(); myType.type_code = "T001"; myType.type_name = "测试类型1"; context.AddTogoods_type(myType); goods myGoods = new goods(); myGoods.goodsid = "G001"; myGoods.name = "测试货物1"; myGoods.goods_type = myType; context.AddTogoods(myGoods); store myStore = new store(); myStore.store_code = "S001"; myStore.store_name = "测试仓库1"; context.AddTostore(myStore); onhand myOnhand = new onhand(); myOnhand.goods = myGoods; myOnhand.store = myStore; myOnhand.onhand1 = 100; context.AddToonhand(myOnhand); context.SaveChanges(); }
/// <summary> /// 创建新的 goods_type 对象。 /// </summary> /// <param name="type_id">type_id 的初始值。</param> /// <param name="type_code">type_code 的初始值。</param> /// <param name="type_name">type_name 的初始值。</param> public static goods_type Creategoods_type(int type_id, string type_code, string type_name) { goods_type goods_type = new goods_type(); goods_type.type_id = type_id; goods_type.type_code = type_code; goods_type.type_name = type_name; return goods_type; }
/// <summary> /// 架构中不存在 goods_type 的注释。 /// </summary> public void AddTogoods_type(goods_type goods_type) { base.AddObject("goods_type", goods_type); }