Пример #1
0
 public static void EventAddToDataBase(EasyCalProj.EasyCalDB.Tasks1 newEvent)
 {
     using (var EasyCal = new EasyCalEntities1())
     {
         EasyCal.Tasks1.Add(newEvent);
         EasyCal.SaveChanges();
     }
 }
Пример #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            var ClickedEvent = new EasyCalProj.EasyCalDB.Tasks1
            {
                TaskName   = textBox4.Text,
                Course     = textBox3.Text,
                Date       = dateTimePicker2.Value,
                SubmitTime = TimeSpan.Parse(comboBox3.Text),
                Status     = "לא בוצע"
            };

            EventAddToDataBase(ClickedEvent);
            MessageBox.Show("מטלה נוספה בהצלחה");
            this.Close();
        }