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); }
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); } }
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); }
public bool Destroy(object NewsID) { return(DDNews.Destroy(NewsID) == 1); }
public bool Delete(object NewsID) { return(DDNews.Delete(NewsID) == 1); }