示例#1
0
 protected bool GetData()
 {
     if (!InfoType.ToText().IsIn("1;2"))
     {
         return(false);
     }
     if (InfoType == 1)
     {
         NewsBLL  bll   = new NewsBLL();
         NewsInfo model = bll.GetNewsInfo(NewsId.ToInt(0));
         if (model == null)
         {
             return(false);
         }
         strTitle = model.Title;
         Content  = model.Content;
         AddDate  = (model.AddDate ?? DateTime.Today).ToString("yyyy-MM-dd");
     }
     else if (InfoType == 2)
     {
         VideoBLL  bll   = new VideoBLL();
         VideoInfo model = bll.GetVideoInfo(SafeConvert.ToGuid(NewsId).Value);
         if (model == null)
         {
             return(false);
         }
         strTitle  = model.Title;
         AddDate   = (model.AddDate ?? DateTime.Today).ToString("yyyy-MM-dd");
         VideoPath = model.videopath;
     }
     return(true);
 }