protected void Page_Load(object sender, EventArgs e) { if ((User)Session["User"] != null) { if (!IsPostBack) { DAL.DBTherapyConnection dBTherapy = new DAL.DBTherapyConnection(); List <Therapy> therapy = dBTherapy.GetOwn((User)Session["User"]); List <AgendaItem> agendaItems = ConvertTherapyToAcceptedAgendaItems(therapy); ActivityAgenda.DataSource = agendaItems; ActivityAgenda.TimeFormat = DayPilot.Web.Ui.Enums.TimeFormat.Clock24Hours; ActivityAgenda.StartDate = DateTime.Now; ActivityAgenda.Days = 7; ActivityAgenda.DataTextField = "Description"; ActivityAgenda.DataStartField = "StartTime"; ActivityAgenda.DataEndField = "EndTime"; ActivityAgenda.DataIdField = "ID"; ActivityAgenda.ShowToolTip = true; ActivityAgenda.DataBind(); List <Therapy> newListTherapies = new List <Therapy>(); foreach (var item in therapy) { if (!item.Accepted) { newListTherapies.Add(item); } } TherapyGrid.DataSource = newListTherapies; TherapyGrid.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] != null) { LoggedInUser = Session["User"] as Entities.User; if (LoggedInUser != null) { } else { Response.Redirect("/SignIn"); } } else { Response.Redirect("/SignIn"); } DAL.DBTherapyConnection dBTherapy = new DAL.DBTherapyConnection(); List <Therapy> therapy = dBTherapy.GetOwn(LoggedInUser); TherapyCards.InnerHtml = ""; if (therapy != null) { foreach (var item in therapy) { try { string MedDescription = string.Empty; if (item.Medication != null) { MedDescription = item.Medication.FirstOrDefault().Description; } string DesDescription = string.Empty; if (item.Deseases != null) { DesDescription = item.Deseases.FirstOrDefault().Description; } TherapyCards.InnerHtml += "<div class='card-small'><div class='card-small-title'>" + (item.description ?? "") + " </div><hr/>Behandeld door: " + (item.therapistLastName ?? "") + "<hr/>" + (item.date.ToString("dd-MM-yyyy") ?? "") + "<br />Aandoening: " + DesDescription + "<br />Medicatie: " + MedDescription + "</div>"; } catch (Exception ex) { } } } else { TherapyCards.InnerHtml = "Geen behandelingen om weer te geven"; } }
protected void Page_Load(object sender, EventArgs e) { if ((User)Session["User"] != null) { DAL.DBRoleConnection dBRoleConnection = new DAL.DBRoleConnection(); Entities.Role role = dBRoleConnection.GetUserRights((User)Session["User"]); if (role.ShowNewTherapy == true) { if (!IsPostBack) { DAL.DBTherapyConnection dBTherapy = new DAL.DBTherapyConnection(); List <Therapy> therapy = dBTherapy.GetTherapiesFromTherapist((User)Session["User"]); List <AgendaItem> agendaItems = ConvertTherapyToAcceptedAgendaItems(therapy); ActivityAgendaTherapist.DataSource = agendaItems; ActivityAgendaTherapist.TimeFormat = DayPilot.Web.Ui.Enums.TimeFormat.Clock24Hours; ActivityAgendaTherapist.StartDate = DateTime.Now; ActivityAgendaTherapist.Days = 7; ActivityAgendaTherapist.DataTextField = "Description"; ActivityAgendaTherapist.DataStartField = "StartTime"; ActivityAgendaTherapist.DataEndField = "EndTime"; ActivityAgendaTherapist.DataIdField = "ID"; ActivityAgendaTherapist.ShowToolTip = true; ActivityAgendaTherapist.DataBind(); List <Therapy> newListTherapies = new List <Therapy>(); foreach (var item in therapy) { if (!item.Accepted) { newListTherapies.Add(item); } } } } else { ActivityAgendaTherapist.Visible = false; ActivityAgendaTherapist.Enabled = false; } } else { ActivityAgendaTherapist.Visible = false; ActivityAgendaTherapist.Enabled = false; } }