public Goods_tagInfo FlagGoods(int?Goods_id) { Goods_tagInfo item = BLL.Goods_tag.GetItem(Goods_id.Value, this.Id.Value); if (item == null) { item = BLL.Goods_tag.Insert(new Goods_tagInfo { Goods_id = Goods_id, Tag_id = this.Id }); } return(item); }
async public Task <Goods_tagInfo> FlagGoodsAsync(int?Goods_id) { Goods_tagInfo item = await BLL.Goods_tag.GetItemAsync(Goods_id.Value, this.Id.Value); if (item == null) { item = await BLL.Goods_tag.InsertAsync(new Goods_tagInfo { Goods_id = Goods_id, Tag_id = this.Id }); } return(item); }
public static Goods_tagInfo Parse(string stringify) { if (string.IsNullOrEmpty(stringify) || stringify == "null") { return(null); } string[] ret = stringify.Split(new char[] { '|' }, 2, StringSplitOptions.None); if (ret.Length != 2) { throw new Exception($"格式不正确,Goods_tagInfo:{stringify}"); } Goods_tagInfo item = new Goods_tagInfo(); if (string.Compare("null", ret[0]) != 0) { item.Goods_id = int.Parse(ret[0]); } if (string.Compare("null", ret[1]) != 0) { item.Tag_id = int.Parse(ret[1]); } return(item); }