Пример #1
0
 private void 编辑ToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (selectId != -1)
     {
         LetterModel letter     = LetterBll.GetModelById(selectId);
         FormWriter  formWriter = new FormWriter(letter);
         formWriter.ShowDialog();
     }
 }
Пример #2
0
 private void buttonPrePage_Click(object sender, EventArgs e)
 {
     if (Convert.ToInt32(this.labelPageNum.Text) - 1 < 1)
     {
         return;
     }
     this.labelPageNum.Text        = (Convert.ToInt32(this.labelPageNum.Text) - 1).ToString();
     this.dataGridView1.DataSource = LetterBll.GetListByPage("", "ID asc", (Convert.ToInt32(this.labelPageNum.Text) - 1) * 3 + 1, Convert.ToInt32(this.labelPageNum.Text) * 3);
 }
Пример #3
0
        private void buttonSubmit_Click(object sender, EventArgs e)
        {
            LetterModel letterModel = new LetterModel();

            letterModel.Title    = this.textBoxTitle.Text;
            letterModel.Content  = this.textBoxContent.Text;
            letterModel.Receiver = this.textBoxReceiver.Text;
            letterModel.AddTime  = DateTime.Now;
            if (LetterBll.DealWriter(letterModel))
            {
                changeListEvent();
                MessageBox.Show("发送成功!");
            }
            else
            {
                MessageBox.Show("发送失败", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     this.dataGridView1.DataSource = LetterBll.GetListByPage("", "ID asc", 1, 3);
 }
Пример #5
0
 private void FormWriter_changeListEvent()
 {
     this.dataGridView1.DataSource = LetterBll.GetList("");
 }