Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool cheack = true;

            foreach (DataGridViewRow r in dataGridView1.Rows)
            {
                for (int i = 2; i <= 9; i++)
                {
                    if (r.Cells[i].Value == null)
                    {
                        cheack = false;
                    }
                }
            }

            if (cheack == true)
            {
                project.Estado = "Terminado";
                Broker b = new Broker();
                b.UpdateEstadoProyecto(project);

                for (int i = 0; i < cmbLosas.Items.Count; i++)
                {
                    DatabaseLosa.Carga caga = new DatabaseLosa.Carga();
                    cmbLosas.SelectedIndex = i;

                    int HiX = Convert.ToString(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[2].Value).IndexOf("X");
                    int HiY = Convert.ToString(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[2].Value).IndexOf("Y");

                    if (HiX == -1)
                    {
                        caga.Hinclinacion = Convert.ToDouble(Convert.ToString(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[2].Value).Substring(0, HiY - 1));
                        caga.Xy           = Convert.ToString(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[2].Value).Substring(HiY);
                    }
                    else
                    {
                        caga.Hinclinacion = Convert.ToDouble(Convert.ToString(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[2].Value).Substring(0, HiX - 1));
                        caga.Xy           = Convert.ToString(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[2].Value).Substring(HiX);
                    }
                    caga.Carga_viva      = Convert.ToInt32(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[5].Value);
                    caga.Carga_adicional = Convert.ToInt32(dataGridView1.Rows[cmbLosas.SelectedIndex].Cells[6].Value);
                    caga.Id_losa         = cp.losas[cmbLosas.SelectedIndex].Id;
                    b.InsertCarga(caga);
                }
                //MenuForm menu = new MenuForm();
                VerProyectoForm vp = new VerProyectoForm();
                vp.project = new DatabaseLosa.Proyecto();
                vp.project = b.selectProyecto(project.Id);
                this.Hide();
                vp.Show();
            }
            else
            {
                MessageBox.Show("Aun hay cargas sin calcular", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
 private void listViewProyectosRecientes_DoubleClick(object sender, EventArgs e)
 {
     if (listViewProyectosRecientes.SelectedItems.Count > 0)
     {
         VerProyectoForm vp = new VerProyectoForm();
         vp.project = new DatabaseLosa.Proyecto();
         vp.project = listp[listViewProyectosRecientes.SelectedIndices[0]];
         this.Hide();
         vp.Show();
     }
 }
Esempio n. 3
0
        //metodo que habre el archivo .slc o .xml
        private void groupBoxProRecient_DragDrop(object sender, DragEventArgs e)
        {
            string[] Filelist = (string[])e.Data.GetData(DataFormats.FileDrop, false); //toma la lista de archivos que fueron arrastrados

            if ((System.IO.Path.GetExtension(Filelist[0]).ToUpperInvariant() == ".XML") || (System.IO.Path.GetExtension(Filelist[0]).ToUpperInvariant() == ".SLC"))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(Filelist[0]);
                VerProyectoForm vp = new VerProyectoForm();
                vp.project        = new DatabaseLosa.Proyecto();
                vp.isLoadingAFile = true;
                vp.cp             = new CalculosProyecto(doc);
                this.Hide();
                vp.Show();
            }
            else
            {
                MessageBox.Show("Archivo no compatible", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }