Beispiel #1
0
        public Product_attrInfo FlagAttr(uint?Pattr_id, string Value)
        {
            Product_attrInfo item = Product_attr.GetItem(Pattr_id.Value, this.Id.Value);

            if (item == null)
            {
                item = Product_attr.Insert(new Product_attrInfo {
                    Pattr_id   = Pattr_id,
                    Product_id = this.Id,
                    Value      = Value
                });
            }
            else
            {
                item.UpdateDiy
                .SetValue(Value).ExecuteNonQuery();
            }
            return(item);
        }
Beispiel #2
0
        public static Product_attrInfo Parse(string stringify)
        {
            string[] ret = stringify.Split(new char[] { '|' }, 3, StringSplitOptions.None);
            if (ret.Length != 3)
            {
                throw new Exception("格式不正确,Product_attrInfo:" + stringify);
            }
            Product_attrInfo item = new Product_attrInfo();

            if (string.Compare("null", ret[0]) != 0)
            {
                item.Pattr_id = uint.Parse(ret[0]);
            }
            if (string.Compare("null", ret[1]) != 0)
            {
                item.Product_id = uint.Parse(ret[1]);
            }
            if (string.Compare("null", ret[2]) != 0)
            {
                item.Value = ret[2].Replace(StringifySplit, "|");
            }
            return(item);
        }
Beispiel #3
0
 public static string ToJson(this Product_attrInfo item)
 {
     return(string.Concat(item));
 }