示例#1
0
        public void DistributeLoadTest()
        {
            var repository    = new Data.Repository(new Data.CathedraDBDataContext());
            var plan          = repository.GetTableLoadInCoursePlan().Where(x => x.SortLoad.Algorithm == 4);
            var planSumHourse = plan.Sum(x => x.CountHours);
            var classTest     = new DistributeLoadIsExercisesAndExchange(repository);
            var saveData      = false;

            var result          = classTest.DistributeLoad(plan, saveData);
            var resultSumHourse = result.Sum(x => x.CountHours);

            Assert.AreEqual(resultSumHourse, planSumHourse);
        }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Действительно распределить нагрузку?", "",
                                         MessageBoxButtons.YesNo,
                                         MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                var exchange = new DistributeLoadIsExercisesAndExchange(_rep);
                exchange.DistributeLoad();
                MessageBox.Show("Распределение завершенно");
                UpdateDataGridView();
            }
        }