Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions OpsFlow/UI/Controls/NavbarControl.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Guna.UI2.WinForms;

using System.ComponentModel;
using System.ComponentModel;
using System.Security.Cryptography;
using System.Text;

using Guna.UI2.WinForms;

using OpsFlow.UI.Forms.Management;

using Timer = System.Windows.Forms.Timer;

namespace OpsFlow.UI.Controls;
Expand Down Expand Up @@ -285,7 +287,42 @@ private void InitializeDropdownMenu()
ImageOffset = new Point(5, 0),
TextOffset = new Point(10, 0)
};
_btnLogout.Click += (s, e) => Application.Restart();

_btnLogout.Click += (s, e) =>
{
if (this.ParentForm is Form anaForm)
{
Form dimmer = new Form();
dimmer.FormBorderStyle = FormBorderStyle.None;
dimmer.BackColor = Color.Black;
dimmer.Opacity = 0.60d;
dimmer.ShowInTaskbar = false;
dimmer.StartPosition = FormStartPosition.Manual;

dimmer.Location = anaForm.PointToScreen(Point.Empty);
dimmer.Size = anaForm.Size;

using (LogoutForm confirmation = new LogoutForm())
{
confirmation.StartPosition = FormStartPosition.CenterScreen;

dimmer.Show(anaForm);

DialogResult result = confirmation.ShowDialog(dimmer);

dimmer.Close();

if (result == DialogResult.Yes)
{
Application.Exit();
}
}
}
else
{
Application.Exit();
}
};

_dropdownPanel.Controls.Add(_btnSettings);
_dropdownPanel.Controls.Add(separator);
Expand Down
11 changes: 6 additions & 5 deletions OpsFlow/UI/Forms/Management/AddPersonelForm.Designer.cs

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

12 changes: 9 additions & 3 deletions OpsFlow/UI/Forms/Management/AddPersonelForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ public partial class AddPersonelForm : BaseForm
public AddPersonelForm()
{
InitializeComponent();
txtTelephone.MaxLength = 17;
if (this.HeaderPanel != null) this.HeaderPanel.SendToBack();
_fileUploadService = FileUploadServiceFactory.Create();

this.Load += AddPersonelForm_Load;
btnSave.Click += BtnSave_Click;
cmbRole.SelectedIndexChanged += CmbRole_SelectedIndexChanged;
Expand Down Expand Up @@ -65,7 +66,7 @@ private async Task LoadComboBoxDataAsync()
using var roleContext = DatabaseManager.CreateContext();
using var companyContext = DatabaseManager.CreateContext();
using var departmentContext = DatabaseManager.CreateContext();

var roleService = new RoleService(roleContext);
var companyService = new CompanyService(companyContext);
var departmentService = new DepartmentService(departmentContext);
Expand Down Expand Up @@ -170,7 +171,7 @@ private async void picProfilePhoto_Click_1(object sender, EventArgs e)
string uploadedPath = await _fileUploadService.UploadProfilePhotoAsync(selectedFilePath);
_uploadedFilePath = uploadedPath;

if (Uri.TryCreate(uploadedPath, UriKind.Absolute, out Uri? uri) &&
if (Uri.TryCreate(uploadedPath, UriKind.Absolute, out Uri? uri) &&
(uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps))
{
using (HttpClient client = new HttpClient())
Expand Down Expand Up @@ -430,5 +431,10 @@ private void btnCompanyRegister_Click(object sender, EventArgs e)
}
}
}

private void txtTelephone_TextChanged(object sender, EventArgs e)
{

}
}
}
126 changes: 126 additions & 0 deletions OpsFlow/UI/Forms/Management/LogoutForm.Designer.cs

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

29 changes: 29 additions & 0 deletions OpsFlow/UI/Forms/Management/LogoutForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace OpsFlow.UI.Forms.Management;

public partial class LogoutForm : Form
{
public LogoutForm()
{
InitializeComponent();
}

private void btnConfirmLogout_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Yes;
this.Close();
}

private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.No;
this.Close();
}
}
Loading