Skip to content

Help desk1#4

Open
ValentinaTishchenko wants to merge 14 commits intoJosefDzeranov:mainfrom
ValentinaTishchenko:HelpDesk1
Open

Help desk1#4
ValentinaTishchenko wants to merge 14 commits intoJosefDzeranov:mainfrom
ValentinaTishchenko:HelpDesk1

Conversation

@ValentinaTishchenko
Copy link

No description provided.

Copy link
Collaborator

@Bushminkina Bushminkina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если указываю неправильный пароль выполняет вход, с правильным паролем выдаёт ошибку

Comment on lines 126 to 129
{
return new List<TrubleTicket>();
return new List<TroubleTicket>();
}
else
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

перед else стоит return

else
{
return JsonProvider.Deserialize<TrubleTicket>(trubleTicketsFileName);
return JsonProvider.Deserialize<TroubleTicket>(troubleTicketsFileName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для чего второй раз десериализуем?

{
public int Id { get; set; }
public string Status { get; set; }
public int CreateUser { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

название CreateUser, а тип данных int

@@ -0,0 +1,44 @@
namespace HelpDeskWinFormsApp
{
public static class AppConstants
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//лучше разнести по разным классам по функциональности


public static (bool IsValid, string Message) ValidateName(string inputName)
{
var name = inputName?.Trim() ?? "";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string.Empty

return;
}

if (statusTroubleTicketComboBox.Text != lastStatus)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно если статус равен предыдущему - выйти из метода и уменьшить вложенность

Copy link
Collaborator

@Bushminkina Bushminkina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Интерфейсы разделены правильно, но у нас остался класс JsonStorage который одновременно работает и с пользователем и с заявками - это нарушает принцип единственной ответственности, буква S в SOLID (https://teletype.in/@csharpmagazine/solid).
Попробуй также разделить класс JsonStorage.

Copy link
Collaborator

@Bushminkina Bushminkina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Супер! Молодец!

Comment on lines +36 to +54
foreach (var file in files)
{
if (File.Exists(file))
{
try
{
string content = File.ReadAllText(file);

if (content.Trim().StartsWith("[") || content.Trim().StartsWith("{"))
{
File.Copy(file, file + ".backup", true);

FileProvider.Put(file, content);
}
}
catch
{

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

просится в класс FileProvider в отдельный метод, список названий файлов можно в метод передать

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants