protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { foreach (CSchedule schedule in scheduleFactory.getAll()) { if (!schedule.isFinished) { ddlScheduleID.Items.Add(schedule.id.ToString()); } } foreach (CUser user in userFactory.getAll()) { ddlUserName.Items.Add(user.name); } foreach (CPatient patient in patientFactory.getAll()) { ddlPatientName.Items.Add(patient.name); } foreach (CAssess assess in assessFactory.getAll()) { ddlAssessName.Items.Add(assess.name); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { gvSchedules.DataSource = scheduleFactory.getAll().OrderByDescending(schedule => schedule.id).ToList(); BoundField id = new BoundField(); id.DataField = "id"; id.HeaderText = "事項編號"; BoundField user_id = new BoundField(); user_id.DataField = "user_id"; user_id.HeaderText = "評估人編號"; BoundField patient_id = new BoundField(); patient_id.DataField = "patient_id"; patient_id.HeaderText = "住民編號"; BoundField assess_name = new BoundField(); assess_name.DataField = "assess_name"; assess_name.HeaderText = "評估表名稱"; BoundField deadLine = new BoundField(); deadLine.DataField = "deadLine"; deadLine.HeaderText = "期限"; deadLine.DataFormatString = "{0:yyyy/MM/dd}"; CheckBoxField isFinished = new CheckBoxField(); isFinished.DataField = "isFinished"; isFinished.HeaderText = "是否完成"; gvSchedules.Columns.Add(id); gvSchedules.Columns.Add(user_id); gvSchedules.Columns.Add(patient_id); gvSchedules.Columns.Add(assess_name); gvSchedules.Columns.Add(deadLine); gvSchedules.Columns.Add(isFinished); gvSchedules.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { foreach (CSchedule schedule in scheduleFactory.getAll()) { if (!schedule.isFinished) { ddlScheduleID.Items.Add(schedule.id.ToString()); } } } }
protected void Page_Load(object sender, EventArgs e) { CScheduleFactory scheduleFactory = new CScheduleFactory(); List <CSchedule> schedules = new List <CSchedule>(); foreach (CSchedule schedule in scheduleFactory.getAll()) { schedules.Add(schedule); } string jsonData = JsonConvert.SerializeObject(schedules); Response.Clear(); Response.ContentType = "application/json; charset=utf-8"; Response.Write(jsonData); Response.End(); }