Refactoring - split data, logic and model layers; custom network exception

This commit is contained in:
Dimitar Byalkov
2023-05-12 12:13:11 +02:00
parent 81109f3d6c
commit ee0b063eec
48 changed files with 256 additions and 160 deletions

View File

@@ -1,5 +1,5 @@
using StudentHouseDashboard.Managers;
using StudentHouseDashboard.Models;
using Logic;
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -34,7 +34,6 @@ namespace WinForms
if (user != null)
{
tbUsername.Text = user.Name;
tbPassword.Text = user.Password;
cbUserRole.SelectedIndex = (int)user.Role;
}
@@ -55,7 +54,14 @@ namespace WinForms
}
else
{
userManager.UpdateUser(this.user.ID, tbUsername.Text, BCrypt.Net.BCrypt.HashPassword(tbPassword.Text), (UserRole)cbUserRole.SelectedItem);
if (string.IsNullOrEmpty(tbPassword.Text))
{
//userManager.UpdateUser(this.user.ID, tbUsername.Text,)
}
else
{
userManager.UpdateUser(this.user.ID, tbUsername.Text, BCrypt.Net.BCrypt.HashPassword(tbPassword.Text), (UserRole)cbUserRole.SelectedItem);
}
}
this.DialogResult = DialogResult.OK;
}