Exemple #1
0
        private void GetFormReportFromDb()
        {
            var formReportService = new FormReportService(_unit, _unit);
            var formReport        = formReportService.GetAllFormReport();

            comboBox3.DataSource = formReport.ToList();
        }
Exemple #2
0
        private void GetAllDataFromDb()
        {
            var formReportService = new FormReportService(_unit, _unit);
            var formReport        = formReportService.GetFormReportById(_entityId);

            IdText   = formReport.Id.ToString();
            NameText = formReport.Name;
        }
Exemple #3
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            var formReportService = new FormReportService(_unit, _unit);
            var student           = formReportService.CreateFormReport(NameText);

            _unit.Commit();
            _context.Dispose();
            this.Close();
        }
Exemple #4
0
        private void DeleteFormReport(object sender, EventArgs e)
        {
            var formReport = new FormReportService(_unit, _unit);

            formReport.RemoveFormReport((FormReport)formReportGV.CurrentRow.DataBoundItem);
            _unit.Commit();
            _unit = new UnitOfWork(_context);
            this.SearchFormReport(13, _tBox_searchValue);
        }
Exemple #5
0
        private void btn_update_Click(object sender, EventArgs e)
        {
            var formReportService = new FormReportService(_unit, _unit);
            var formReport        = formReportService.GetFormReportById(_entityId);

            formReport.Name = NameText;
            formReportService.UpdateFormReport(formReport);
            _unit.Commit();
            _context.Dispose();
            this.Close();
        }
Exemple #6
0
 private void SearchFormReport(int code, string value)
 {
     if (code == 13 && cmBox_search.SelectedIndex == 0 && value != "" && EntitiesIndex == 5)
     {
         var formReportService = new FormReportService(_unit, _unit);
         var formReport        = formReportService.GetFormReportById(Convert.ToInt32(_tBox_searchValue));
         formReportGV.DataSource = new List <FormReport>()
         {
             formReport
         };
     }
     if (code == 13 && cmBox_search.SelectedIndex == 1 && value != "")
     {
         var formReportService = new FormReportService(_unit, _unit);
         var formReport        = formReportService.GetFormReportByName(_tBox_searchValue);
         formReportGV.DataSource = new List <FormReport>()
         {
             formReport
         };
     }
 }