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 Project_6 { public partial class Form1 : Form { const decimal basePay = 250m, quota = 1000m, rate = .15m; decimal sales, commissionValue, pay; public Form1() { InitializeComponent(); } private void nameTextBox_TextChanged(object sender, EventArgs e) { } private void salesAmountTextBox_TextChanged(object sender, EventArgs e) { } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Close(); } private void commission() { if (sales >= quota) { commissionValue = sales * rate; } else { commissionValue = 0m; } } private void payToolStripMenuItem_Click(object sender, EventArgs e) { sales = decimal.Parse(salesAmountTextBox.Text); commission(); if (commissionValue > 0) { commissionTextBox.Text = commissionValue.ToString("N2"); } else { commissionTextBox.Text = ""; } pay = basePay + commissionValue; totalPayTextBox.Text = pay.ToString("N2"); salesAmountTextBox.Text = sales.ToString ("N2"); } }
namespace Project_6 {
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)