Example #1
0
        private void UpdateTable_Click(object sender, EventArgs e)
        {
            RefreshData();
            PatientResults.Update();

            PatientResults.Columns[0].Width   = 110;
            PatientResults.Columns[1].Width   = 232;
            PatientResults.Columns[2].Visible = false;
        }
Example #2
0
        private void PatientDataForm_Load(object sender, EventArgs e)
        {
            PatientName.Text      = Patient.FullName;
            PatientBirthDate.Text = Patient.BirthDate.ToShortDateString();

            if (Patient.Male == Male.Female)
            {
                PatientMale.Text = "Женский";
            }
            else
            {
                PatientMale.Text = "Мужской";
            }

            PatientHeight.Text = Patient.Height.ToString() + " см";
            PatientWeight.Text = Patient.Weight.ToString() + " кг";

            _container = new EntityModelContainer();

            PatientResults.DataSource = (from measuredData in _container.MeasuredDataSet
                                         where measuredData.OwnerCode == Patient.UserCode
                                         orderby measuredData.CreatingTime
                                         select new { Дата = measuredData.CreatingTime.ToString(), езультат = measuredData.Value, Тип = "Измерение" }).Union(
                from healthStatus in _container.HealthStatusSet
                where healthStatus.OwnerCode == Patient.UserCode
                select new { Дата = healthStatus.CreatingTime.ToString(), езультат = healthStatus.Status, Тип = "Статус" }).ToList();

            PatientResults.Update();

            PatientResults.Columns[0].Width   = 100;
            PatientResults.Columns[1].Width   = 245;
            PatientResults.Columns[2].Visible = false;

            excelThread =
                new Thread(ExcelWorker.WriteResults);

            EndPeriod.MaxDate = DateTime.Now;
        }