/// <summary> /// Constructor /// </summary> /// <param name="myLL">Kontrolklassen for logiklag som parameter</param> /// <param name="MDTO">Reference til monitorerings-DTO'en i BTAHovedvindue</param> public Gemvindue(ControlLogikLag myLL, ref MonitorerDTO MDTO) { this.currentLL = myLL; InitializeComponent(); this.GDTO = currentLL.GLL.GDTO; this.MDTO = MDTO; LLængde.Text = (MDTO.RåBlodtrykssignal.Count / 1000).ToString() + " sek"; }
private void buttonSave_Click(object sender, EventArgs e) { GemDTO packet = new GemDTO { Id = -1, ColorId = -1, ColorName = textBoxColor.Text, Name = textBoxName.Text, Transparency = checkBoxTransparency.Checked, Description = textBoxDescription.Text }; if (comboBoxType.SelectedIndex == 0) { packet.Type = Gem.Types.ORNAMENTAL; } else if (comboBoxType.SelectedIndex == 1) { packet.Type = Gem.Types.SEMIPRECIOUS; } else { packet.Type = Gem.Types.PRECIOUS; } try { if (gem != null) { this.Close(); return; } servis.Save(packet); if (listBoxGem.Items.Count > 0) { listBoxGem.Items.Clear(); } servis.FindAll(listBoxGem); comboBoxColor.Items.Clear(); servis.GetExistingColors(comboBoxColor); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Gemmer valgt data i fil /// </summary> /// <param name="GDTO"></param> /// <returns></returns> public bool gemDataTilFil(GemDTO GDTO) { try { string json = JsonConvert.SerializeObject(GDTO); string path = Environment.CurrentDirectory + @"\AppData\" + GDTO.CPR + " - " + string.Format("{0:yyyy-MM-dd_HH-mm-ss}.json", GDTO.Dato); File.WriteAllText(path, json); return(true); } catch (Exception) { return(false); } }
/// <summary> /// Kalder gem metode i GDL /// </summary> /// <param name="GDTO_"></param> /// <returns></returns> public bool gemData(GemDTO GDTO_) { bool b = currentDatalag.GDL.gemDataTilFil(GDTO_); return(b); }
/// <summary> /// Constructor /// </summary> /// <param name="mydal">modtager kontrolklassen for datalaget som parameter</param> public GemLL(ControlDataLag mydal) { this.currentDatalag = mydal; this.GDTO = currentDatalag.GDL.GDTO; }
/// <summary> /// Constructor /// </summary> public GemDL() { this.GDTO = new GemDTO(); }