private void Desplegar_GRILLA() { DB_EXT_Fenologia fendetalle = new DB_EXT_Fenologia(); switch (LblPrograma.Text) { case "TRIGO": GVDetalleFenologiaTrigo.Visible = true; GVDetalleFenologiaTrigo.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(0, LblPrograma.Text, Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(LblIdReg.Text), Convert.ToInt32(LblNumSegCult.Text), "", Convert.ToDateTime(LblFecha.Text), "FENOLOGIA_TRIGO"); GVDetalleFenologiaTrigo.DataBind(); if (GVDetalleFenologiaTrigo.Rows.Count > 0) { Promedios_Totales(); } break; case "MAIZ": GVDetalleFenologiaMaiz.Visible = true; GVDetalleFenologiaMaiz.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(0, LblPrograma.Text, Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(LblIdReg.Text), Convert.ToInt32(LblNumSegCult.Text), "", Convert.ToDateTime(LblFecha.Text), "FENOLOGIA_MAIZ"); GVDetalleFenologiaMaiz.DataBind(); break; case "ARROZ": GVDetalleFenologiaArroz.Visible = true; GVDetalleFenologiaArroz.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(0, LblPrograma.Text, Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(LblIdReg.Text), Convert.ToInt32(LblNumSegCult.Text), "", Convert.ToDateTime(LblFecha.Text), "FENOLOGIA_ARROZ"); GVDetalleFenologiaArroz.DataBind(); break; } }
private void Desplegar_GRILLA() { DB_EXT_Fenologia fendetalle = new DB_EXT_Fenologia(); switch (DDLProg.SelectedValue) { case "TRIGO": GVDetalleFenologiaTrigo.Visible = true; GVDetalleFenologiaTrigo.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(0, DDLProg.SelectedValue, Convert.ToInt32(DDLCamp.SelectedValue), Convert.ToInt32(LblIdReg.Text), 0, "", Convert.ToDateTime(DDLSemanaEnvio.SelectedItem.Text), "FENOLOGIA_TRIGO"); GVDetalleFenologiaTrigo.DataBind(); if (GVDetalleFenologiaTrigo.Rows.Count > 0) { Promedios_Totales(); } break; //case "MAIZ": // if (LblIdInsOrg.Text == "Total") // { // GVDetalleFenologiaMaiz.Visible = true; // GVDetalleFenologiaMaiz.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(0, LblPrograma.Text, Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(LblIdReg.Text), Convert.ToInt32(LblNumSegCult.Text), "", "FENOLOGIA_MAIZ"); // GVDetalleFenologiaMaiz.DataBind(); // } // else // { // GVDetalleFenologiaMaiz.Visible = true; // GVDetalleFenologiaMaiz.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(Convert.ToInt32(LblIdInsOrg.Text), LblPrograma.Text, Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(LblIdReg.Text), Convert.ToInt32(LblNumSegCult.Text), "", "DETALLE_FENOLOGIA_MAIZ"); // GVDetalleFenologiaMaiz.DataBind(); // } // break; //case "ARROZ": // if (LblIdInsOrg.Text == "Total") // { // GVDetalleFenologiaArroz.Visible = true; // GVDetalleFenologiaArroz.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(0, LblPrograma.Text, Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(LblIdReg.Text), Convert.ToInt32(LblNumSegCult.Text), "", "FENOLOGIA_ARROZ"); // GVDetalleFenologiaArroz.DataBind(); // } // else // { // GVDetalleFenologiaArroz.Visible = true; // GVDetalleFenologiaArroz.DataSource = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(Convert.ToInt32(LblIdInsOrg.Text), LblPrograma.Text, Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(LblIdReg.Text), Convert.ToInt32(LblNumSegCult.Text), "", "DETALLE_FENOLOGIA_ARROZ"); // GVDetalleFenologiaArroz.DataBind(); // } // break; } }
private void Llenar_DDLFECHAENVIA() { DB_EXT_Fenologia fendetalle = new DB_EXT_Fenologia(); DataTable dt = new DataTable(); dt = fendetalle.DB_Reporte_FENOLOGIA_DETALLE(0, DDLProg.SelectedValue, Convert.ToInt32(DDLCamp.SelectedValue), Convert.ToInt32(LblIdReg.Text), 0, "", DateTime.Now, "FENOLOGIA_POR_FECHA"); if (dt.Rows.Count > 0) { DDLSemanaEnvio.DataSource = dt; DDLSemanaEnvio.DataValueField = "Fecha_Semana_Envio"; DDLSemanaEnvio.DataTextField = "Fecha_Semana_Envio"; DDLSemanaEnvio.DataBind(); } else { DDLSemanaEnvio.Items.Insert(0, new ListItem(DateTime.Now.ToString("dd/MM/yyyy"), "Fecha_Semana_Envio")); } }
protected void GVFenologias_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataTable dt = new DataTable(); DB_EXT_Fenologia tot = new DB_EXT_Fenologia(); int Idreg = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Id_Regional")); dt = tot.DB_Reporte_FENOLOGIA_DETALLE(0, DDLProg.SelectedValue, 0, Idreg, 0, DDLCamp.SelectedItem.Text, DateTime.Now, "TOTALES"); if (dt.Rows[0][0].ToString() != "") { ((Label)e.Row.FindControl("blNumBoletas")).Text = dt.Rows[0][0].ToString(); ((Label)e.Row.FindControl("LblProdVig")).Text = dt.Rows[0][1].ToString(); ((Label)e.Row.FindControl("LblSupAct")).Text = dt.Rows[0][2].ToString(); } else { ((Label)e.Row.FindControl("blNumBoletas")).Text = "0"; ((Label)e.Row.FindControl("LblProdVig")).Text = "0"; ((Label)e.Row.FindControl("LblSupAct")).Text = "0"; } } }