Ejemplo n.º 1
0
        private void VerProyectoForm_Load(object sender, EventArgs e)
        {
            groupBoxCargando.Visible = false;
            if (isLoadingAFile)
            {
                project = cp.proyecto;
            }
            else
            {
                cp = new CalculosProyecto(project);
                if (cp.proyecto.Estado == "Terminado")
                {
                    cp.calcularCargasDelProyecto();
                }
            }
            lblTitulo.Text       += " " + project.Nombre + " " + project.Tipo_edificio;
            txtFx.Text            = Convert.ToString(project.Fc);
            txtFy.Text            = Convert.ToString(project.Fy);
            txtRecublimiento.Text = Convert.ToString(project.Recubrimiento);

            dataGridView1.Rows.Add(cp.losas.Count);
            dataGridView2.Rows.Add(cp.losas.Count);

            for (int i = 0; i <= cp.losas.Count - 1; i++)
            {
                //Espesores
                dataGridView1.Rows[i].Cells[0].Value  = cp.losas[i].Nombre;
                dataGridView2.Rows[i].Cells[0].Value  = cp.losas[i].Nombre;//carga
                dataGridView1.Rows[i].Cells[1].Value  = cp.losas[i].Lx;
                dataGridView1.Rows[i].Cells[2].Value  = cp.losas[i].Ly;
                dataGridView1.Rows[i].Cells[3].Value  = cp.calculosLosas[i].LcLl;
                dataGridView1.Rows[i].Cells[4].Value  = cp.calculosLosas[i].direccionLosa;
                dataGridView1.Rows[i].Cells[5].Value  = cp.calculosLosas[i].bordesDiscontinuos;
                dataGridView1.Rows[i].Cells[6].Value  = cp.losas[i].Bordesx;
                dataGridView1.Rows[i].Cells[7].Value  = cp.losas[i].BordesY;
                dataGridView1.Rows[i].Cells[8].Value  = cp.calculosLosas[i].apoyoArmadoEnUnaDireccion;
                dataGridView1.Rows[i].Cells[9].Value  = cp.calculosLosas[i].tmin;
                dataGridView1.Rows[i].Cells[10].Value = cp.calculosLosas[i].p180;
                dataGridView1.Rows[i].Cells[11].Value = cp.calculosLosas[i].T;
                dataGridView1.Rows[i].Cells[12].Value = cp.calculosLosas[i].usar;
                dataGridView2.Rows[i].Cells[1].Value  = cp.calculosLosas[i].usar;//carga

                //Cargas
                dataGridView2.Rows[i].Cells[2].Value = cp.cargas[i].Hinclinacion;
                dataGridView2.Rows[i].Cells[3].Value = cp.calculosCargas[i].angulo;
                dataGridView2.Rows[i].Cells[4].Value = cp.calculosCargas[i].cargaMuerta;
                dataGridView2.Rows[i].Cells[5].Value = cp.calculosCargas[i].cargaViva;
                dataGridView2.Rows[i].Cells[6].Value = cp.cargas[i].Carga_adicional;
                dataGridView2.Rows[i].Cells[7].Value = cp.calculosCargas[i].cargaUltima;
                dataGridView2.Rows[i].Cells[8].Value = cp.calculosCargas[i].reaccion;
                dataGridView2.Rows[i].Cells[9].Value = cp.calculosCargas[i].reaccionAng;
            }
        }
Ejemplo n.º 2
0
        }//final insert

        //Update Estado Proyecto
        public void UpdateEstadoProyecto(Proyecto p)
        {
            try
            {
                command.CommandText = "UPDATE PROYECTO SET ESTADO = '" + p.Estado + "' WHERE ID_PROYECTO=" + Convert.ToString(p.Id);

                command.CommandType = CommandType.Text;

                connection.Open();

                command.ExecuteNonQuery();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                }
            }
        }//final insert
Ejemplo n.º 3
0
        public void InsertProyecto(Proyecto p)
        {
            try
            {
                command.CommandText = "INSERT INTO PROYECTO (ID_PROYECTO, NOMBRE, TIPO_DE_LOSAS, TERMINACION, PESO_CONCRETO, USUARIO, FC, FY, RECUBRIMIENTO, PANDERETA, ESTADO, FECHA,TIPO_EDIFICIO) VALUES(" + Convert.ToString(p.Id) + ",'" + p.Nombre + "', '" + p.Tipo_losa + "', " + Convert.ToString(p.Terminacion) + ", " + Convert.ToString(p.Peso_concreto) + ", '" + p.Usuario + "', " + Convert.ToString(p.Fc) + ", " + Convert.ToString(p.Fy) + ", " + Convert.ToString(p.Recubrimiento) + ", " + Convert.ToString(p.Pandereta) + ", '" + p.Estado + "', '" + p.Fecha + "', '" + p.Tipo_edificio + "')";
                //command.CommandText = "INSERT INTO PROYECTO * VALUES('" + p.Nombre + "', '" + p.Tipo_losa + "', " + Convert.ToString(p.Terminacion) + ", " + Convert.ToString(p.Peso_concreto) + ", '" + p.Usuario + "', " + Convert.ToString(p.Fc) + ", " + Convert.ToString(p.Fy) + ", " + Convert.ToString(p.Recubrimiento) + ", " + Convert.ToString(p.Pandereta) + ", '" + p.Estado + "', '" + p.Fecha + "')";
                command.CommandType = CommandType.Text;

                connection.Open();

                command.ExecuteNonQuery();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                }
            }
        }//final insert
