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

+12 -4
View File
@@ -15,13 +15,15 @@ namespace PaymentLogs
{
public partial class DataForm : Form
{
public DataForm()
private Course _course;
public DataForm(string courseName)
{
InitializeComponent();
_course = Program.CourseRepository.ByName(courseName);
}
private void Form1_Load(object sender, EventArgs e)
{
@@ -33,11 +35,17 @@ namespace PaymentLogs
dataGridView1.Columns.Add("debt", "Долг");
foreach (Payment payment in Program.PaymentRepository.All())
{
if(payment.CourseId != _course.Id)
{
continue;
}
dataGridView1.Rows.Add(payment.Id.ToString(), payment.FCs.ToString(), Program.CourseRepository.Get(payment.CourseId).Name,
payment.CoursePrice.ToString(), payment.Paid.ToString(), payment.Debt.ToString());
}
}
private void toolStripSplitButton1_ButtonClick(object sender, EventArgs e)
{
@@ -89,7 +97,7 @@ namespace PaymentLogs
private void button1_Click(object sender, EventArgs e)
{
string FCsText = textBox1.Text;
string CourseText = textBox2.Text;
List<List<string>> filtredList = new List<List<string>>();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
@@ -101,7 +109,7 @@ namespace PaymentLogs
}
string FCs = row.Cells["fcs"].Value.ToString();
string course = row.Cells["course"].Value.ToString();
if (((FCs.Equals(FCsText)) && (course.Equals(CourseText))) )
if (((FCs.Equals(FCsText))) )
{
List<string> list = new List<string>
{ row.Cells["id"].Value.ToString(), row.Cells["fcs"].Value.ToString(),