private void AddOrUpdateColumn(string addOrUpdate) { mb.Id = int.Parse(textBoxMbId.Text); mb.Manufacturer = textBoxMbManufacturer.Text; mb.Name = textBoxMbName.Text; mb.SocketCPU = textBoxMbSocketCpu.Text; mb.FormFactor = textBoxMbFormFactor.Text; mb.MemoryMax = int.Parse(textBoxMbMemoryMax.Text); mb.MemorySlots = int.Parse(textBoxMbMemorySlots.Text); // Try Parse mb.Price = double.Parse(textBoxMbPrice.Text); bool success = addOrUpdate == "added" ? mb.Insert(mb) : mb.Update(mb); helperMethods.DisplayMessage(success, addOrUpdate, this, mb, componentName, mbBrowseGV); }
static void FetchAndLogRecord(Record record) { string line; M4ATX.Update(record); Motherboard.Update(record); nVidiaGPU.Update(record); Log.ToCloud(record); line = string.Format( "{0} | {1}\x00B0 | {2}\x00B0 {3}\x00B0 {4}\x00B0 {5}\x00B0 {6}\x00B0 |" + " {7}\x00B0 | {8,4:#0.0}W {9,4:#0.0}W {10,4:#0.0}W | {11,4:#0.0}W |" + " {12,4:#0.0}V {13,4:#0.0}V {14,4:#0.0}V {15,4:#0.0}V", DateTime.UtcNow, record[DataPoint.M4ATXTemperature], record[DataPoint.CPUPackageTemperature], record[DataPoint.CPUCore0Temperature], record[DataPoint.CPUCore1Temperature], record[DataPoint.CPUCore2Temperature], record[DataPoint.CPUCore3Temperature], record[DataPoint.GPUCoreTemperature], record[DataPoint.CPUPackagePower], record[DataPoint.CPUCoresPower], record[DataPoint.CPUDRAMPower], record[DataPoint.GPUPower], record[DataPoint.M4ATXVoltageIn], record[DataPoint.M4ATXVoltageOn12V], record[DataPoint.M4ATXVoltageOn3V], record[DataPoint.M4ATXVoltageOn5V] ); Log.WriteLine(line); }
static void FetchAndLogRecord(Record record) { string line; try { M4ATX.Update(record); } catch (Exception e) { LogException(e); } Motherboard.Update(record); line = string.Format( "{0} | {1}\x00B0 | {2}\x00B0 {3}\x00B0 {4}\x00B0 {5}\x00B0 {6}\x00B0 | {7}\x00B0 {8,4:#0.0}W | {9,4:#0.0}W {10,4:#0.0}W {11,4:#0.0}W | {12:#0.0}V", DateTime.UtcNow, record.Get(Record.DataPoint.M4ATXTemperature), record.Get(Record.DataPoint.CPUPackageTemperature), record.Get(Record.DataPoint.CPUCore0Temperature), record.Get(Record.DataPoint.CPUCore1Temperature), record.Get(Record.DataPoint.CPUCore2Temperature), record.Get(Record.DataPoint.CPUCore3Temperature), record.Get(Record.DataPoint.GPUCoreTemperature), record.Get(Record.DataPoint.GPUPower), record.Get(Record.DataPoint.CPUPackagePower), record.Get(Record.DataPoint.CPUCoresPower), record.Get(Record.DataPoint.CPUDRAMPower), record.Get(Record.DataPoint.M4ATXVoltageIn) ); WriteLine(line); }