Ejemplo n.º 4
0
        /// <summary>
        /// Calcula los datos sobre espesores de losa
        ///
        /// </summary>
        /// <param name="l">Losa del proyecto</param>
        public CalculosLosa(DatabaseLosa.Losa L)
        {
            DatabaseLosa.Broker b = new DatabaseLosa.Broker();
            losa     = new DatabaseLosa.Losa();
            losa     = L;
            proyecto = new Proyecto();
            proyecto = b.selectProyecto(L.Idproyecto);
            double m, tmi = 0, P180 = -1, t = 10.00;
            // bordes discontinuos
            int bordes = L.Bordesx + L.BordesY;

            bordesDiscontinuos = Convert.ToString(bordes);

            // Lc/Ll
            if (L.Lx <= L.Ly)
            {
                m = L.Lx / L.Ly;
            }
            else
            {
                m = L.Ly / L.Lx;
            }
            LcLl = Convert.ToString(m);


            if ((m >= 0.5))
            {
                direccionLosa             = "En dos direcciones";
                apoyoArmadoEnUnaDireccion = "...";
                if ((L.Lx) <= (L.Ly))
                {
                    double bs = (L.Ly / L.Lx);
                    //hacer select del proyecto para buscar fy
                    tmi = ((L.Ly * 100) * (0.8 + proyecto.Fy / 14000)) / (36 + (9 * bs));
                }
                else
                {
                    double bs = (L.Lx / L.Ly);
                    tmi = ((L.Lx * 100) * (0.8 + proyecto.Fy / 14000)) / (36 + (9 * bs));
                }


                P180 = (2 * 100 * (L.Lx + L.Ly)) / 180;
            }
            else
            {
                direccionLosa = "En una dirección";
                if (bordes == 1)
                {//empotrada-articulada
                    apoyoArmadoEnUnaDireccion = "empotrada-articulada";
                    if ((L.Lx) <= (L.Ly))
                    {
                        tmi = (L.Lx * 100) / 20 * (0.4 + proyecto.Fy / 7000);
                    }
                    else
                    {
                        tmi = (L.Ly * 100) / 20 * (0.4 + proyecto.Fy / 7000);
                    }
                }
                else if ((bordes == 4) || (bordes == 2))
                {//simplemente apoyada
                    apoyoArmadoEnUnaDireccion = "simplemente apoyada";
                    if ((L.Lx) <= (L.Ly))
                    {
                        tmi = (L.Lx * 100) / 24 * (0.4 + proyecto.Fy / 7000);
                    }
                    else
                    {
                        tmi = (L.Ly * 100) / 24 * (0.4 + proyecto.Fy / 7000);
                    }
                }
                else if (bordes == 3)
                {//en voladizo
                    apoyoArmadoEnUnaDireccion = "en voladizo";
                    if ((L.Lx) <= (L.Ly))
                    {
                        tmi = (L.Lx * 100) / 10 * (0.4 + proyecto.Fy / 7000);
                    }
                    else
                    {
                        tmi = (L.Ly * 100) / 10 * (0.4 + proyecto.Fy / 7000);
                    }
                }
                else if ((bordes == 0))
                {//empotrada-empotrada
                    apoyoArmadoEnUnaDireccion = "empotrada-empotrada";
                    if ((L.Lx) <= (L.Ly))
                    {
                        tmi = (L.Lx * 100) / 28 * (0.4 + proyecto.Fy / 7000);
                    }
                    else
                    {
                        tmi = (L.Ly * 100) / 28 * (0.4 + proyecto.Fy / 7000);
                    }
                }
            }

            tmin = Convert.ToString(tmi);
            if (P180 != -1)
            {
                p180 = Convert.ToString(P180);
            }
            else
            {
                p180 = "...";
            }



            if (P180 >= tmi)
            {
                if (P180 <= 10)
                {
                    t = 10.00;
                }
                else
                {
                    t = System.Math.Ceiling(P180);
                    if (((Convert.ToInt32(t) % 2) != 0) && (t != 15))
                    {
                        t++;
                    }
                }
            }
            else
            {
                if (tmi <= 10.00)
                {
                    t = 10.00;
                }
                else
                {
                    t = System.Math.Ceiling(tmi);
                    if (((Convert.ToInt32(t) % 2) != 0) && (t != 15))
                    {
                        t++;
                    }
                }
            }

            T = Convert.ToString(t);
            if (t < 12)
            {
                usar = "12";
            }
            else
            {
                usar = Convert.ToString(t);
            }



            //fin
        }