Hello everyone, Im working on a piecework program. I have everything working exactly the way its supposed to except for the one part where I am trying to find which employee made the most pieces. What I need to do- hopefully this makes sense, is take the input of pieces completed and employee name and at the end be able to see which employee make the most pieces and how many pieces they made. I already got the part working for how many pieces but I cant get the who made them part to work. This is for class so i dont expect answere- I have tried the Math.Max but that does not seem to work with a string- I tried setting the name field as a double but it then only gives an output if I put a number in for an employee name Below is the code

"Include in the summary information the name and the number of pieces for the person who has processed the most pieces of all persons processed. If there are one or more ties, the first person entered who had the most pieces will remain the winner."



Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Piecework
{
    public partial class Form1 : Form
    {


        private decimal accumTotalPieces=0;
        private decimal accumTotalPay=0;
        private decimal accumAvgPay=0;
        private string accumEmployeeWithMost;
        private decimal accumMostPiecesMade=0;
        private decimal buttonClickCounter = 0;
        private int pieces = 0;
        private string name;

        public Form1()
           
        {
            InitializeComponent();
        }

        private void exitButton_Click(object sender, EventArgs e)
        {
            this.Close();

        }



        private void clearButton_Click(object sender, EventArgs e)
        {

            employeeNameBox.Text = "";
            piecesCompletedBox.Text = "";
            amountEarnedBox.Text = "";
        }

        private void calculateButton_Click(object sender, EventArgs e)
        {

            buttonClickCounter++;

            
            decimal rate = 0;
            decimal amountEarned= 0;

            

            if (string.IsNullOrEmpty(this.employeeNameBox.Text))
                MessageBox.Show("Invalid Name Entered (" + employeeNameBox.Text + ") Please Enter A Valid Name");


            if (!int.TryParse(piecesCompletedBox.Text, out pieces) || pieces <= 0 || pieces >= 20001)
                MessageBox.Show("Invalid Numeric Value (" + piecesCompletedBox.Text + ") -Please enter a value between 0 and 20,000");


            if (pieces >= 1 && pieces <= 199)
            {
               rate= 0.50m; 
            }


            if (pieces >= 200 && pieces <= 399)
            {
               rate = 0.55m;
            }


            if (pieces >= 400 && pieces <= 599)
            {
               rate = 0.60m;
            }


            if (pieces >= 600)
            {
                rate = 0.65m;
            }


            amountEarned = rate * pieces;
            amountEarnedBox.Text = amountEarned.ToString("c");

    

            accumTotalPieces = accumTotalPieces + pieces;
            accumTotalPay = accumTotalPay + amountEarned;
            accumAvgPay = accumTotalPay /buttonClickCounter ;


 

            grandTotalPiecesBox.Text = accumTotalPieces.ToString();
            grandTotalPayBox.Text = accumTotalPay.ToString("c");
            avgPayPerEmployeeBox.Text = accumAvgPay.ToString("c");

          
            accumMostPiecesMade = Math.Max(accumMostPiecesMade, pieces);
            mostPiecesProducedBox.Text = accumMostPiecesMade.ToString();

My thoughts are I need to somehow take the output from accumMostPiecesMade and pair it up with accumEmployeeWithMost


thanks for any help/ direction!