data form

This commit is contained in:
redtea committed 2024-06-04 22:34:17 +03:00
1 parent eee7548fc8
commit 4c422d90af
7 files changed
+41 -59

No files matched your search

+3 -7
View File
@@ -22,14 +22,12 @@ namespace PaymentLogs.Forms
{
dataGridView1.Columns.Add("id", "Номер");
dataGridView1.Columns.Add("name", "Наименование");
dataGridView1.Columns.Add("type", "Тип");
dataGridView1.Columns.Add("cost", "Цена");
dataGridView1.Columns.Add("duration", "Длительность");
dataGridView1.Columns.Add("studentsCount", "Кол-во студентов");
foreach (Course course in Program.CourseRepository.All())
{
dataGridView1.Rows.Add(course.Id.ToString(), course.Name.ToString(), course.Type.ToString(), course.Cost.ToString(),
course.Duration.ToString(), course.StudentsCount.ToString());
dataGridView1.Rows.Add(course.Id.ToString(), course.Name.ToString(), course.Cost.ToString(),
course.StudentsCount.ToString());
}
}
@@ -43,7 +41,7 @@ namespace PaymentLogs.Forms
{
String text = textBox2.Text;
this.Hide();
new StudentsForm(text).Show();
new DataForm(text).Show();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
@@ -63,9 +61,7 @@ namespace PaymentLogs.Forms
{
Id = Convert.ToInt32(row.Cells["id"].Value),
Name = row.Cells["name"].Value.ToString(),
Type = row.Cells["type"].Value.ToString(),
Cost = Convert.ToInt32(row.Cells["cost"].Value),
Duration = Convert.ToInt32(row.Cells["duration"].Value),
StudentsCount = Convert.ToInt32(row.Cells["studentsCount"].Value)
};
Program.CourseRepository.Update(course.Id, course);