Esempio n. 1
0
 /// <summary>
 /// 添加或修改
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Article AddOrUpdate(Article model)
 {
     if (model.ArticleId.IsNull())
     {
         model.ArticleId   = ExtendUtil.GuidToString();
         model.PublishDate = DateTime.Now;
         Session.Insert(model);
     }
     else
     {
         model.PublishDate = DateTime.Now;
         Session.Update(model);
     }
     return(model);
 }
Esempio n. 2
0
 /// <summary>
 /// 添加或修改
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Carousel AddOrUpdate(Carousel model)
 {
     if (model.CarouselId.IsNull())
     {
         model.CarouselId = ExtendUtil.GuidToString();
         model.UpdateTime = DateTime.Now;
         Session.Insert(model);
     }
     else
     {
         model.UpdateTime = DateTime.Now;
         Session.Update(model);
     }
     return(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 添加或修改
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public DailyInfo AddOrUpdate(DailyInfo model)
 {
     if (model.DailyId.IsNull())
     {
         model.DailyId    = ExtendUtil.GuidToString();
         model.UpdateTime = DateTime.Now;
         Session.Insert(model);
     }
     else
     {
         model.UpdateTime = DateTime.Now;
         Session.Update(model);
     }
     return(model);
 }
Esempio n. 4
0
 /// <summary>
 /// 添加或修改
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public Advert AddOrUpdate(Advert model)
 {
     if (model.AdvertId.IsNull())
     {
         model.AdvertId   = ExtendUtil.GuidToString();
         model.UpdateTime = DateTime.Now;
         Session.Insert(model);
     }
     else
     {
         model.UpdateTime = DateTime.Now;
         Session.Update(model);
     }
     return(model);
 }
Esempio n. 5
0
 /// <summary>
 /// 添加或修改
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public FrLink AddOrUpdate(FrLink model)
 {
     if (model.FrLinkId.IsNull())
     {
         model.FrLinkId   = ExtendUtil.GuidToString();
         model.UpdateTime = DateTime.Now;
         Session.Insert(model);
     }
     else
     {
         model.UpdateTime = DateTime.Now;
         Session.Update(model);
     }
     return(model);
 }