Пример #1
0
        public void Insert(int?ClassID, string Title, string Content, DateTime?PublishDate, string OperaterName, string Source)
        {
            DDNews item = new DDNews();

            item.ClassID = ClassID;

            item.Title = Title;

            item.Content = Content;

            item.PublishDate = PublishDate;

            item.OperaterName = OperaterName;

            item.Source = Source;


            item.Save(UserName);
        }
Пример #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (CheckAllDate() != DialogResult.OK)
     {
         return;
     }
     try
     {
         DDNews news = new DDNews();
         news.Title   = this.tbxTitle.Text;
         news.ClassID = Convert.ToInt32(this.cbxClass.SelectedValue);
         news.Content = this.rtbContent.Text;
         //news.OperaterName = MainForm.AccountName;
         news.Save();
         MessageBox.Show(this, "添加成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch
     {
         MessageBox.Show(this, "添加失败!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #3
0
        public void Update(int NewsID, int?ClassID, string Title, string Content, DateTime?PublishDate, string OperaterName, string Source)
        {
            DDNews item = new DDNews();

            item.MarkOld();
            item.IsLoaded = true;

            item.NewsID = NewsID;

            item.ClassID = ClassID;

            item.Title = Title;

            item.Content = Content;

            item.PublishDate = PublishDate;

            item.OperaterName = OperaterName;

            item.Source = Source;

            item.Save(UserName);
        }
Пример #4
0
 public bool Destroy(object NewsID)
 {
     return(DDNews.Destroy(NewsID) == 1);
 }
Пример #5
0
 public bool Delete(object NewsID)
 {
     return(DDNews.Delete(NewsID) == 1);
 }