Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            NewsInfoDal newInfoDal = new NewsInfoDal();
            NewsInfo    newsInfo   = new NewsInfo();

            newsInfo.NewsConent = textBox1.Text;
            newsInfo.RegTime    = DateTime.Now;
            newsInfo.TypeId     = Convert.ToInt32(comboBox1.SelectedValue);
            newInfoDal.InsertNews(newsInfo);
        }
Esempio n. 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            NewsInfoDal newsInfoDal = new NewsInfoDal();

            dataGridView1.DataSource = newsInfoDal.GetNewsList();
        }