예제 #1
0
파일: Add.cs 프로젝트: Liandelong/CRUD
        /// <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);
        }
예제 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            NewsInfoDal newsInfoDal = new NewsInfoDal();

            dataGridView1.DataSource = newsInfoDal.GetNewsList();
        }