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

            if (string.Compare("null", ret[0]) != 0)
            {
                item.Id = uint.Parse(ret[0]);
            }
            if (string.Compare("null", ret[1]) != 0)
            {
                item.Area_id = uint.Parse(ret[1]);
            }
            if (string.Compare("null", ret[2]) != 0)
            {
                item.Address = ret[2].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[3]) != 0)
            {
                item.Create_time = new DateTime(long.Parse(ret[3]));
            }
            if (string.Compare("null", ret[4]) != 0)
            {
                item.Service_features = ret[4].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[5]) != 0)
            {
                item.Telphone = ret[5].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[6]) != 0)
            {
                item.Title = ret[6].Replace(StringifySplit, "|");
            }
            return(item);
        }
Beispiel #2
0
 public static string ToJson(this ExpressInfo item)
 {
     return(string.Concat(item));
 }
Beispiel #3
0
 public ExpressInfo AddExpress(ExpressInfo item)
 {
     item.Area_id = this.Id;
     return(item.Save());
 }