示例#1
0
        public static PattrInfo Parse(string stringify)
        {
            string[] ret = stringify.Split(new char[] { '|' }, 5, StringSplitOptions.None);
            if (ret.Length != 5)
            {
                throw new Exception("格式不正确,PattrInfo:" + stringify);
            }
            PattrInfo item = new PattrInfo();

            if (string.Compare("null", ret[0]) != 0)
            {
                item.Id = uint.Parse(ret[0]);
            }
            if (string.Compare("null", ret[1]) != 0)
            {
                item.Category_id = uint.Parse(ret[1]);
            }
            if (string.Compare("null", ret[2]) != 0)
            {
                item.Parent_id = uint.Parse(ret[2]);
            }
            if (string.Compare("null", ret[3]) != 0)
            {
                item.Is_filter = ret[3] == "1";
            }
            if (string.Compare("null", ret[4]) != 0)
            {
                item.Name = ret[4].Replace(StringifySplit, "|");
            }
            return(item);
        }
示例#2
0
 public int UnflagAttr(PattrInfo Pattr) => UnflagAttr(Pattr.Id);
示例#3
0
 public Product_attrInfo FlagAttr(PattrInfo Pattr, string Value) => FlagAttr(Pattr.Id, Value);
示例#4
0
 public static string ToJson(this PattrInfo item)
 {
     return(string.Concat(item));
 }
示例#5
0
 public PattrInfo AddPattr(PattrInfo item)
 {
     item.Category_id = this.Id;
     return(item.Save());
 }
示例#6
0
 public PattrInfo AddPattr(PattrInfo Pattr, bool?Is_filter, string Name) => AddPattr(Pattr.Id, Is_filter, Name);
示例#7
0
 public PattrInfo AddPattr(PattrInfo item)
 {
     item.Parent_id = this.Id;
     return(item.Save());
 }