Skip to content
Open
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
74 changes: 74 additions & 0 deletions Refactoring/PrintingCommands.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Refactoring
{
class PrintingCommands
{
public static void PrintWelcomeMessage()
{
// Write welcome message test
Console.WriteLine("Welcome to TUSC");
Console.WriteLine("---------------");
}

public static void PrintUserNameInput()
{
// Prompt for user input
Console.WriteLine();
Console.WriteLine("Enter Username:");

}

public static void PrintInvalidUser()
{
// Invalid User
Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine();
Console.WriteLine("You entered an invalid user.");
Console.ResetColor();
}

public static void PrintInvalidPassword()
{
// Invalid Password
Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine();
Console.WriteLine("You entered an invalid password.");
Console.ResetColor();
}

public static void PrintQuanityIsLessThanZero()
{
// Quantity is less than zero
Console.Clear();
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine();
Console.WriteLine("Purchase cancelled");
Console.ResetColor();
}

public static void PrintExitMessage()
{
// Prevent console from closing
Console.WriteLine();
Console.WriteLine("Press Enter key to exit");
Console.ReadLine();
}

public static void PrintWelcomeMessage(string inputedUsername)
{
// Show welcome message
Console.Clear();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine();
Console.WriteLine("Login successful! Welcome " + inputedUsername + "!");
Console.ResetColor();
}
}
}
6 changes: 3 additions & 3 deletions Refactoring/Product.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ namespace Refactoring
public class Product
{
[JsonProperty("Name")]
public string Name;
public string ProductName;
[JsonProperty("Price")]
public double Price;
public double RegularPrice;
[JsonProperty("Quantity")]
public int Qty;
public int RemainingQuantity;
}
}
1 change: 1 addition & 0 deletions Refactoring/Refactoring.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="PrintingCommands.cs" />
<Compile Include="Product.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
Loading