Skip to content

Commit

Permalink
#44 Rad funkcije je sada vidljiv pri otvaranju MemberPanel-a
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarkoovin21 committed Jun 14, 2024
1 parent 1f41dac commit eb89622
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions Software/E_Libra/PresentationLayer/MemberPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
namespace PresentationLayer {
//Viktor Lovrić, metode: Window_Loaded
//Magdalena Markovinocić, metode: btnLogout_Click, btnNotifications_Click
public partial class MemberPanel : Window {
public MemberPanel() {
public partial class MemberPanel : Window
{
public MemberPanel()
{
InitializeComponent();

KeyDown += MainWindow_KeyDown;
}

private void btnBorrow_Click(object sender, RoutedEventArgs e) {
private void btnBorrow_Click(object sender, RoutedEventArgs e)
{
contentPanel.Content = new UcMemberBorrows();
}

Expand All @@ -41,11 +44,13 @@ private void btnLogout_Click(object sender, RoutedEventArgs e)
Close();
}

private void btnSearch_Click(object sender, RoutedEventArgs e) {
private void btnSearch_Click(object sender, RoutedEventArgs e)
{
contentPanel.Content = new UcBookSearchFilter();
}

private void btnWishlist_Click(object sender, RoutedEventArgs e) {
private void btnWishlist_Click(object sender, RoutedEventArgs e)
{
contentPanel.Content = new UcWishlist();
}

Expand All @@ -65,22 +70,42 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
MessageBox.Show(res);
}
}
MembershipExpieringSoon();
}

private void btnNotifications_Click(object sender, RoutedEventArgs e) {
private void btnNotifications_Click(object sender, RoutedEventArgs e)
{
UcAllNotificationsMember memberNotifications = new UcAllNotificationsMember();
contentPanel.Content = memberNotifications;
}

private void MainWindow_KeyDown(object sender, KeyEventArgs e) {
if (e.Key == Key.F1) {
private void MainWindow_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.F1)
{
ShowHelp();
}
}

private void ShowHelp() {
private void ShowHelp()
{
var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "PDF", "User_documentation_member.pdf");
Process.Start(path);
}

private void MembershipExpieringSoon()
{
using (MemberService memberService = new MemberService())
{
var daysUntilExpiration = memberService.MembershipExpieringSoon();
if (daysUntilExpiration > 0)
{
MessageBox.Show($"Vaše članstvo ističe za {daysUntilExpiration} dana." + Environment.NewLine +
"Molimo produčjite vaše članstvo!", "Upozorenje", MessageBoxButton.OK, MessageBoxImage.Warning);

}
}
}

}
}

0 comments on commit eb89622

Please sign in to comment.