Skip to content

Conversation

@Gerardo-Sullivan
Copy link

No description provided.

Add better accessibility, unused references, line spacing, Method naming conventions, etc.
Order should be its own concept as part of this application. Reports should be able to just take an order and output the details in a particular way
TODO: need to think of some auto generator for Order Number
Handle ints better, reuse code
string address = GetUserInputAsString("Please input your Address: ");

// TODO: should probably be DateTime with valid user input for DateTime
string dueDate = GetUserInputAsString("Please input your Due Date: ");
Copy link
Author

Choose a reason for hiding this comment

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

Should be parsing user input into DateTime

public string CustomerName { get; set; }
public string Address { get; set; }
public string DueDate { get; set; }
public string DueDate { get; set; } // TODO: should probably be DateTime
Copy link
Author

Choose a reason for hiding this comment

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

Should be DateTime

public string DueDate { get; set; } // TODO: should probably be DateTime
public int OrderNumber { get; set; }
public List<Shape> OrderedBlocks { get; set; }
public List<Shape> OrderedBlocks { get; set; } = new List<Shape>();
Copy link
Author

Choose a reason for hiding this comment

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

OrderedBlocks data structure should be its own class with properties for each Shape type i.e.

public class OrderedBlocks
{
    public List<Square> Squares { get; set; }
    public List<Triangle> Triangles { get; set; }
    public List<Circle> Circles { get; set; }
}

public string ToString()
public override string ToString()
{
return "\nName: " + CustomerName + " Address: " + Address + " Due Date: " + DueDate + " Order #: " + OrderNumber;
Copy link
Author

Choose a reason for hiding this comment

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

nit: String interpolation better

PrintRow("Square",base.OrderedBlocks[0].TotalQuantityOfShape().ToString());
PrintRow("Triangle", base.OrderedBlocks[1].TotalQuantityOfShape().ToString());
PrintRow("Circle", base.OrderedBlocks[2].TotalQuantityOfShape().ToString());
PrintRow("Square", Order.OrderedBlocks[0].TotalQuantityOfShape().ToString());
Copy link
Author

Choose a reason for hiding this comment

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

Order.OrderedBlocks[0] is very ugly and prone to bugs, find a more reliable data structure for each block type.

Quick fix is check list for type Square

e.g. Order.OrderedBlocks.Where(b => b is Square)

class CuttingListReport : Order
public class CuttingListReport : Report
{
public int tableWidth = 20;
Copy link
Author

Choose a reason for hiding this comment

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

tableWidth can be const

class InvoiceReport : Order
public class InvoiceReport : Report
{
public int tableWidth = 73;
Copy link
Author

Choose a reason for hiding this comment

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

const

{
public string Name { get; set; }
public int Price { get; set; }
public int AdditionalCharge { get; set; }
Copy link
Author

Choose a reason for hiding this comment

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

The current data structure only allows for one AdditionalCharge per shape.

Possible solution is for each attribute of the shape to have some AdditionalCharge (i.e. the colour and shape type)

{
abstract class Shape
// TODO: rename this to Block
public abstract class Shape
Copy link
Author

Choose a reason for hiding this comment

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

May want colour to be its own class with properties (e.g. surcharge)

public abstract void GenerateReport();

public string ToString()
public override string ToString()
Copy link
Author

Choose a reason for hiding this comment

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

Prefer not to override the .net class ToString() method. Rather just have a Print() method or something like that

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.

1 participant