private void GetFormReportFromDb() { var formReportService = new FormReportService(_unit, _unit); var formReport = formReportService.GetAllFormReport(); comboBox3.DataSource = formReport.ToList(); }
private void GetAllDataFromDb() { var formReportService = new FormReportService(_unit, _unit); var formReport = formReportService.GetFormReportById(_entityId); IdText = formReport.Id.ToString(); NameText = formReport.Name; }
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(); }
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); }
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(); }
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 }; } }