Example #1
0
        public static void ImportJuTuan(string path)
        {
            JuTuan t        = new JuTuan();
            var    list     = TaoBaoImport.Import(t, path);
            var    tempList = new List <JuTuan>(500);

            foreach (var item in list)
            {
                item.Id          = Guid.NewGuid();
                item.CreatedTime = DateTime.Now;
                item.Tags        = item.TypeName.Replace("/", ",");
                tempList.Add(item);
                if (tempList.Count == 500)
                {
                    BLL.JuTuanBLL.BatchInsert(tempList);
                    tempList.Clear();
                }
            }

            if (tempList.Count > 0)
            {
                BLL.JuTuanBLL.BatchInsert(tempList);
            }

            Console.WriteLine("ImportJuTuan done, total count:" + list.Count.ToString());
        }
Example #2
0
        public static JuTuan Insert(JuTuan param)
        {
            var dbContext = new DbContext();
            var id        = dbContext.JuTuanDb.InsertReturnIdentity(param);

            return(GetById(param.Id));
        }
Example #3
0
        public static JuTuan Update(JuTuan param)
        {
            var dbContext = new DbContext();

            dbContext.JuTuanDb.Update(param);
            return(GetById(param.Id));
        }
Example #4
0
        public JuTuan ConvertData()
        {
            JuTuan data = new JuTuan()
            {
                Id       = this.Id,
                GoodName = this.GoodName,
                EndTime  = this.Endime
            };

            return(data);
        }