protected string GetPrayerResponse(int RequestId) { string response = string.Empty; Shiloh.BL.PrayerResponse resp = new Shiloh.BL.PrayerResponse(); Shiloh.BL.Shiloh.prayerResponseDataTable dtResponses = resp.GetByResponsesByRequestId(RequestId); if (dtResponses != null && dtResponses.Count > 0) { string respDate = Convert.ToDateTime(dtResponses.Rows[0]["dateCreated"]).ToString("dddd, dd MMMM yyyy hh:mm tt"); response = string.Concat("<b>A Response From Shiloh: </b>", dtResponses.Rows[0]["response"].ToString(), "<div style='padding-top: 5px;'><i>%date%</i></div>".Replace("%date%", respDate)); } return response; }
protected void GetPrayerResponses() { // get any responses if (_Responses == null) _Responses = new List<PrayerResponse>(); else _Responses.Clear(); PrayerResponse response = new PrayerResponse(); Shiloh.prayerResponseDataTable dtResponses = response.GetByResponsesByRequestId(Id); if (dtResponses != null && dtResponses.Rows.Count > 0) { foreach (Shiloh.prayerResponseRow row in dtResponses.Rows) { PrayerResponse resp = new PrayerResponse(row); _Responses.Add(resp); } } }
protected bool SaveResponse() { bool saved = false; _ResponseId = Convert.ToInt32(hdnResponseId.Value); Shiloh.BL.PrayerResponse response = new Shiloh.BL.PrayerResponse(_ResponseId); response.ProcessedBy = this.txtProcessedBy.Text; response.ResponseText = Server.HtmlEncode(txtResponse.Text); response.RequestId = _RequestId; response.DateCreated = DateTime.Now; try { saved = response.Save(); } catch (Exception ex) { _ErrorMsg = ex.Message; saved = false; } return saved; }