protected void UpdateDB() { string output = "<table>"; System.Data.DataTable tbl = SMSHistoryDataDB.GetDataTable(1); foreach (System.Data.DataRow row in tbl.Rows) { SMSHistoryData smsHistory = SMSHistoryDataDB.LoadAll(row); output += "<tr><td>" + smsHistory.SmsHistoryID + "</td><td>" + smsHistory.Booking.BookingID + "</td><td>" + smsHistory.PhoneNumber + "</td><td>" + smsHistory.Message + "</td><td>" + smsHistory.Cost + "</td><td>" + smsHistory.DatetimeSent.ToString("yyyy-MM-dd HH:mm:ss") + "</td><td>" + "</td><td>" + smsHistory.SmstechMessageID + "</td><td>" + smsHistory.SmstechStatus + "</td><td>" + smsHistory.SmstechDatetime + "</td></tr>"; } output += "</table>"; lblSMSes.Text = output; }
public static SMSHistoryData LoadAll(DataRow row) { SMSHistoryData s = Load(row); if (row["booking_booking_id"] != DBNull.Value) { s.Booking = BookingDB.Load(row, "booking_", false, false); } if (row["patient_patient_id"] != DBNull.Value) { s.Patient = PatientDB.Load(row, "patient_"); s.Patient.Person = PersonDB.Load(row, "person_patient_"); s.Patient.Person.Title = IDandDescrDB.Load(row, "title_patient_title_id", "title_patient_descr"); } return(s); }