Exemplo n.º 1
0
 private void редактированиеToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Estimates frm = new Estimates(numPrepod, numTree);
     frm.Show();
 }
 //private void bwStream_DoWork(object sender, DoWorkEventArgs e)
 //{
 //    string path = prepodPath + studentPath + ofd.SafeFileName;
 //    FileStream inputstream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.None);
 //    FileStream outputstream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
 //    bwStream.ReportProgress(0);
 //    decimal part;
 //    int i = 0;
 //    try
 //    {
 //        byte readbyte = 0;
 //        while (inputstream.Position < inputstream.Length)
 //        {
 //            i++;
 //            if (i == 100)
 //            {
 //                part = (decimal)inputstream.Position / inputstream.Length * 100;
 //                if (part < 100)
 //                    bwStream.ReportProgress((int)part);
 //                i = 0;
 //                if (bwStream.CancellationPending)
 //                {
 //                    break;
 //                }
 //            }
 //            readbyte = (byte)inputstream.ReadByte();
 //            outputstream.WriteByte(readbyte);
 //        }
 //        if (!bwStream.CancellationPending)
 //        {
 //            bwStream.ReportProgress(100);
 //        }
 //    }
 //    finally
 //    {
 //        outputstream.Close();
 //        inputstream.Close();
 //        MessageBox.Show("Задача отправлена!");
 //        запускаем проверку
 //        string[] tasks = new string[2];
 //        tasks[1] = numTask;
 //        BlackBox frm = new BlackBox(tasks, numStudent, numPrepod);
 //        frm.Show();
 //    }
 //}
 //private void insertTask(string path, string numTask)
 //{
 //    try
 //    {
 //        conn.Open();
 //        comm.CommandText = "update  [Выполненная задача] set [Ссылка на работу] = '" + path + "', [Дата сдачи]='" + DateTime.Today.ToShortDateString() + "' where [№ задачи] = '" + numTask + "' and [№ студента] = '" + numStudent + "'";
 //        comm.ExecuteNonQuery();
 //    }
 //    catch (Exception exc)
 //    {
 //        MessageBox.Show(exc.ToString());
 //    }
 //    finally
 //    {
 //        conn.Close();
 //    }
 //}
 private void успеваемостьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Estimates se = new Estimates(numPrepod, numTree);
     se.Show();
 }
Exemplo n.º 3
0
 private void открытьКурсToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     Estimates se = new Estimates(numPrepod, numTree);
     se.Show();
 }
 private void button2_Click(object sender, EventArgs e)
 {
     Estimates frm = new Estimates(numPrepod, "1");
     frm.Show();
     this.Hide();
 }