コード例 #1
0
        protected void Reporte_PLANILLA_PROD()
        {
            DB_AP_Registro_Prod lst = new DB_AP_Registro_Prod();

            GVListaProd.DataSource = lst.DB_Reporte_PLANILLA_PROD(Convert.ToInt32(Session["IdInsOrg"].ToString()), "PLANILLA");
            GVListaProd.DataBind();
        }
コード例 #2
0
        protected void Reporte_LISTA_PROD()
        {
            DB_AP_Registro_Prod ListRep = new DB_AP_Registro_Prod();

            GVListOfi.DataSource = ListRep.DB_Reporte_PLANILLA_PROD(Convert.ToInt32(LblIdInsOrg.Text), "LISTA_DEPURADOS");
            GVListOfi.DataBind();
        }
コード例 #3
0
        protected void Desplegar_HISTORIAL()
        {
            DataTable           dt   = new DataTable();
            DB_AP_Registro_Prod List = new DB_AP_Registro_Prod();

            //dt = List.DB_Desplegar_HISTORIAL(LblCi.Text, "DEUDA");
            //if (dt.Rows.Count!=0)
            //{
            //LblProductor.Text = dt.Rows[0][12].ToString() + " " + dt.Rows[0][13].ToString() + " " + dt.Rows[0][14].ToString();
            //LblExt.Text = dt.Rows[0][16].ToString();
            GVDeuda.DataSource = List.DB_Desplegar_HISTORIAL(LblCi.Text, "DEUDA");
            GVDeuda.DataBind();
            GVDependencia.DataSource = List.DB_Desplegar_HISTORIAL(LblCi.Text, "DEPENDENCIA");
            GVDependencia.DataBind();
            GVParticipacion.DataSource = List.DB_Desplegar_HISTORIAL(LblCi.Text, "PARTICIPACION");
            GVParticipacion.DataBind();
            //}
        }
コード例 #4
0
        protected void BtnVerificar_Click(object sender, EventArgs e)
        {
            DB_AP_Comunidad     busc = new DB_AP_Comunidad();
            DB_AP_Registro_Prod regP = new DB_AP_Registro_Prod();
            DataTable           dt   = new DataTable();
            int i = 0;

            Label1.Text = regP.DB_GeneraCodigo_AP_INSCRIPCION_PRO(Convert.ToInt32(LblIdCamp.Text), Convert.ToInt32(DDLSigla.SelectedValue), DDLPrograma.SelectedValue);
            foreach (GridViewRow dgi in GridView1.Rows)
            {
                dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), Convert.ToInt32(GridView1.Rows[i].Cells[1].Text), "0", "COMU_ORG");
                if (dt.Rows.Count > 0)
                {
                    LblMsj.Text = "EXISTE LA COMUNIDAD " + GridView1.Rows[i].Cells[2].Text;
                }
                else
                {
                    /************************** BUSCA PERSONA  *********************************/
                    dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), 0, GridView1.Rows[i].Cells[6].Text, "PERSONA");
                    if (dt.Rows.Count > 0)
                    {
                        LblMsj.Text = LblMsj.Text + " --- " + "EXISTE LA PERSONA " + GridView1.Rows[i].Cells[4].Text + " " + GridView1.Rows[i].Cells[5].Text + "Con cedula de identidad: " + GridView1.Rows[i].Cells[6].Text;
                    }
                    else
                    {
                        /******************** busca productor *******************/
                        dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), 0, GridView1.Rows[i].Cells[6].Text, "PRODUCTOR");
                        if (dt.Rows.Count > 0)
                        {
                            LblMsj.Text = LblMsj.Text + " --- " + "EXISTE EL PRODUCTOR DE NOMBRE" + GridView1.Rows[i].Cells[4].Text + " " + GridView1.Rows[i].Cells[5].Text + " Con cedula de identidad: " + GridView1.Rows[i].Cells[6].Text;
                        }
                        else
                        {
                            BtnImportar.Enabled = false;
                        }
                    }
                }
                i++;
            }
        }
