コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            numlot      = 0;
            list1[0]    = new List <Process>();
            CantProcess = int.Parse(comboBox1.Text);

            for (int i = 1; i <= CantProcess; i++)
            {
                Process pr = new Process();

                GenID();
                GenOp();
                GenTE();

                //numlot++;
                pr.IDs       = ID.ToString();
                pr.OP        = cOp;
                pr.TE        = TT.ToString();
                pr.Nombre    = "--";
                pr.Flag      = "0";
                pr.FirstTime = true;

                list1[0].Add(pr);

                //if (numlot <= 4)
                //{
                //    list1[ListInd].Add(pr);
                //}
                //else if (numlot > 4)
                //{
                //    ListInd++;
                //    numlot = 1;
                //    list1[ListInd] = new List<Process>();
                //    list1[ListInd].Add(pr);
                //}
            }

            this.Hide();
            Processwindow wp1 = new Processwindow(list1);

            wp1.Show();
        }
コード例 #2
0
        private void start_Click(object sender, EventArgs e)
        {
            list1[0] = new List <Process>();
            ind      = 0;
            numlot   = 0;
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                Process pr = new Process();
                ind++;
                numlot++;
                pr.IDs    = (string)row.Cells["ID"].Value;
                pr.Nombre = (string)row.Cells["NombProg"].Value;
                pr.TE     = (string)row.Cells["TME"].Value;
                pr.OP     = (string)row.Cells["Op"].Value;
                pr.Flag   = "0";

                int cu = dataGridView1.RowCount;
                if (cu == ind)
                {
                    //SOLO PARA IGNORAR LA ULTIMA LINEA
                    continue;
                }
                else
                {
                    checkN = dt.CheckIFNum(pr.TE);
                    if (dt.EvaOp(pr.OP, pr.IDs, false, false) == false)
                    {
                        return;
                    }

                    if (checkN == false || dt.num <= 0)
                    {
                        MessageBox.Show("ID: " + pr.IDs + "\nEl tiempo estimado (TE) ingresado no es un numero o es menor o igual a 0.");
                        return;
                    }
                    else
                    {
                        if (numlot <= 4)
                        {
                            list1[ListInd].Add(pr);
                        }
                        else if (numlot > 4)
                        {
                            ListInd++;
                            numlot         = 1;
                            list1[ListInd] = new List <Process>();
                            list1[ListInd].Add(pr);
                        }
                    }
                }
            }

            count = list1[0].Count();

            if (count < 1)
            {
                MessageBox.Show("La lista de Procesos esta vacía");
                return;
            }
            else
            {
                this.Hide();
                //wp1.Show();
                Processwindow wp1 = new Processwindow(list1);
                wp1.Show();


                //dt.IniProcess(list1);
            }
        }