internal void Save() { if (!loaded) { return; } foreach (KeyValuePair <Handbook, Control> pair in binding) { Handbook hb = pair.Key; Control ctl = pair.Value; string text = ctl.Text; if (hb.HandbookType == HandbookType.Date) { DateTimePicker dp = (DateTimePicker)ctl; if (dp.ShowCheckBox && !dp.Checked) { text = ""; } else { text = DateTimeUtils.ToString(dp.Value); } } handbooksInfo[hb.id] = text; } }
private void InitControl(NumericUpDown nud, Handbook handbook, string text) { try { string defaultValue = handbook.GetDefaultValue(); decimal min = GetDecimal(handbook.minValue, nud.Minimum); decimal max = GetDecimal(handbook.maxValue, nud.Maximum); decimal val = GetDecimal(defaultValue, nud.Minimum); if (val < min) { val = min; } if (max < min) { max = min; } if (max < val) { max = val; } nud.Minimum = min; nud.Maximum = max; nud.Value = val; nud.DecimalPlaces = handbook.decimalPlaces; nud.Text = text; } catch (Exception ex) { Log.Exception(ex); } }
public void Populate(Handbook handbook){ symptomItems = new List<HandbookSymptomListItem> (); foreach (Symptom symptom in handbook.symptoms) { symptomItems.Add(AddButton (symptom)); } }
private const string DEBUG_HOST = "127.0.0.1:5000";//"10.184.5.117:5000"; public void StartGame(){ isUpdating = false; //Run any timer logic or shiiiit here string aspect = "game"; string method = "start"; string url = DEBUG_HOST + "/" + aspect + "/" + method; new WWW(url); GetNewPatient(); //DEBUG // Handbook handbook = new Handbook(); // handbook.symptoms = new List<Symptom> (); // for (int i = 0; i < Random.Range(3, 9); ++i) { // Symptom symptom = new Symptom (); // symptom.name = "Symptom " + i.ToString(); // // symptom.causes = new List<string> (); // for (int j = 0; j < Random.Range(2, 7); ++j) { // symptom.causes.Add ("Cause " + j.ToString ()); // } // // handbook.symptoms.Add (symptom); // } Handbook handbook = new Handbook(); PopulateHandbook (handbook); //Start update cycle InvokeRepeating ("UpdateStateCycle", 0f, 1f); }
void Update(int ver) { switch (ver) { case 1: depConfig.temperatureObservationPeriod = 12; config.taskTypes.Add(new TaskType(TaskTypeId.CommonDuration, "Превышен срок пребывания больного в общем отделении")); config.taskTypes.Add(new TaskType(TaskTypeId.IntensiveCareDuration, "Превышен срок пребывания больного в ПИТ")); config.taskTypes.Add(new TaskType(TaskTypeId.ReanimationDuration, "Превышен срок пребывания больного в реанимации")); break; case 2: config.reportBuilders.Add(new ReportBuilder("PrescriptionsOrder", "Требование на получение медикаментов")); config.reports.Add(new Report("Требование на получение медикаментов", "", "HospitalDepartment.Reports.PrescriptionsOrder.rdlc", "PrescriptionsOrder", true)); break; case 3: Handbook hb = new Handbook("DateAndDurationOfFormerTreatment", "Дата и длительность нахождения на лечении по поводу этого же заболевания", HandbookType.String); config.AddHandbook(HandbookGroupId.PatientData, hb); hb = new Handbook("CentralVenousPressure", "ЦВД", HandbookType.Number); config.AddHandbook(HandbookGroupId.Observation, hb); hb = new Handbook("AccountDate", "Дата счета", HandbookType.Date); hb.nullable = true; config.AddHandbook(HandbookGroupId.PatientIdentification, hb); config.GetHandbookGroup(HandbookGroupId.TemperatureCard).handbooks.Clear(); hb = new Handbook("Temperature", "Температура", HandbookType.Number); hb.decimalPlaces = 1; hb.defaultValue = "36,6"; hb.minValue = "20"; hb.maxValue = "45"; hb.ItemsList = "35,9;36,9";//morning="35,9;36,5", evening="36,3;36,9" config.AddHandbook(HandbookGroupId.TemperatureCard, hb); break; case 4: config.reportBuilders.Add(new ReportBuilder("PatientMedicaments", "Карта персонифицированного учета")); config.reports.Add(new Report("Карта персонифицированного учета", "", "HospitalDepartment.Reports.PatientMedicaments.rdlc", "PatientMedicaments", true)); break; case 5: config.GetHandbookGroup(HandbookGroupId.ConsultationData).handbooks.Add(new Handbook("Conclusion", "Заключение", HandbookType.String, 5)); config.GetHandbookGroup(HandbookGroupId.SanatoriumTransfer).handbooks.Add(new Handbook("PatientState", "Состояние больного", HandbookType.String, 3)); break; default: return; } System.Diagnostics.Debug.Assert(config.version < ver); config.version = ver; }
public IActionResult PostHandbook([FromBody] HandbookViewModel viewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } TimeSpan hour = TimeSpan.Parse(viewModel.Hour); Handbook handbook = _mapper.Map <Handbook>(viewModel); handbook.Date = handbook.Date.Add(hour); _serviceHandbook.Insert(handbook); //_context.Handbooks.Add(handbook); //await _context.SaveChangesAsync(); return(CreatedAtAction("GetHandbook", new { id = viewModel.Id }, viewModel)); }
private void Open() { try { Handbook hb = SelectedHandbook; if (hb != null) { HandbookForm form = new HandbookForm(hb); if (form.ShowDialog() == DialogResult.OK) { } } } catch (Exception ex) { Log.Exception(ex); } }
private void InitControl(DateTimePicker dp, Handbook handbook, string text) { try { DateTime dt = DateTime.Now; dp.ShowCheckBox = handbook.nullable; bool hasVal = text != null && text.Trim().Length > 0 && DateTimeUtils.TryParse(text, out dt); if (dp.ShowCheckBox) { dp.Checked = hasVal; } dp.Value = dt; } catch (Exception ex) { Log.Exception(ex); } }
public IActionResult PutHandbook([FromRoute] long id, [FromBody] HandbookViewModel viewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != viewModel.Id) { return(BadRequest()); } TimeSpan hour = TimeSpan.Parse(viewModel.Hour); Handbook handbook = Mapper.Map <Handbook>(viewModel); handbook.Date = handbook.Date.Add(hour); _serviceHandbook.Change(handbook); //TimeSpan hora = TimeSpan.Parse(viewModel.Hora); //Prontuario prontuario = Mapper.Map<ProntuarioViewModel, Prontuario>(viewModel); //prontuario.Data = prontuario.Data.Add(hora); //repositorioProntuarios.Alterar(prontuario); //.Entry(handbook).State = EntityState.Modified; //try //{ // await _context.SaveChangesAsync(); //} //catch (DbUpdateConcurrencyException) //{ // if (!HandbookExists(id)) // { // return NotFound(); // } // else // { // throw; // } //} return(NoContent()); }
private void ShowRare() { bool vis = chkShowRare.Checked; foreach (KeyValuePair <Handbook, int> pair in rowBinding) { Handbook hb = pair.Key; if (!hb.frequent) { int row = pair.Value; for (int col = 0; col < tlp.ColumnCount; col++) { Control ctl = tlp.GetControlFromPosition(col, row); if (ctl != null) { ctl.Visible = vis; } } } } }
public void Init(Handbook handbook) { this.handbook = handbook; }
public void PopulateHandbook(Handbook handbook){ string url = DEBUG_HOST + "/handbook/complete"; StartCoroutine (CallHandbookCreationEndpoint (url, handbook)); // handbookManager.Populate (handbook); }
IEnumerator CallHandbookCreationEndpoint(string url, Handbook hb) { WWW www = new WWW(DEBUG_HOST + "/handbook/complete"); yield return www; string responseJson = www.text; Debug.Log (responseJson); //issues with JsonUtility prevents deserializing top level arrays hb = JsonUtility.FromJson<Handbook>(responseJson); Debug.Log (hb.symptoms.Count); handbookManager.Populate(hb); }
public void Init(Handbook handbook) { this.handbook = handbook; ucStringList.Init("«начение", handbook.Items); }
public static void Fill(ComboBox cb, Handbook handbook, string text) { cb.DataSource = handbook.Items; cb.Text = text; }
public HandbookForm(Handbook handbook) { InitializeComponent(); this.handbook = handbook; FormUtils.Init(this); }
Control AddRow(Handbook handbook, int row) { rowBinding.Add(handbook, row); Label label = new Label(); label.AutoSize = true; label.Anchor = AnchorStyles.Left; tlp.Controls.Add(label, 0, row); if (handbook.handbookType == HandbookType.Header) { label.Text = "" + handbook.name; Font font = new Font(label.Font, FontStyle.Bold); label.Font = font; return(label); } label.Text = handbook.name + ':'; Control ctl = null; string text = handbooksInfo.ContainsKey(handbook.id)?handbooksInfo[handbook.id]:handbook.GetDefaultValue(); switch (handbook.handbookType) { case HandbookType.Date: { DateTimePicker dp = new DateTimePicker(); InitControl(dp, handbook, text); ctl = dp; } break; case HandbookType.Number: if (handbook.nullable) { NullableNumericUserControl ucNullableNumeric = new NullableNumericUserControl(); InitControl(ucNullableNumeric.numericUpDown, handbook, text); ucNullableNumeric.Text = text; ctl = ucNullableNumeric; } else { NumericUpDown nud = new NumericUpDown(); InitControl(nud, handbook, text); ctl = nud; } break; case HandbookType.String: if (handbook.Items.Count > 0) { if (handbook.IsMultiline) { MultilineComboUserControl uc = new MultilineComboUserControl(); uc.LineCount = handbook.lineCount; uc.Additive = handbook.additive; uc.DataSource = handbook.Items; ctl = uc; } else { ComboBox cb = new ComboBox(); cb.Items.AddRange(handbook.Items.ToArray()); cb.SelectedItem = text; ctl = cb; } } else { TextBox tb = new TextBox(); if (handbook.IsMultiline) { tb.Multiline = true; tb.Height *= handbook.lineCount; } ctl = tb; } ctl.Text = text; break; default: ctl.Text = text; break; } if (ctl != null) { ctl.Width = App.GuiConfig.handbookControlWidth; tlp.Controls.Add(ctl, 1, row); binding.Add(handbook, ctl); return(ctl); } return(null); }