public static AreaInfo Parse(string stringify) { string[] ret = stringify.Split(new char[] { '|' }, 3, StringSplitOptions.None); if (ret.Length != 3) { throw new Exception("格式不正确,AreaInfo:" + stringify); } AreaInfo item = new AreaInfo(); if (string.Compare("null", ret[0]) != 0) { item.Id = uint.Parse(ret[0]); } if (string.Compare("null", ret[1]) != 0) { item.Parent_id = uint.Parse(ret[1]); } if (string.Compare("null", ret[2]) != 0) { item.Name = ret[2].Replace(StringifySplit, "|"); } return(item); }
public static string ToJson(this AreaInfo item) { return(string.Concat(item)); }
public int UnflagArea(AreaInfo Area) => UnflagArea(Area.Id);
public Area_categoryInfo FlagArea(AreaInfo Area) => FlagArea(Area.Id);
public AreaInfo AddArea(AreaInfo item) { item.Parent_id = this.Id; return(item.Save()); }