コード例 #5
0
        protected void BtnImportar_Click(object sender, EventArgs e)
        {
            try
            {
                DB_AP_Comunidad     busc = new DB_AP_Comunidad();
                DB_AP_Registro_Prod regP = new DB_AP_Registro_Prod();
                DataTable           dt   = new DataTable();
                int i = 0;
                foreach (GridViewRow dgi in GridView1.Rows)
                {
                    if (GridView1.Rows[i].Cells[0].Text == " ")//lrojas: si hay espacios se salta
                    {
                        break;
                    }
                    //****
                    //if (GridView1.Rows[i].Cells[1].Text == " ")
                    //    break;
                    //if (GridView1.Rows[i].Cells[6].Text == " ")
                    //   break;

                    if (DDLSigla.SelectedValue == string.Empty)
                    {
                        LblMsj.Text = "SELECCIONE ORGANIZACIÓN SEGÚN PROGRAMA.";
                        return;
                    }
                    //**
                    if (GridView1.Rows[i].Cells[9].Text == " ")
                    {
                        string auxiliar = GridView1.Rows[i].Cells[6].Text + GridView1.Rows[i].Cells[7].Text + GridView1.Rows[i].Cells[8].Text;
                        //ingresar ci con extencion manualmente
                    }
                    //**
                    ////if (GridView1.Rows[i].Cells[2].Text != DDLSigla.SelectedItem.Text)
                    //if (GridView1.Rows[i].Cells[5].Text != DDLSigla.SelectedItem.Text)//NOMBRE COMUNIDAD
                    //{
                    //    //string nombre = GridView1.Rows[i].Cells[3].Text + " "+ GridView1.Rows[i].Cells[4].Text + " " + GridView1.Rows[i].Cells[5].Text;
                    //    string nombre = GridView1.Rows[i].Cells[6].Text + " " + GridView1.Rows[i].Cells[7].Text + " " + GridView1.Rows[i].Cells[8].Text;
                    //    LblMsj.Text = "LA ORGANIZACIÓN SELECCIONADA NO CONCUERDA CON LA DEL ARCHIVO (NOMBRE_COMUNIDAD). \n Productor: " + nombre;
                    //    return;
                    //}

                    /********************* VERIFICAR SI LA ORGANIZACION ES PARTE DE ESTA COMUIDAD ***********************/
                    //dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), Convert.ToInt32(GridView1.Rows[i].Cells[1].Text), "0", "COMU_ORG");
                    dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), Convert.ToInt32(GridView1.Rows[i].Cells[5].Text), "0", "COMU_ORG"); //
                    if (dt.Rows.Count <= 0)
                    {
                        //Registrar_COMU_ORG(Convert.ToInt32(GridView1.Rows[i].Cells[1].Text));
                        Registrar_COMU_ORG(Convert.ToInt32(GridView1.Rows[i].Cells[5].Text));
                    }
                    /************************** BUSCA PERSONA  *********************************/
                    //dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), 0, GridView1.Rows[i].Cells[6].Text, "PERSONA");
                    dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), 0, GridView1.Rows[i].Cells[9].Text, "PERSONA");// 9 CI
                    if (dt.Rows.Count <= 0)
                    {
                        Persona p = new Persona();

                        /*p.Id_Persona = GridView1.Rows[i].Cells[6].Text;
                        *  p.ci = GridView1.Rows[i].Cells[6].Text;
                        *  p.ext = GridView1.Rows[i].Cells[7].Text;
                        *  p.Nombres = GridView1.Rows[i].Cells[3].Text;
                        *  p.Primer_ap = GridView1.Rows[i].Cells[4].Text;
                        *  p.Segundo_ap = GridView1.Rows[i].Cells[5].Text;*/
                        p.Id_Persona = GridView1.Rows[i].Cells[9].Text;  //CI
                        p.ci         = GridView1.Rows[i].Cells[9].Text;  //CI
                        p.ext        = GridView1.Rows[i].Cells[10].Text; //EXT_CI
                        p.Nombres    = GridView1.Rows[i].Cells[6].Text;  //NOMBRE
                        p.Primer_ap  = GridView1.Rows[i].Cells[7].Text;  //AP_PATERNO
                        p.Segundo_ap = GridView1.Rows[i].Cells[8].Text;  //AP_MATERNO

                        p.Fecha_nacimiento = Convert.ToDateTime("01/01/1900");
                        p.Sexo             = true;
                        p.Telef_fijo       = "";
                        p.Telef_cel        = "";
                        p.Fecha_registro   = DateTime.Now;
                        p.Estado           = "INSCRITO";
                        Registrar_PERSONA(p);
                    }
                    /******************** busca productor *******************/
                    //dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), 0, GridView1.Rows[i].Cells[6].Text, "PRODUCTOR");
                    dt = busc.DB_Buscar_COMU_ORG(Convert.ToInt32(DDLSigla.SelectedValue), 0, GridView1.Rows[i].Cells[9].Text, "PRODUCTOR");
                    if (dt.Rows.Count <= 0)
                    {
                        AP_Productor pr = new AP_Productor();

                        /*pr.Id_Productor = regP.DB_GeneraCodigo_AP_INSCRIPCION_PRO(Convert.ToInt32(DDLCamp.SelectedValue), Convert.ToInt32(DDLSigla.SelectedValue), DDLPrograma.SelectedValue);
                         * pr.Id_Persona = GridView1.Rows[i].Cells[6].Text;
                         * pr.Id_Comunidad = Convert.ToInt32(GridView1.Rows[i].Cells[1].Text);
                         * pr.Id_InscripcionOrg = Convert.ToInt32(DDLSigla.SelectedValue);
                         * pr.Id_Campanhia = Convert.ToInt32(DDLCamp.SelectedValue);
                         * pr.Programa = DDLPrograma.SelectedValue;
                         * pr.Tipo_Inscripcion = "Beneficiario";
                         * pr.Tipo_Produccion = "PEQUEÑO";
                         * pr.Has_Inscrito = Convert.ToDecimal(GridView1.Rows[i].Cells[8].Text);
                         * pr.Has_Ejecutado = Convert.ToDecimal(0);
                         * pr.Has_Propio = Convert.ToDecimal(0);
                         * pr.Rau = 0;
                         * pr.Estado = "INSCRITO";
                         * pr.Observacion = "";*/
                        pr.Id_Productor      = regP.DB_GeneraCodigo_AP_INSCRIPCION_PRO(Convert.ToInt32(DDLCamp.SelectedValue), Convert.ToInt32(DDLSigla.SelectedValue), DDLPrograma.SelectedValue);
                        pr.Id_Persona        = GridView1.Rows[i].Cells[9].Text;                  //ci
                        pr.Id_Comunidad      = Convert.ToInt32(GridView1.Rows[i].Cells[5].Text); //idcomunidad
                        pr.Id_InscripcionOrg = Convert.ToInt32(DDLSigla.SelectedValue);
                        pr.Id_Campanhia      = Convert.ToInt32(DDLCamp.SelectedValue);
                        pr.Programa          = DDLPrograma.SelectedValue;
                        pr.Tipo_Inscripcion  = "Beneficiario";
                        pr.Tipo_Produccion   = "PEQUEÑO";
                        pr.Has_Inscrito      = Convert.ToDecimal(GridView1.Rows[i].Cells[11].Text);//hectareas inscritas
                        pr.Has_Ejecutado     = Convert.ToDecimal(0);
                        pr.Has_Propio        = Convert.ToDecimal(0);
                        pr.Rau         = 0;
                        pr.Estado      = "INSCRITO";
                        pr.Observacion = "";
                        //**nuevos
                        pr.Departamento    = LblDep.Text;
                        pr.Id_Provincia    = Convert.ToInt32(GridView1.Rows[i].Cells[2].Text); //id_provincia
                        pr.Id_Municipio    = Convert.ToInt32(GridView1.Rows[i].Cells[3].Text); //id_municipio
                        pr.Id_Organizacion = Convert.ToInt32(GridView1.Rows[i].Cells[4].Text); //id_organizacion
                        pr.Id_Credito      = GridView1.Rows[i].Cells[0].Text;                  //id_credito
                        //**
                        Registrar_INSCRIP_PRODUCTOR(pr);
                    }
                    i++;
                }
                if (GridView1.Rows.Count == 0)
                {
                    LblMsj.Text = "SIN DATOS DE IMPORTACIÓN";
                }
                else
                {
                    LblMsj.Text = "IMPORTACIÓN CONCLUIDA CON EXITO";
                }
            }
            catch (Exception ex)
            {
                LblMsj.Text = ex.Message;
                //string script = @"<script type='text/javascript'>alert('{0}');</script>";
                //script = string.Format(script, ex.Message);
                //ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
            }
        }