private void Contro2_FORMULARIO() { if (DDLFenologia.SelectedItem.Text == "FECHA Y AVANCE DE SIEMBRA") { LblFechaFase.Text = "Etapa:"; DDLEstadoFF.Enabled = false; DDLEstadoFF.Items.Insert(0, new ListItem("Avance", "Avance", true)); DDLEstadoFF.DataBind(); DDLEstadoFF.ClearSelection(); } }
protected void DDLFenologia_SelectedIndexChanged(object sender, EventArgs e) { Control_FORMULARIO(); if (DDLFenologia.SelectedItem.Text == "FECHA COSECHA PROBABLE") { TxtFechaFase.Visible = true; DDLEstadoFF.Visible = true; DDLEstadoFF.Enabled = true; DDLEstadoFF.Items.Clear(); DDLEstadoFF.Items.Insert(0, new ListItem("Inicial", "Inicial", true)); DDLEstadoFF.Items.Insert(1, new ListItem("Final", "Final", true)); DDLEstadoFF.DataBind(); TxtPorcentaje.Visible = false; LblFechaFase.Text = "Fecha:"; LblValor1.Visible = false; Panel1.Visible = false; } else { if (DDLFenologia.SelectedItem.Text == "COSECHA Y ACOPIO") { DDLEstadoFF.Enabled = false; DDLEstadoFF.Visible = true; DDLEstadoFF.Items.Insert(0, new ListItem("Avance", "Avance", true)); Panel1.Visible = true; TxtFechaFase.Visible = false; TxtPorcentaje.Visible = true; Seleccionar_VALORES_COSECHA(); } else { DDLEstadoFF.Enabled = false; DDLEstadoFF.Visible = true; DDLEstadoFF.Items.Insert(0, new ListItem("Avance", "Avance", true)); DDLEstadoFF.DataBind(); DDLEstadoFF.ClearSelection(); TxtFechaFase.Visible = false; LblFechaFase.Text = "Etapa:"; TxtPorcentaje.Visible = true; TxtFechaFase.Visible = false; LblValor1.Visible = true; Panel1.Visible = false; } } Calcularar_AVANCE_SIEMBRA(); Calcularar_PORCENTAJE_FENOLOGIA(); }
protected void Registrar_COSECHAPROBABLE() { /*********************************************************************/ if (TxtFechaFase.Text != "") { LblMsj5.Text = string.Empty; DataTable dt = Session["datos"] as DataTable; DataRow row = dt.NewRow(); row["Id_Fenologia"] = DDLFenologia.SelectedValue; row["FaceFenologica"] = DDLFenologia.SelectedItem.Text; row["EstadoFF"] = DDLEstadoFF.SelectedValue; row["Porcentaje"] = TxtPorcentaje.Text; row["Fecha_Cosecha"] = TxtFechaFase.Text; dt.Rows.Add(row); GVSegCultivo.DataSource = dt; GVSegCultivo.DataBind(); Session["datos"] = dt; TxtFechaFase.Text = string.Empty; /*************/ if (DDLEstadoFF.SelectedItem.Text == "Final") { BtnEnviar.Enabled = true; BtnRegistrar.Enabled = false; } else { DDLEstadoFF.Items.Clear(); DDLEstadoFF.Items.Insert(0, new ListItem("Final", "Final", true)); DDLEstadoFF.DataBind(); } } else { Response.Write("<script>window.alert('Necesita especificar la fecha');</script>"); } }