Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jjelcic22 committed May 21, 2024
1 parent a57dbbd commit 9d6bc4e
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Software/MAVZ/MAVZ/FrmIzbornik.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions Software/MAVZ/MAVZ/FrmIzbornik.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@ public FrmIzbornik()
InitializeComponent();
}

private void btnUnos_Click(object sender, EventArgs e)


private void btnIzmjena_Click(object sender, EventArgs e)
{

}

private void btnIzmjena_Click(object sender, EventArgs e)
private void btnSearch_Click(object sender, EventArgs e)
{
FrmPretrazitelj frmPretrazitelj = new FrmPretrazitelj();
frmPretrazitelj.Show();
}

private void FrmIzbornik_Load(object sender, EventArgs e)
{

}
}
}
30 changes: 30 additions & 0 deletions Software/MAVZ/MAVZ/FrmPretrazitelj.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 55 additions & 1 deletion Software/MAVZ/MAVZ/FrmPretrazitelj.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using System;
using DBLayer;
using MAVZ.repozitories;
using MAVZ.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
Expand All @@ -16,5 +20,55 @@ public FrmPretrazitelj()
{
InitializeComponent();
}

private void FrmPretrazitelj_Load(object sender, EventArgs e)
{
ShowVozniRed();
}

private void ShowVozniRed()
{
var voznired = VozniRedReposetory.GetVozniRed();

dvgVozniRed.DataSource = voznired;

dvgVozniRed.Columns["id"].DisplayIndex = 0;
dvgVozniRed.Columns["linija"].DisplayIndex = 1;
dvgVozniRed.Columns["vrijemepol"].DisplayIndex = 2;
dvgVozniRed.Columns["vrijemedol"].DisplayIndex = 3;


}

private void txtSearchB_TextChanged(object sender, EventArgs e)
{
string searchText = txtSearchB.Text.Trim();

if (!string.IsNullOrWhiteSpace(searchText))
{
string query = $"SELECT * FROM VozniRed WHERE strlinija LIKE '%{searchText}%'";

DB.OpenConnection();

SqlDataReader reader = DB.GetDataReader(query);

DataTable dt = new DataTable();
dt.Load(reader);

reader.Close();
DB.CloseConnection();

dvgVozniRed.DataSource = dt;
}
else
{
ShowVozniRed();
}
}

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{

}
}
}

0 comments on commit 9d6bc4e

Please sign in to comment.