Пример #1
0
        public MainForm()
        {
            InitializeComponent();

            _repo = new SessionRepository("data source=tcp:" + "127.0.0.1" + ",1433;Database=Session-S-13-14-1;User ID = sa;Password = ghjuhfvvf;multipleactiveresultsets=True");
            _sRepo = new ScheduleRepository("data source=tcp:" + "127.0.0.1" + ",1433;Database=S-13-14-1;User ID = sa;Password = ghjuhfvvf;multipleactiveresultsets=True");
        }
Пример #2
0
        public ExamProperties(ScheduleRepository sRepo, SessionRepository repo, int examToUpdateId, ExamPropertiesMode mode)
        {
            InitializeComponent();

            _sRepo = sRepo;
            _repo = repo;
            _examId = examToUpdateId;
            _mode = mode;

            if (_mode == ExamPropertiesMode.Edit)
            {
                _exam = _repo.GetExam(_examId);
            }

            if (_mode == ExamPropertiesMode.New)
            {
                _exam = new Exam();
            }
        }