private void BindData() { TraineeBLL trainee = new TraineeBLL(connectionString); TraineeList.DataSource = trainee.GetAllTrainees(); TraineeList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // retrieve data from database and populate it into the drodown list List <TraineeViewModel> trainees = tbll.GetAllTrainees(); TraineeList.DataSource = trainees; TraineeList.DataTextField = "FirstName"; TraineeList.DataValueField = "TraineeID"; TraineeList.DataBind(); TraineeList.Items.Insert(0, "--Select a trainee from the list--"); } }
public void BindData() { /* * MeasurementBLL mes = new MeasurementBLL(); * List<Models.Measurement> mesList = mes.GetMeasurements(); * //ProgressListParent.DataSource = mes.GetMeasurementPerTrainee(); * //ProgressListParent.DataBind(); */ string connectionString = ConfigurationManager.ConnectionStrings["MySwoleMateConnectionString"].ToString(); TraineeBLL trainee = new TraineeBLL(connectionString); ProgressListParent.DataSource = trainee.GetAllTrainees(); ProgressListParent.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ScheduleBLL scbll = new ScheduleBLL(); Schedule sc = scbll.GetScheduleById(Convert.ToInt32(Request.QueryString["ScheduleID"])); // Loading the dropdownlist List <TraineeViewModel> trainees = tbll.GetAllTrainees(); TraineeList.DataSource = trainees; TraineeList.DataTextField = "FirstName"; TraineeList.DataValueField = "TraineeID"; TraineeList.DataBind(); TraineeList.Items.Insert(0, "--Select a trainee from the list--"); TraineeList.SelectedValue = sc.TraineeID.ToString(); DateOfAppointment.Text = sc.ScheduleDtTime.ToString("yyyy-MM-dd"); //The format has to be like this: "yyyy-mm-dd" otherwise it won't show in the browser //DateOfAppointment.Text = sc.DisplayScheduleDtTime.ToString(); TimeOfAppointment.Text = sc.InputDtTime.ToString("HH:mm"); } }