protected void Seleccionar_VALORES_COSECHA() { DB_EXT_Rendimiento rend = new DB_EXT_Rendimiento(); DataTable dt = new DataTable(); dt = rend.DB_Reporte_DETALLE_PLANILLA_CULTIVO(LblIdInsProd.Text, "SUP_CULTIVADA"); if (dt.Rows.Count > 0) { TxtSupSiem.Text = ((Convert.ToDecimal(dt.Rows[0][0].ToString()) * Convert.ToDecimal(dt.Rows[0][1].ToString())) / 100).ToString(); dt = rend.DB_Reporte_DETALLE_PLANILLA_CULTIVO(LblIdInsProd.Text, "REND_PROD"); if (dt.Rows.Count > 0) { TxtRedimiento.Text = dt.Rows[0][9].ToString(); TxtPesoApro.Text = (Convert.ToDecimal(TxtRedimiento.Text) * Convert.ToDecimal(TxtSupSiem.Text)).ToString(); } else { TxtRedimiento.Text = "0"; TxtPesoApro.Text = "0"; } } else { TxtSupSiem.Text = "0"; TxtRedimiento.Text = "0"; TxtPesoApro.Text = "0"; } dt = rend.DB_Reporte_DETALLE_PLANILLA_CULTIVO(LblIdInsProd.Text, "FECHA_SIEMBRA"); TxtFechSiem.Text = dt.Rows[0][1].ToString(); }
protected void GVAvances_RowDataBound(object sender, GridViewRowEventArgs e) { DB_RegionesApoyadas ListRegCamp = new DB_RegionesApoyadas(); DB_EXT_Fenologia Luis = new DB_EXT_Fenologia(); DB_EXT_Rendimiento ex = new DB_EXT_Rendimiento(); DataTable dt = new DataTable(); if (e.Row.RowType == DataControlRowType.DataRow) { int IdInsOrg = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Id_InscripcionOrg").ToString()); int IdComunidad = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Id_Municipio").ToString()); /*****************************/ dt = Luis.DB_Seleccionar_NUMPROD_TOTSUP(IdInsOrg, IdComunidad); ((Label)e.Row.FindControl("LblNumBenefVig")).Text = dt.Rows[0][0].ToString(); ((Label)e.Row.FindControl("LblSupApoyada")).Text = dt.Rows[0][1].ToString(); dt = ex.DB_Reporte_DETALLE_PLANILLA(IdInsOrg, "", "", "RENDIMIENTO_PROMEDIO"); ((Label)e.Row.FindControl("LblRendimiento")).Text = dt.Rows[0][0].ToString(); try { ((Label)e.Row.FindControl("LblProdEstim")).Text = (Convert.ToDecimal(((Label)e.Row.FindControl("LblSupApoyada")).Text) * Convert.ToDecimal(((Label)e.Row.FindControl("LblRendimiento")).Text)).ToString(); } catch { ((Label)e.Row.FindControl("LblProdEstim")).Text = "0"; } } }
/*****************************/ private void Calcularar_AVANCE_SIEMBRA_CULTIVO() { DB_EXT_Rendimiento avsiem = new DB_EXT_Rendimiento(); DataTable dt = new DataTable(); dt = avsiem.DB_Reporte_DETALLE_PLANILLA_CULTIVO(LblIdInsProd.Text, "ANAVCE_SIEM"); LblAvanSiem.Text = dt.Rows[0][0].ToString(); }
private void Calcularar_PORCENTAJE_FENOLOGIA() { DB_EXT_Rendimiento avsiem = new DB_EXT_Rendimiento(); DataTable dt = new DataTable(); dt = avsiem.DB_Reporte_DETALLE_PLANILLA(Convert.ToInt32(DDLFenologia.SelectedValue), LblIdInsProd.Text, DDLEstadoFF.SelectedValue, "INSUMO_ANAVCE_SIEM"); TxtPorcentaje.Text = dt.Rows[0][0].ToString(); LblPorcentaje.Text = dt.Rows[0][0].ToString(); }
private void Desplegar_INSUMOS_PRODUCTOR() { DB_EXT_Rendimiento ex = new DB_EXT_Rendimiento(); DataTable dt = new DataTable(); dt = ex.DB_Reporte_DETALLE_PLANILLA(Convert.ToInt32(LblIdInsOrg.Text), LblIdInsProd.Text, "SEMILLA", "INSUMO_PRODUCTOR"); if (dt.Rows.Count > 0) { DDLVariedad.DataSource = dt; DDLVariedad.DataValueField = "Valor1"; DDLVariedad.DataTextField = "Valor1"; DDLVariedad.DataBind(); TxtVariedad.Text = DDLVariedad.SelectedValue; } else { TxtVariedad.Visible = true; DDLVariedad.Visible = false; } }
private void Datos_Org_ENCABEZADO() { DB_AP_Registro_Org d_org = new DB_AP_Registro_Org(); DataTable dt = new DataTable(); dt = d_org.DB_Desplegar_ENCABEZADO_ORG(Convert.ToInt32(LblIdInsOrg.Text)); LblOrg.Text = dt.Rows[0][2].ToString(); LblIdCamp.Text = dt.Rows[0][5].ToString(); LblCamp.Text = dt.Rows[0][6].ToString(); LblProg.Text = dt.Rows[0][9].ToString(); LblIdReg.Text = dt.Rows[0][7].ToString(); DB_AP_Productor p = new DB_AP_Productor(); dt = p.DB_Seleccionar_ENCABEZADO_PROD(LblIdInsProd.Text, "DATS_PROD"); LblProductor.Text = dt.Rows[0][0].ToString() + " " + dt.Rows[0][1].ToString() + " " + dt.Rows[0][2].ToString(); DB_EXT_Rendimiento ex = new DB_EXT_Rendimiento(); dt = ex.DB_Reporte_DETALLE_PLANILLA(Convert.ToInt32(LblIdInsOrg.Text), LblIdInsProd.Text, LblProg.Text, "VARIEDADESPROD"); TxtVariedad.Text = dt.Rows[0][0].ToString(); }
private void Calcularar_AVANCE_SIEMBRA() { DB_EXT_Rendimiento avsiem = new DB_EXT_Rendimiento(); DataTable dt = new DataTable(); dt = avsiem.DB_Reporte_DETALLE_PLANILLA(Convert.ToInt32(DDLFenologia.SelectedValue), LblIdInsProd.Text, DDLEstadoFF.SelectedValue, "INSUMO_ANAVCE_SIEM"); TxtPorcentaje.Text = dt.Rows[0][0].ToString(); if (DDLFenologia.SelectedItem.Text == "FECHA Y AVANCE DE SIEMBRA") { LblAvanSiem.Text = dt.Rows[0][0].ToString(); if (Convert.ToDecimal(dt.Rows[0][0].ToString()) == 100) { TxtPorcentaje.Enabled = false; } else { TxtPorcentaje.Enabled = true; } } else { TxtPorcentaje.Enabled = true; } }
protected void GVOrgSup_RowDataBound(object sender, GridViewRowEventArgs e) { DB_EXT_Rendimiento rend = new DB_EXT_Rendimiento(); DB_EXT_Fenologia numBol = new DB_EXT_Fenologia(); DataTable dt = new DataTable(); decimal rendi = 0; decimal supe = 0; if (e.Row.RowType == DataControlRowType.DataRow) { int id = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Id_InscripcionOrg")); dt = rend.DB_Reporte_DETALLE_PLANILLA(id, "", "", "RENDIMIENTO_PROMEDIO"); rendi = Convert.ToDecimal(dt.Rows[0][0].ToString()); //dt = numBol.DB_Datos_FACE_FENOLOGICA(id, Convert.ToInt32(DDLCamp.SelectedValue), 34, Convert.ToInt32(DDLRegional.SelectedValue), "TRIGO", "Avance", 1, DateTime.Now, "RENDIMIENTO"); dt = numBol.DB_Datos_FACE_FENOLOGICA(id, Convert.ToInt32(DDLCamp.SelectedValue), 34, Convert.ToInt32(DDLRegional.SelectedValue), "TRIGO", "Avance", 1, DateTime.Now, "PORCENTAGE_COSECHA"); supe = Convert.ToDecimal(dt.Rows[0][0].ToString()); decimal valor = (((rendi * Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SumaHas"))) * supe) / 100); ((Label)e.Row.FindControl("LblSupCos")).Text = supe.ToString(); ((Label)e.Row.FindControl("LblFanegasEstim")).Text = valor.ToString(); switch (DDLUnidades.SelectedValue) { case "1": //GVOrgSup.Columns[4].HeaderText = DDLUnidades.SelectedItem.Text; break; case "2": // ((TextBox)e.Row.FindControl("TxtObjetivo")).Text = (((rendi * Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SumaHas"))) * supe) / 100).ToString(); break; case "3": //((TextBox)e.Row.FindControl("TxtObjetivo")).Text = (((rendi * Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SumaHas"))) * supe) / 100).ToString(); break; } // ((DropDownList)e.Row.FindControl("DDLZona")).Items.Insert(0, new ListItem(zona, zona, true)); //if (tramo == "Salida") //{ // ((DropDownList)e.Row.FindControl("DDLZona")).Items.Insert(0, new ListItem(zona, zona, true)); // ((DropDownList)e.Row.FindControl("DDLZona")).DataBind(); // ((DropDownList)e.Row.FindControl("DDLDestino")).Items.Insert(0, new ListItem(destino, destino, true)); // ((DropDownList)e.Row.FindControl("DDLDestino")).DataBind(); // ((TextBox)e.Row.FindControl("TxtObjetivo")).Text = objetivo; // ((TextBox)e.Row.FindControl("TxtFecha")).Text = fecha; // ((DropDownList)e.Row.FindControl("DDLHora")).Items.Insert(0, new ListItem(hora, hora, true)); // ((DropDownList)e.Row.FindControl("DDLMinuto")).Items.Insert(0, new ListItem(min, min, true)); //} //else //{ // ((DropDownList)e.Row.FindControl("DDLZona")).Items.Insert(0, new ListItem(zona, zona, true)); // ((DropDownList)e.Row.FindControl("DDLZona")).DataBind(); // ((DropDownList)e.Row.FindControl("DDLZona")).Enabled = false; // ((DropDownList)e.Row.FindControl("DDLDestino")).Items.Insert(0, new ListItem(destino, destino, true)); // ((DropDownList)e.Row.FindControl("DDLDestino")).DataBind(); // ((DropDownList)e.Row.FindControl("DDLDestino")).Enabled = false; // ((TextBox)e.Row.FindControl("TxtObjetivo")).Enabled = fal10se; // ((TextBox)e.Row.FindControl("TxtFecha")).Text = fecha; // ((DropDownList)e.Row.FindControl("DDLHora")).Items.Insert(0, new ListItem(hora, hora, true)); // ((DropDownList)e.Row.FindControl("DDLMinuto")).Items.Insert(0, new ListItem(min, min, true)); //} } }