Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Medicine_Data   data    = new Medicine_Data();
            MedicineContext context = new MedicineContext();

            if (richTextBox1.TextLength == 0)
            {
                data.Create_AnMorbi_Record(GlobalVar.selected_reception_ID, Convert.ToInt32(numericUpDown1.Value));
                richTextBox1.Text = "Болеет " + context.AnMorbis.Where(c => c.reception_id == GlobalVar.selected_reception_ID).Select(c => c.count_days).FirstOrDefault().ToString() + " дней";
            }
            else
            {
                data.UpdateAnMorbi_CountDays(GlobalVar.selected_reception_ID, Convert.ToInt32(numericUpDown1.Value));
                richTextBox1.Text = "Болеет " + context.AnMorbis.Where(c => c.reception_id == GlobalVar.selected_reception_ID).Select(c => c.count_days).FirstOrDefault().ToString() + " дней";
            }
        }