private void ViewTrackingEntry(string entryGuid, Device device) { try { Waiting(); using (DataTable results = DBFactory.GetDatabase().DataTableFromQueryString(Queries.SelectTrackingEntryByGuid(entryGuid))) { foreach (DataRow r in results.Rows) { txtTimeStamp.Text = DataConsistency.NoNull(r[TrackablesCols.DateStamp]); txtCheckType.Text = DataConsistency.NoNull(r[TrackablesCols.CheckType]); if (txtCheckType.Text == "IN") { txtCheckType.BackColor = Colors.CheckIn; } else if (txtCheckType.Text == "OUT") { txtCheckType.BackColor = Colors.CheckOut; } txtDescription.Text = device.Description; txtGuid.Text = DataConsistency.NoNull(r[TrackablesCols.DeviceGuid]); txtCheckOutUser.Text = DataConsistency.NoNull(r[TrackablesCols.CheckoutUser]); txtCheckInUser.Text = DataConsistency.NoNull(r[TrackablesCols.CheckinUser]); txtLocation.Text = DataConsistency.NoNull(r[TrackablesCols.UseLocation]); txtAssetTag.Text = device.AssetTag; txtCheckOutTime.Text = DataConsistency.NoNull(r[TrackablesCols.CheckoutTime]); txtDueBack.Text = DataConsistency.NoNull(r[TrackablesCols.DueBackDate]); txtSerial.Text = device.Serial; txtCheckInTime.Text = DataConsistency.NoNull(r[TrackablesCols.CheckinTime]); txtNotes.Text = DataConsistency.NoNull(r[TrackablesCols.Notes]); txtEntryGuid.Text = DataConsistency.NoNull(r[TrackablesCols.Guid]); this.Text = this.Text + " - " + DataConsistency.NoNull(r[TrackablesCols.DateStamp]); } } } catch (Exception ex) { ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod()); } finally { DoneWaiting(); } }
private void FillControls(DataTable data) { controlParser.FillDBFields(data); this.Text = this.Text + " - " + DataConsistency.NoNull(data.Rows[0][HistoricalDevicesCols.ActionDateTime]); }