Example #1
0
        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);
        }
Example #2
0
 public static string ToJson(this AreaInfo item)
 {
     return(string.Concat(item));
 }
Example #3
0
 public int UnflagArea(AreaInfo Area) => UnflagArea(Area.Id);
Example #4
0
 public Area_categoryInfo FlagArea(AreaInfo Area) => FlagArea(Area.Id);
Example #5
0
 public AreaInfo AddArea(AreaInfo item)
 {
     item.Parent_id = this.Id;
     return(item.Save());
 }