//Agrega un control de selección de alergias a la lista private void btnAddAlg_Click(object sender, EventArgs e) { PrescTimeSelect select = new PrescTimeSelect(); ListTime.Add(select); TimeContainer.Controls.Add(select); }
//Agrega un selector de tiempo a la lista de horas nuevas public void AddTimeSelect() { PrescTimeSelect SelectTemp = new PrescTimeSelect(); SelecTimeControl.Add(SelectTemp); TimeContainer.Controls.Add(SelectTemp); }
//Elimina un control de selección de alergias de la lista private void btnDelete_Click(object sender, EventArgs e) { if (ListTime.Count > 0) { PrescTimeSelect temp = ListTime[ListTime.Count - 1]; ListTime.Remove(temp); TimeContainer.Controls.Remove(temp); } }
//Elimina un selector de tiempo de la lista private void btnDelete_Click(object sender, EventArgs e) { if (SelecTimeControl.Count > 0) { PrescTimeSelect SelectTemp = SelecTimeControl[SelecTimeControl.Count - 1]; SelecTimeControl.Remove(SelectTemp); TimeContainer.Controls.Remove(SelectTemp); } }
//Obtiene la lista de nombres de usuario de la base de datos public void GetData() { List <string> names = ReadUsersData(Session.DBConnection.GetAllUsersNameAccount()); Users = names; var source = new AutoCompleteStringCollection(); source.AddRange(names.ToArray()); txtTargetUser.AutoCompleteCustomSource = source; txtTargetUser.AutoCompleteSource = AutoCompleteSource.CustomSource; txtTargetUser.AutoCompleteMode = AutoCompleteMode.Suggest; txtFInic.Text = DateTime.Now.ToShortDateString(); PrescTimeSelect select = new PrescTimeSelect(); ListTime.Add(select); TimeContainer.Controls.Add(select); }