Skip to content

Commit

Permalink
修正
Browse files Browse the repository at this point in the history
  • Loading branch information
puk06 committed Jul 19, 2024
1 parent 600be1c commit 10fe912
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions Forms/AddSoftware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,27 @@ private IEnumerable<string> CheckValue()
IEnumerable<string> reasons = Array.Empty<string>();
if (string.IsNullOrEmpty(NAME_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Name is empty");
Helper.AddValueToArray(ref reasons, "❌️ Name is empty");
}

if (!IsEnglish(NAME_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Name is not in English");
Helper.AddValueToArray(ref reasons, "❌️ Name is not in English");
}

if (string.IsNullOrEmpty(PATH_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Path is empty");
Helper.AddValueToArray(ref reasons, "❌️ Path is empty");
}

if (!File.Exists(PATH_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Path does not exist");
Helper.AddValueToArray(ref reasons, "❌️ Path does not exist");
}

if (PATH_TEXTBOX.Text.Contains("ㅤ"))
{
Main.AddValueToArray(ref reasons, "❌️ Path contains invalid characters");
Helper.AddValueToArray(ref reasons, "❌️ Path contains invalid characters");
}

return reasons;
Expand Down
10 changes: 5 additions & 5 deletions Forms/EditSoftware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,27 @@ private IEnumerable<string> CheckValue()
IEnumerable<string> reasons = Array.Empty<string>();
if (string.IsNullOrEmpty(NAME_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Name is empty");
Helper.AddValueToArray(ref reasons, "❌️ Name is empty");
}

if (!IsEnglish(NAME_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Name is not in English");
Helper.AddValueToArray(ref reasons, "❌️ Name is not in English");
}

if (string.IsNullOrEmpty(PATH_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Path is empty");
Helper.AddValueToArray(ref reasons, "❌️ Path is empty");
}

if (!File.Exists(PATH_TEXTBOX.Text))
{
Main.AddValueToArray(ref reasons, "❌️ Path does not exist");
Helper.AddValueToArray(ref reasons, "❌️ Path does not exist");
}

if (PATH_TEXTBOX.Text.Contains("ㅤ"))
{
Main.AddValueToArray(ref reasons, "❌️ Path contains invalid characters");
Helper.AddValueToArray(ref reasons, "❌️ Path contains invalid characters");
}

return reasons;
Expand Down
30 changes: 15 additions & 15 deletions Forms/ProfileForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@ private IEnumerable<string> CheckValue()
var result = double.TryParse(SCOREMETER_TEXTBOX.Text, out double scoreMeter);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Score meter must be a number");
Helper.AddValueToArray(ref reasons, "❌️ Score meter must be a number");
}
else if (scoreMeter < 0)
{
Main.AddValueToArray(ref reasons, "❌️ Score meter must be between 0 and 1");
Helper.AddValueToArray(ref reasons, "❌️ Score meter must be between 0 and 1");
}
}

Expand All @@ -490,12 +490,12 @@ private IEnumerable<string> CheckValue()
var result = int.TryParse(WIDTH_TEXTBOX.Text, out int width);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Width contains non-numeric characters");
Helper.AddValueToArray(ref reasons, "❌️ Width contains non-numeric characters");
}

if (width < 0)
{
Main.AddValueToArray(ref reasons, "❌️ Width must be greater than 0");
Helper.AddValueToArray(ref reasons, "❌️ Width must be greater than 0");
}
}

Expand All @@ -504,12 +504,12 @@ private IEnumerable<string> CheckValue()
var result = int.TryParse(HEIGHT_TEXTBOX.Text, out int height);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Height contains non-numeric characters");
Helper.AddValueToArray(ref reasons, "❌️ Height contains non-numeric characters");
}

if (height < 0)
{
Main.AddValueToArray(ref reasons, "❌️ Height must be greater than 0");
Helper.AddValueToArray(ref reasons, "❌️ Height must be greater than 0");
}
}

Expand All @@ -518,7 +518,7 @@ private IEnumerable<string> CheckValue()
var result = int.TryParse(OFFSET_TEXTBOX.Text, out int offset);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Offset contains non-numeric characters");
Helper.AddValueToArray(ref reasons, "❌️ Offset contains non-numeric characters");
}
}

Expand All @@ -533,11 +533,11 @@ private IEnumerable<string> CheckValueEdit()
var result = double.TryParse(SCOREMETEREDIT_TEXTBOX.Text, out double scoreMeter);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Score meter must be a number");
Helper.AddValueToArray(ref reasons, "❌️ Score meter must be a number");
}
else if (scoreMeter < 0)
{
Main.AddValueToArray(ref reasons, "❌️ Score meter must be between 0 and 1");
Helper.AddValueToArray(ref reasons, "❌️ Score meter must be between 0 and 1");
}
}

Expand All @@ -546,12 +546,12 @@ private IEnumerable<string> CheckValueEdit()
var result = int.TryParse(WIDTHEDIT_TEXTBOX.Text, out int width);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Width contains non-numeric characters");
Helper.AddValueToArray(ref reasons, "❌️ Width contains non-numeric characters");
}

if (width < 0)
{
Main.AddValueToArray(ref reasons, "❌️ Width must be greater than 0");
{
Helper.AddValueToArray(ref reasons, "❌️ Width must be greater than 0");
}
}

Expand All @@ -560,12 +560,12 @@ private IEnumerable<string> CheckValueEdit()
var result = int.TryParse(HEIGHTEDIT_TEXTBOX.Text, out int height);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Height contains non-numeric characters");
Helper.AddValueToArray(ref reasons, "❌️ Height contains non-numeric characters");
}

if (height < 0)
{
Main.AddValueToArray(ref reasons, "❌️ Height must be greater than 0");
Helper.AddValueToArray(ref reasons, "❌️ Height must be greater than 0");
}
}

Expand All @@ -574,7 +574,7 @@ private IEnumerable<string> CheckValueEdit()
var result = int.TryParse(OFFSETEDIT_TEXTBOX.Text, out int offset);
if (!result)
{
Main.AddValueToArray(ref reasons, "❌️ Offset contains non-numeric characters");
Helper.AddValueToArray(ref reasons, "❌️ Offset contains non-numeric characters");
}
}

Expand Down

0 comments on commit 10fe912

Please sign in to comment.