示例#1
0
        private void GetApprisalFormReportFromDb(Discipline discipline)
        {
            var appraisaFormReportService = new AppraisalFormReportService(_unit, _unit);
            var journalCurriculum         = Curriculum.JournalCurricula.ToList().Find(g => g.Discipline.Id == discipline.Id);

            if (journalCurriculum.FormReport.Name == "зачёт")
            {
                AppraisalFormReports = new List <AppraisalFormReport>();
                AppraisalFormReports.Add(appraisaFormReportService.GetAppraisalFormReportByValue("зачтено"));
                AppraisalFormReports.Add(appraisaFormReportService.GetAppraisalFormReportByValue("незачтено"));
            }
            else
            {
                AppraisalFormReports = new List <AppraisalFormReport>();
                AppraisalFormReports = appraisaFormReportService.GetAllAppraisalFormReport().ToList();
                var x1 = AppraisalFormReports.Find(t => t.Value == "зачтено");
                var x2 = AppraisalFormReports.Find(t => t.Value == "незачтено");
                AppraisalFormReports.Remove(x1);
                AppraisalFormReports.Remove(x2);
            }
            var cleanParametr = new List <AppraisalFormReport>();

            cmBox_AppraisalFormReport.DataSource = cleanParametr;
            cmBox_AppraisalFormReport.DataSource = AppraisalFormReports;
        }
示例#2
0
        private void GetAllDataFromDb()
        {
            var appraisalFormReportService = new AppraisalFormReportService(_unit, _unit);
            var appraisalFormReport        = appraisalFormReportService.GetAppraisalFormReportById(_entityId);

            IdText    = appraisalFormReport.Id.ToString();
            ValueText = appraisalFormReport.Value;
        }
示例#3
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            var appraisalFormReportService = new AppraisalFormReportService(_unit, _unit);
            var student = appraisalFormReportService.CreateAppraisalFormReport(ValueText);

            _unit.Commit();
            _context.Dispose();
            this.Close();
        }
示例#4
0
        private void DeleteAppraisalFormReport(object sender, EventArgs e)
        {
            var appraisalFormReport = new AppraisalFormReportService(_unit, _unit);

            appraisalFormReport.RemoveAppraisalFormReport((AppraisalFormReport)appraisalFormReportGV.CurrentRow.DataBoundItem);
            _unit.Commit();
            _unit = new UnitOfWork(_context);
            this.SearchAppraisalFormReport(13, _tBox_searchValue);
        }
示例#5
0
        private void btn_update_Click(object sender, EventArgs e)
        {
            var appraisalFormReportService = new AppraisalFormReportService(_unit, _unit);
            var appraisalFormReport        = appraisalFormReportService.GetAppraisalFormReportById(_entityId);

            appraisalFormReport.Value = ValueText;
            appraisalFormReportService.UpdateAppraisalFormReport(appraisalFormReport);
            _unit.Commit();
            _context.Dispose();
            this.Close();
        }
示例#6
0
 private void SearchAppraisalFormReport(int code, string value)
 {
     if (code == 13 && cmBox_search.SelectedIndex == 0 && value != "" && EntitiesIndex == 6)
     {
         var appraisalFormReportService = new AppraisalFormReportService(_unit, _unit);
         var appraisalFormReport        = appraisalFormReportService.GetAppraisalFormReportById(Convert.ToInt32(_tBox_searchValue));
         appraisalFormReportGV.DataSource = new List <AppraisalFormReport>()
         {
             appraisalFormReport
         };
     }
     if (code == 13 && cmBox_search.SelectedIndex == 1 && value != "")
     {
         var appraisalFormReportService = new AppraisalFormReportService(_unit, _unit);
         var appraisalFormReport        = appraisalFormReportService.GetAppraisalFormReportByValue(_tBox_searchValue);
         appraisalFormReportGV.DataSource = new List <AppraisalFormReport>()
         {
             appraisalFormReport
         };
     }
 }