Skip to content

Commit

Permalink
Mape
Browse files Browse the repository at this point in the history
Dodani su repozitoriji i modeli mape
  • Loading branch information
Juric22 committed Jun 12, 2024
1 parent 239583c commit 2a2adc7
Show file tree
Hide file tree
Showing 8 changed files with 297 additions and 15 deletions.
32 changes: 30 additions & 2 deletions Software/SZUUP/SZUUP/FrmPrijava.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,33 @@ public FrmPrijava()
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string username = UsernameTxt.Text;
string password = PasswordTxt.Text;

// Provjera korisničkih podataka
var zaposlenik = StudentRepository.GetStudent(username);

if (zaposlenik != null && student.Password == password)
{
// Uspješna prijava
MessageBox.Show("Login successful!");

// Otvorite MainForm
MainForm mainForm = new MainForm();
mainForm.Show();

// Sakrijte trenutnu formu
this.Hide();
}
else
{
// Neuspješna prijava
MessageBox.Show("Invalid username or password!");
}
}

private void btnLogin_Click(object sender, EventArgs e)
{
if (txtUsername.Text == "")
Expand All @@ -41,8 +68,9 @@ private void btnLogin_Click(object sender, EventArgs e)
MessageBoxButtons.OK, MessageBoxIcon.Information);

// Open the FrmUnos form
FrmUnos frmUnos = new FrmUnos();
frmUnos.Show();

frmPopisJela frmPopisJela = new frmPopisJela();
frmPopisJela.Show();
this.Hide(); // Hide the current login form
}
else
Expand Down
16 changes: 4 additions & 12 deletions Software/SZUUP/SZUUP/FrmUnos.Designer.cs

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

4 changes: 3 additions & 1 deletion Software/SZUUP/SZUUP/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using DBLayer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -14,6 +15,7 @@ internal static class Program
[STAThread]
static void Main()
{
DB.SetConfiguration("PI2324_mjuric22_DB", "PI2324_mjuric22_User", "8;bj)2UL");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmPrijava());
Expand Down
20 changes: 20 additions & 0 deletions Software/SZUUP/SZUUP/SZUUP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DBLayer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\AMD\Downloads\DBLayer.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -46,6 +50,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmPopisJela.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmPopisJela.Designer.cs">
<DependentUpon>frmPopisJela.cs</DependentUpon>
</Compile>
<Compile Include="FrmPrijava.cs">
<SubType>Form</SubType>
</Compile>
Expand All @@ -60,6 +70,9 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmPopisJela.resx">
<DependentUpon>frmPopisJela.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmPrijava.resx">
<DependentUpon>FrmPrijava.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -88,5 +101,12 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="dlls\DBLayer.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
<Folder Include="Repozitoris\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added Software/SZUUP/SZUUP/dlls/DBLayer.dll
Binary file not shown.
88 changes: 88 additions & 0 deletions Software/SZUUP/SZUUP/frmPopisJela.Designer.cs

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

32 changes: 32 additions & 0 deletions Software/SZUUP/SZUUP/frmPopisJela.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SZUUP
{
public partial class frmPopisJela : Form
{
public frmPopisJela()
{
InitializeComponent();
//FrmUnos frmUnos = new FrmUnos();
//frmUnos.Show();
}

private void dgvPopis_CellContentClick(object sender, DataGridViewCellEventArgs e)
{

}

private void frmPopisJela_Load(object sender, EventArgs e)
{

}
}
}
Loading

0 comments on commit 2a2adc7

Please sign in to comment.