public void refreshObject(object obj) { if (obj != null && obj is DdtJournal) { DdtJournal journal = (DdtJournal)obj; deferredJournalTxt.Text = journal.Journal; deferredAdTxt.Text = journal.Ad; defferedChddTxt.Text = journal.Chdd; deferredChssTxt.Text = journal.Chss; deferredMonitorTxt.Text = journal.Monitor; deferredStartDate.Value = journal.AdmissionDate; deferredStartTime.Value = journal.AdmissionDate; DdvDoctor doc = DbDataService.GetInstance().GetDdvDoctorService().GetById(journal.Doctor); docBox.SelectedIndex = docBox.FindStringExact(doc.ShortName); objectId = journal.ObjectId; isNew = string.IsNullOrEmpty(objectId); hasChanges = false; } else { deferredJournalTxt.Text = JournalShuffleUtils.shuffleJournalText(); deferredChssTxt.SelectedIndex = JournalShuffleUtils.shuffleNextIndex(deferredChssTxt.Items.Count - 1); deferredAdTxt.SelectedIndex = JournalShuffleUtils.shuffleNextIndex(deferredAdTxt.Items.Count - 1); defferedChddTxt.SelectedIndex = defferedChddTxt.FindString("14"); } }
public void refreshObject(object obj) { if (obj != null && obj is DdtJournal) { DdtJournal journal = (DdtJournal)obj; initDateTime(journal.AdmissionDate); journalTxt.Text = journal.Journal; chddTxt.Text = journal.Chdd; adTxt.Text = journal.Ad; chssTxt.Text = journal.Chss; goodRhytmBtn0.Checked = GOOD_RHYTM.Equals(journal.Rhythm, StringComparison.Ordinal); badRhytmBtn0.Checked = !GOOD_RHYTM.Equals(journal.Rhythm, StringComparison.Ordinal); monitorTxt0.Text = journal.Monitor; objId = journal.ObjectId; freeze.Checked = journal.Freeze; isNew = string.IsNullOrEmpty(objId); hasChanges = false; isReleaseJournal = journal.ReleaseJournal; freeze.Checked = journal.Freeze; } else { initDateTime(DateTime.Now); string journalText = string.Intern(JournalShuffleUtils.shuffleJournalText()); if (isReleaseJournal) { journalText = RELEASE_JOURNAL_PREFIX + journalText + RELEASE_JOURNAL_POSTFIX; } journalTxt.Text = journalText; chddTxt.SelectedIndex = chddTxt.FindString("14"); adTxt.SelectedIndex = JournalShuffleUtils.shuffleNextIndex(adTxt.Items.Count - 1); chssTxt.SelectedIndex = JournalShuffleUtils.shuffleNextIndex(chssTxt.Items.Count - 1); goodRhytmBtn0_CheckedChanged(null, null); } }
private void addCardioInspetions_Click(object sender, EventArgs e) { int lastIndx = dutyCardioContainer.Controls.Count - 1; DateTime lastDate = DateTime.Now; DateTime initDate = DateTime.Now; DateTime startRecalculatedTime = DateTime.Now; int startRecalculateIndx = -1; for (int i = lastIndx; i >= 0; i--) { JournalKAGControl jj = (JournalKAGControl)dutyCardioContainer.Controls[i]; if (i == lastIndx) { lastDate = jj.getDateTime(); } if ((jj.isFreeze() || i == 0) && startRecalculateIndx < 0) { initDate = i == 0 ? jj.getDateTime() : DateTime.Now; startRecalculateIndx = i; } if (i == 0) { startRecalculatedTime = jj.getDateTime(); } } DateTime nextDate = lastDate.AddHours(4).AddMinutes(JournalShuffleUtils.shuffleNextIndex(5)); DateTime finalTime = new DateTime(nextDate.Year, nextDate.Month, nextDate.Day, 8, 5, 0); if ((nextDate.Day > initDate.Day || initDate.Hour < 8) && nextDate > finalTime && startRecalculateIndx >= 0) { long ticksAllDay = finalTime.Ticks - startRecalculatedTime.Ticks; double minutesAllDay = ticksAllDay / 10000000 / 60; double minutesPerJ = minutesAllDay / (dutyCardioContainer.Controls.Count); nextDate = finalTime; DateTime lastRecalculated = new DateTime(startRecalculatedTime.Ticks); for (int i = startRecalculateIndx + 1; i <= lastIndx; i++) { JournalKAGControl jj = (JournalKAGControl)dutyCardioContainer.Controls[i]; //weight 100% = 240 minutes; DateTime re = lastRecalculated.AddMinutes(minutesPerJ); jj.initDateTime(re); lastRecalculated = new DateTime(re.Ticks); } } JournalKAGControl control = new JournalKAGControl(this, null, false); control.Anchor = AnchorStyles.Right; control.initDateTime(nextDate); dutyCardioContainer.Controls.Add(control); }
public void refreshObject(object obj) { if (obj != null && obj is DdtJournal) { DdtJournal journal = (DdtJournal)obj; complaintsTxt.Text = journal.Complaints; adTxt.Text = journal.Ad; chddTxt.Text = journal.Chdd; chssTxt.Text = journal.Chss; monitorTxt.Text = journal.Monitor; journalTxt.Text = journal.Journal; startDateTxt.Value = journal.AdmissionDate; startTimeTxt.Value = journal.AdmissionDate; goodRhytmBtn.Checked = journal.GoodRhythm; badRhytmBtn.Checked = !journal.GoodRhythm; freeze.Checked = journal.Freeze; docBox.SelectedValue = journal.Doctor; objectId = journal.ObjectId; isNew = string.IsNullOrEmpty(objectId); hasChanges = false; } else { journalTxt.Text = journalType == (int)DdtJournalDsiType.PendingJustification ? JournalShuffleUtils.shuffleBadJournalText() : JournalShuffleUtils.shuffleJournalText(); if (journalType == (int)DdtJournalDsiType.AfterPending) { journalTxt.Text += "Необходимо решить вопрос о проведении консилиума."; this.journalType = (int)DdtJournalDsiType.BeforeKag; } adTxt.SelectedIndex = JournalShuffleUtils.shuffleNextIndex(adTxt.Items.Count - 1); chddTxt.SelectedIndex = chddTxt.FindString("14"); chssTxt.SelectedIndex = JournalShuffleUtils.shuffleNextIndex(chssTxt.Items.Count - 1); } }