protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FechaTextBox.Text = DateTime.Today.ToString("yyyy-MM-dd"); VenceTextBox.Text = DateTime.Today.AddDays(1).ToString("yyyy-MM-dd"); AsignaturaDropDownList.DataSource = Asignaturas.Listar(" IdAsignatura, Nombre ", " 1=1 "); AsignaturaDropDownList.DataValueField = "IdAsignatura"; AsignaturaDropDownList.DataTextField = "Nombre"; AsignaturaDropDownList.DataBind(); SemestreDropDownList.DataSource = Semestres.Listar(" Codigo, IdSemestre", " 1=1 "); SemestreDropDownList.DataTextField = "Codigo"; SemestreDropDownList.DataValueField = "IdSemestre"; SemestreDropDownList.DataBind(); if (Request.QueryString["IdTarea"] != null) { tarea.IdTarea = int.Parse(Request.QueryString["IdTarea"].ToString()); if (tarea.Buscar(tarea.IdTarea)) { CodigoTareaTextBox.Text = tarea.CodigoTarea; FechaTextBox.Text = tarea.Fecha.ToString("yyyy-MM-dd"); VenceTextBox.Text = tarea.Vence.ToString("yyyy-MM-dd"); AsignaturaDropDownList.SelectedIndex = AsignaturaDropDownList.Items.IndexOf(AsignaturaDropDownList.Items.FindByValue(tarea.IdAsignatura.ToString())); SemestreDropDownList.SelectedIndex = SemestreDropDownList.Items.IndexOf(SemestreDropDownList.Items.FindByValue(tarea.IdSemestre.ToString())); DescripcionTextBox.Text = tarea.Descripcion; ResultadoEsperadoTextBox.Text = tarea.ResultadoEsperado; EliminarButton.Visible = true; } EliminarButton.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IdProfesorDropDownList.DataSource = Profesores.Listar("1=1"); IdProfesorDropDownList.DataValueField = "IdProfesor"; IdProfesorDropDownList.DataTextField = "Nombres"; IdProfesorDropDownList.DataBind(); IdSemestreDropDownList.DataSource = Semestres.Listar("IdSemestre, Codigo", "1=1"); IdSemestreDropDownList.DataValueField = "IdSemestre"; IdSemestreDropDownList.DataTextField = "Codigo"; IdSemestreDropDownList.DataBind(); IdAsignaturaDropDownList.DataSource = Asignaturas.Listar("IdAsignatura, Nombre", "1=1"); IdAsignaturaDropDownList.DataValueField = "IdAsignatura"; IdAsignaturaDropDownList.DataTextField = "Nombre"; IdAsignaturaDropDownList.DataBind(); IdSeccionDropDownList.DataSource = Secciones.Listar("1=1"); IdSeccionDropDownList.DataValueField = "IdSeccion"; IdSeccionDropDownList.DataTextField = "Numero"; IdSeccionDropDownList.DataBind(); } }