protected override void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); sessionHandler = new SessionHandler(this.Page); errMsg.Message = null; saveBtn.Attributes.Add("onClick", "if(!validateRequiredFields()){return false;};"); // shouldn't we check for add patient permissions here? PopulatePhysicians(); // d/n match the physicians in the Appointments table - SOLUTION = SELECT DISTINCT(ApptPhysician) ? PopulateClinicDate(); PopulateDepartments(); PopulateVisitTypes(); // PopulateHelpBubbles(); if ("addnew".Equals(Request["confirm"])) { PageText.Text = "The patient and appointment were added to the database. You may add another patient below, or <a href=\"\" onClick=\"parent.ClosePopup();\">close this screen</a> using the close button at the top right of this window."; } else if ("addold".Equals(Request["confirm"])) { PageText.Text = "The appointment was added to the database. You may add another patient below, or <a href=\"\" onClick=\"parent.ClosePopup();\">close this screen</a> using the close button at the top right of this window."; } PageUtil.AddCalendarFunction(AppointmentDateCal, AppointmentDate); Page.RegisterArrayDeclaration("requiredFieldArray", "'" + PtLastName.ClientID + "', '" + PtMRN.ClientID + "', '" + ApptPhysician.ClientID + "', '" + AppointmentDate.ClientID + "', '" + AppointmentTime.ClientID + "' "); }
private void SetUpTimePeriod() { bool setFromDate = false; bool setToDate = false; PageUtil.AddCalendarFunction(txtFromDateCal, txtFromDate); PageUtil.AddCalendarFunction(txtToDateCal, txtToDate); if (!Page.IsPostBack) { toDate = DateTime.Now; fromDate = toDate.AddDays(-30); setFromDate = true; setToDate = true; } else { if (PageUtil.IsDate(txtFromDate.Value)) { fromDate = DateTime.Parse(txtFromDate.Value); setFromDate = true; } if (PageUtil.IsDate(txtToDate.Value)) { toDate = DateTime.Parse(txtToDate.Value); setToDate = true; } } if (setFromDate) { txtFromDate.Value = PageUtil.ObjToDateString(fromDate); } else { txtFromDate.Value = ""; } if (setToDate) { txtToDate.Value = PageUtil.ObjToDateString(toDate); } else { txtToDate.Value = ""; } }