This commit is contained in:
redtea committed 2024-05-24 10:16:10 +03:00
1 parent aa078f0c4f
commit b206856c1d
2 files changed
+54 -1

No files matched your search

+51 -1
View File
@@ -14,6 +14,7 @@ namespace PaymentLogs
{
public partial class DataForm : Form
{
public DataForm()
{
InitializeComponent();
@@ -59,7 +60,7 @@ namespace PaymentLogs
{
try
{
if(row.Cells.Count > 1)
if(row.Cells.Count > 1 && row.Cells["id"].Value != null)
{
Payment payment = new Payment
{
@@ -85,5 +86,54 @@ namespace PaymentLogs
}
Program.PaymentRepository.Save();
}
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)
{
try
{
if(row.Cells["fcs"].Value == null)
{
continue;
}
string FCs = row.Cells["fcs"].Value.ToString();
string course = row.Cells["course"].Value.ToString();
if (((FCs.Equals(FCsText)) && (course.Equals(CourseText))) )
{
List<string> list = new List<string>
{ row.Cells["id"].Value.ToString(), row.Cells["fcs"].Value.ToString(),
row.Cells["course"].Value.ToString(), row.Cells["course_price"].Value.ToString(),
row.Cells["paid"].Value.ToString(), row.Cells["debt"].Value.ToString() };
filtredList.Add(list);
}
}
catch(Exception ignored)
{
}
}
dataGridView1.Rows.Clear();
foreach (List<String> args in filtredList)
{
dataGridView1.Rows.Add(args[0], args[1], args[2], args[3], args[4], args[5]);
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
dataGridView1.Rows.Clear();
Form1_Load(null, null);
}
}
}