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

            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.Capacity = 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.Main_business = ret[4].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[5]) != 0)
            {
                item.Min_order = ret[5].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[6]) != 0)
            {
                item.Process_cost = ret[6].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[7]) != 0)
            {
                item.Sampling_period = ret[7].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[8]) != 0)
            {
                item.Sampling_price = ret[8].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[9]) != 0)
            {
                item.Telphone = ret[9].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[10]) != 0)
            {
                item.Title = ret[10].Replace(StringifySplit, "|");
            }
            if (string.Compare("null", ret[11]) != 0)
            {
                item.Turn_single_time = ret[11].Replace(StringifySplit, "|");
            }
            return(item);
        }
Esempio n. 2
0
 public static string ToJson(this FactoryInfo item)
 {
     return(string.Concat(item));
 }
Esempio n. 3
0
 public int UnflagFactory(FactoryInfo Factory) => UnflagFactory(Factory.Id);
Esempio n. 4
0
 public FactoryInfo AddFactory(FactoryInfo item)
 {
     item.Area_id = this.Id;
     return(item.Save());
 }
Esempio n. 5
0
 public Factory_franchisingInfo FlagFactory(FactoryInfo Factory) => FlagFactory(Factory.Id);