private void Desplegar_GRILLA() { DB_EXT_Fenologia ListFen = new DB_EXT_Fenologia(); GVFaseFenologica.DataSource = ListFen.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), 0, 0, 0, LblPrograma.Text, "", 0, DateTime.Now, "LISTA_FASE_FENOLOGICA"); GVFaseFenologica.DataBind(); }
private void Cargar_NUM_SEGUIMIENTOS() { DB_EXT_Fenologia numBol = new DB_EXT_Fenologia(); DataTable dt = new DataTable(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "0", "0", 0, DateTime.Now, "NUM_SEGUIMIENTOS"); DDLNumSeg.DataSource = dt; DDLNumSeg.DataValueField = "Num_Seg_Cultivo"; DDLNumSeg.DataTextField = "Num_Seg_Cultivo"; DDLNumSeg.DataBind(); }
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)); //} } }
private void Datos_CULTIVO() { DB_EXT_Fenologia numBol = new DB_EXT_Fenologia(); DataTable dt = new DataTable(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "TRIGO", "", 1, DateTime.Now, "NUM_BOLETAS"); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "ARROZ", "", 0, "NUM_BOLETAS"); TxtNumBoletas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 25, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", 1, DateTime.Now, "AVANCE_SIEMBRA"); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 1, Convert.ToInt32(LblIdReg.Text), "ARROZ", "Avance", 0, "AVANCE_SIEMBRA"); LblAvnSiem.Text = dt.Rows[0][0].ToString(); LblSupSem.Text = Convert.ToString(Math.Round(((Convert.ToDecimal(LblAvnSiem.Text) * Convert.ToDecimal(TxtSupApo.Text)) / 100), 2)); dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "TRIGO", "VARIEDADES"); if (dt.Rows.Count > 0) { TxtVariedadSem.Text = dt.Rows[0][0].ToString(); } dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "TRIGO", "FECHAMAXMIN"); if (dt.Rows.Count > 0) { LblFIniSiem.Text = dt.Rows[0][0].ToString(); LblFFinSiem.Text = dt.Rows[0][1].ToString(); } dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 26, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblGer1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 26, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblGer2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 27, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblPlant1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 27, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblPlant2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 28, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblMacolla1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 28, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblMacolla2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 29, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblEmbu1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 29, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblEmbu2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 30, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblEspi1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 30, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblEspi2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 31, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblFlora1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 31, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblFlora2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 32, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblGrano1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 32, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblGrano2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 33, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblMadura1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 33, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblMadura2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 34, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblCosAco1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 34, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "RENDIMIENTO"); LblCosAco2.Text = dt.Rows[0][0].ToString(); //******************************** FALTA FECHAS **********************************/ ////dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), 35, "ARROZ", "Inicial", Convert.ToInt32(LblNumSeg.Text), "FECHAACOPIO"); ////TxtFcosechaIni.Text = dt.Rows[0][0].ToString(); ////dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), 35, "ARROZ", "Final", Convert.ToInt32(LblNumSeg.Text), "FECHAACOPIO"); ////TxtFcosechaFin.Text = dt.Rows[0][0].ToString(); //DB_EXT_Fenologia numBol = new DB_EXT_Fenologia(); //DataTable dt = new DataTable(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "TRIGO", "", Convert.ToInt32(LblNumSeg.Text), "NUM_BOLETAS"); //TxtNumBoletas.Text = dt.Rows[0][0].ToString(); ////dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), "AVANCE_SIEMBRA"); ////TxtAvnSiem.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 1, Convert.ToInt32(LblIdReg.Text), "ARROZ", "Avance", 1, "AVANCE_SIEMBRA"); ////dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 1, Convert.ToInt32(LblIdReg.Text), "ARROZ", "Avance", 0, "AVANCE_SIEMBRA"); //LblAvnSiem.Text = dt.Rows[0][0].ToString(); //LblSupSem.Text = Convert.ToString(Math.Round(((Convert.ToDecimal(LblAvnSiem.Text) * Convert.ToDecimal(TxtSupApo.Text)) / 100), 2)); //dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "TRIGO", "VARIEDADES"); //if (dt.Rows.Count > 0) //{ // TxtVariedadSem.Text = dt.Rows[0][0].ToString(); //} //dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "TRIGO", "FECHAMAXMIN"); //if (dt.Rows.Count > 0) //{ // TxtFIniSiem.Text = dt.Rows[0][0].ToString(); // TxtFFinSiem.Text = dt.Rows[0][1].ToString(); //} //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 26, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtGer1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 26, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtGer2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 27, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtPlant1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 27, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtPlant2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 28, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtMacolla1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 28, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtMacolla2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 29, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtEmbu1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 29, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtEmbu2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 30, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtEspi1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 30, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtEspi2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 31, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtFlora1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 31, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtFlora2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 32, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtGrano1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 32, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtGrano2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 33, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtMadura1.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 33, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtMadura2.Text = dt.Rows[0][0].ToString(); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 34, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), "PORCENTAGE"); //TxtCosAco1.Text = dt.Rows[0][0].ToString(); /////******************************** FALTA EL RENDIMIENTO **********************************/ ////dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), 35, "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), "FECHAACOPIO"); ////TxtFcosechaIni.Text = dt.Rows[0][0].ToString(); ////dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), 35, "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), "FECHAACOPIO"); ////TxtFcosechaFin.Text = dt.Rows[0][0].ToString(); }
private void Datos_CULTIVO() { DB_EXT_Fenologia numBol = new DB_EXT_Fenologia(); DataTable dt = new DataTable(); dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "TRIGO", "VARIEDADES"); if (dt.Rows.Count > 0) { TxtVariedadSem.Text = dt.Rows[0][0].ToString(); } dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "TRIGO", "FECHAMAXMIN"); if (dt.Rows.Count > 0) { LblFIniSiem.Text = dt.Rows[0][0].ToString(); LblFFinSiem.Text = dt.Rows[0][1].ToString(); } dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "TRIGO", "", 1, DateTime.Now, "NUM_BOLETAS_FISICAS"); TxtBoletasFisicas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "TRIGO", "", 1, DateTime.Now, "NUM_BOLETAS_MONITOREO"); TxtBoletasMonitoreo.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 25, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", 1, DateTime.Now, "AVANCE_SIEMBRA"); LblAvnSiem.Text = dt.Rows[0][0].ToString(); LblSupSem.Text = Convert.ToString(Math.Round(((Convert.ToDecimal(LblAvnSiem.Text) * Convert.ToDecimal(TxtSupApo.Text)) / 100), 2)); LblFechaAUX.Text = TxtFechaIni.Text; do { dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 26, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblGer1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 27, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblPlant1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 28, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblMacolla1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 29, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblEmbu1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 30, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblEspi1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 31, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblFlora1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 32, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblGrano1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 33, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(LblFechaAUX.Text), "PORCENTAGE"); LblMadura1.Text = dt.Rows[0][0].ToString(); LblSuma.Text = (Convert.ToDecimal(LblGer1.Text) + Convert.ToDecimal(LblPlant1.Text) + Convert.ToDecimal(LblMacolla1.Text) + Convert.ToDecimal(LblEmbu1.Text) + Convert.ToDecimal(LblEspi1.Text) + Convert.ToDecimal(LblFlora1.Text) + Convert.ToDecimal(LblGrano1.Text) + Convert.ToDecimal(LblMadura1.Text)).ToString(); if (Convert.ToDateTime(LblFechaAUX.Text) <= Convert.ToDateTime(LblFIniSiem.Text)) { break; } LblFechaAUX.Text = (Convert.ToDateTime(LblFechaAUX.Text)).AddDays(-7).ToString("dd/MM/yyyy"); }while (Convert.ToDecimal(LblSuma.Text) <= 0); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 34, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE_COSECHA"); LblCosAco1.Text = dt.Rows[0][0].ToString(); LblMadura1.Text = (Convert.ToDecimal(LblMadura1.Text) - Convert.ToDecimal(LblCosAco1.Text)).ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 34, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "RENDIMIENTO"); LblCosAco2.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 35, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Inicial", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "FECHAACOPIO"); LblFcosechaIni.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 35, Convert.ToInt32(LblIdReg.Text), "TRIGO", "Final", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "FECHAACOPIO"); LblFcosechaFin.Text = dt.Rows[0][0].ToString(); }
private DataTable Busqueda_FENOLOGIA(int idfenologia, string programa, string etapa, string parametro) { DB_EXT_Fenologia numBol = new DB_EXT_Fenologia(); return(numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), idfenologia, Convert.ToInt32(LblIdReg.Text), programa, etapa, Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), parametro)); }
private void Datos_CULTIVO() { DB_EXT_Fenologia numBol = new DB_EXT_Fenologia(); DataTable dt = new DataTable(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 0, Convert.ToInt32(LblIdReg.Text), "MAIZ", "", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "NUM_BOLETAS"); TxtNumBoletas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 11, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "AVANCE_SIEMBRA"); LblAvnSiem.Text = dt.Rows[0][0].ToString(); LblSupSem.Text = Convert.ToString(Math.Round(((Convert.ToDecimal(LblAvnSiem.Text) * Convert.ToDecimal(TxtSupApo.Text)) / 100), 2)); dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "MAIZ", "VARIEDADES"); if (dt.Rows.Count > 0) { TxtVariedadSem.Text = dt.Rows[0][0].ToString(); } dt = numBol.DB_Datos_SIEMBRA(Convert.ToInt32(LblIdInsOrg.Text), "MAIZ", "FECHAMAXMIN"); if (dt.Rows.Count > 0) { LblFIniSiem.Text = dt.Rows[0][0].ToString(); LblFFinSiem.Text = dt.Rows[0][1].ToString(); } dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 12, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblEmerg.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 13, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); Lbl1y2Hojas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 14, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); Lbl3y4Hojas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 15, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); Lbl5y6Hojas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 16, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); Lbl7y8Hojas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 17, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); Lbl9y10Hojas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 18, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); Lbl11oMasHojas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 19, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblFloracion.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 20, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblEstigmas.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 21, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblGranoLechoso.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 22, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblDentadayMadurez.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 23, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "PORCENTAGE"); LblCosAco1.Text = dt.Rows[0][0].ToString(); dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 23, Convert.ToInt32(LblIdReg.Text), "MAIZ", "Avance", Convert.ToInt32(LblNumSeg.Text), Convert.ToDateTime(TxtFechaIni.Text), "RENDIMIENTO"); //dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text), 9, Convert.ToInt32(LblIdReg.Text), "ARROZ", "Avance", 0, "RENDIMIENTO"); LblCosAco2.Text = dt.Rows[0][0].ToString(); /******************************** FALTA EL RENDIMIENTO ********************************** * * dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text),35, Convert.ToInt32(LblIdReg.Text),"TRIGO", "Inicial", 1, "FECHAACOPIO"); * TxtFcosechaIni.Text = dt.Rows[0][0].ToString(); * * dt = numBol.DB_Datos_FACE_FENOLOGICA(Convert.ToInt32(LblIdInsOrg.Text), Convert.ToInt32(LblIdCamp.Text),35, Convert.ToInt32(LblIdReg.Text),"TRIGO", "Final", 1, "FECHAACOPIO"); * TxtFcosechaFin.Text = dt.Rows[0][0].ToString();*/ }