ProgrammingProblem2/App.config
ProgrammingProblem2/bin/Debug/ProgrammingProblem2.exe
ProgrammingProblem2/bin/Debug/ProgrammingProblem2.exe.config
ProgrammingProblem2/bin/Debug/ProgrammingProblem2.pdb
ProgrammingProblem2/bin/Debug/ProgrammingProblem2.vshost.exe
ProgrammingProblem2/bin/Debug/ProgrammingProblem2.vshost.exe.config
ProgrammingProblem2/bin/Release/ProgrammingProblem2.exe.config
ProgrammingProblem2/bin/Release/ProgrammingProblem2.vshost.exe
ProgrammingProblem2/bin/Release/ProgrammingProblem2.vshost.exe.config
ProgrammingProblem2/bin/Release/ProgrammingProblem2.vshost.exe.manifest
ProgrammingProblem2/Employee.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProgrammingProblem2
{
class Employee
{
public string Name { get; set; }
public Employee(string name)
{
Name = name;
}
public Employee()
{
}
}
}
ProgrammingProblem2/EmployeeSelection.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ProgrammingProblem2
{
public partial class EmployeeSelection : Form
{
public EmployeeSelection()
{
InitializeComponent();
}
private void EmployeeSelection_Load(object sender, EventArgs e)
{
}
private void shift_Click(object sender, EventArgs e)
{
Shift ss = new Shift();
ss.ShowDialog();
}
private void production_Click(object sender, EventArgs e)
{
ProductionWorker pw = new ProductionWorker();
pw.ShowDialog();
}
private void exit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
ProgrammingProblem2/EmployeeSelection.Designer.cs
namespace ProgrammingProblem2
{
partial class EmployeeSelection
{
///
/// Required designer variable.
/// private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
/// ///
true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// private void InitializeComponent()
{
this.shift = new System.Windows.Forms.Button();
this.production = new System.Windows.Forms.Button();
this.exit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// shift
//
this.shift.Location = new System.Drawing.Point(314, 98);
this.shift.Name = "shift";
this.shift.Size = new System.Drawing.Size(193, 119);
this.shift.TabIndex = 0;
this.shift.Text = "Shift Supervisor";
this.shift.UseVisualStyleBackColor = true;
this.shift.Click += new System.EventHandler(this.shift_Click);
//
// production
//
this.production.Location = new System.Drawing.Point(36, 98);
this.production.Name = "production";
this.production.Size = new System.Drawing.Size(175, 119);
this.production.TabIndex = 1;
this.production.Text = "Production Worker";
this.production.UseVisualStyleBackColor = true;
this.production.Click += new System.EventHandler(this.production_Click);
//
// exit
//
this.exit.Location = new System.Drawing.Point(213, 274);
this.exit.Name = "exit";
this.exit.Size = new System.Drawing.Size(75, 37);
this.exit.TabIndex = 2;
this.exit.Text = "Exit";
this.exit.UseVisualStyleBackColor = true;
this.exit.Click += new System.EventHandler(this.exit_Click);
//
// EmployeeSelection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(533, 379);
this.Controls.Add(this.exit);
this.Controls.Add(this.production);
this.Controls.Add(this.shift);
this.Name = "EmployeeSelection";
this.Text = "EmployeeSelection";
this.Load += new System.EventHandler(this.EmployeeSelection_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button shift;
private System.Windows.Forms.Button production;
private System.Windows.Forms.Button exit;
}
}
ProgrammingProblem2/EmployeeSelection.resx
text/microsoft-resx
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ProgrammingProblem2/obj/Debug/DesignTimeResolveAssemblyReferences.cache
ProgrammingProblem2/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.csproj.FileListAbsolute.txt
c:\users\aditya\documents\visual studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\bin\Debug\ProgrammingProblem2.exe.config
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\bin\Debug\ProgrammingProblem2.exe
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\bin\Debug\ProgrammingProblem2.pdb
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.csprojResolveAssemblyReference.cache
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.EmployeeSelection.resources
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.Shift.resources
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.ProductionWorker.resources
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.Properties.Resources.resources
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.csproj.GenerateResource.Cache
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.exe
C:\Users\Aditya\Documents\Visual Studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\obj\Debug\ProgrammingProblem2.pdb
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.csproj.GenerateResource.Cache
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.csprojResolveAssemblyReference.cache
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.EmployeeSelection.resources
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.exe
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.pdb
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.ProductionWorker.resources
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.Properties.Resources.resources
ProgrammingProblem2/obj/Debug/ProgrammingProblem2.Shift.resources
ProgrammingProblem2/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
ProgrammingProblem2/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
ProgrammingProblem2/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
ProgrammingProblem2/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
ProgrammingProblem2/obj/Release/ProgrammingProblem2.csproj.FileListAbsolute.txt
c:\users\aditya\documents\visual studio 2015\Projects\ProgrammingProblem2\ProgrammingProblem2\bin\Release\ProgrammingProblem2.exe.config
ProgrammingProblem2/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
ProgrammingProblem2/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
ProgrammingProblem2/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
ProgrammingProblem2/Production.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProgrammingProblem2
{
class Production : Employee
{
public double number { get; set; }
public double shift { get; set; }
public double payrate { get; set; }
public Production(Employee employee, double number, double shift, double payrate)
: base(employee.Name)
{
this.number = number;
this.shift = shift;
this.payrate = payrate;
}
public Production(Employee employee)
: base(employee.Name)
{
}
}
}
ProgrammingProblem2/ProductionWorker.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ProgrammingProblem2
{
public partial class ProductionWorker : Form
{
Employee emp;
Production pd;
public ProductionWorker()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void textBox7_TextChanged(object sender, EventArgs e)
{
}
private void ProductionWorker_Load(object sender, EventArgs e)
{
}
private void finalnametxt_TextChanged(object sender, EventArgs e)
{
}
private void closebtn_Click(object sender, EventArgs e)
{
this.Close();
}
public void removeerrors()
{
this.errorProvider1.SetError(nametxt, null);
this.errorProvider1.SetError(numbertxt, null);
this.errorProvider1.SetError(shifttxt, null);
this.errorProvider1.SetError(payratetxt, null);
}
private void displaybtn_Click(object sender, EventArgs e)
{
if (validate() == true)
{
removeerrors();
emp = new Employee(nametxt.Text);
pd = new Production(emp, Double.Parse(numbertxt.Text), Double.Parse(shifttxt.Text), Double.Parse(payratetxt.Text));
finalnametxt.Text = pd.Name;
finalnumbertxt.Text = pd.number.ToString();
finalshifttxt.Text = pd.shift.ToString();
finalpayratetxt.Text = pd.payrate.ToString();
}
}
private bool validate()
{
bool ok = true;
if (nametxt.Text == "")
{
ok = false;
this.errorProvider1.SetError(nametxt, "Name cannot be empty");
}
if (numbertxt.Text == "")
{
ok = false;
this.errorProvider1.SetError(numbertxt, "Number cannot be empty");
}
else
{
if ((System.Text.RegularExpressions.Regex.IsMatch(numbertxt.Text, "[^0-9]")))
{
ok = false;
this.errorProvider1.SetError(numbertxt, "Please enter numbers only");
}
else
{
double num = Double.Parse(numbertxt.Text);
if (num <= 0)
{
ok = false;
this.errorProvider1.SetError(numbertxt, "Number must be greater than zero");
}
}
}
if (shifttxt.Text == "")
{
ok = false;
this.errorProvider1.SetError(shifttxt, "Shifts cannot be empty");
}
else
{
if ((System.Text.RegularExpressions.Regex.IsMatch(shifttxt.Text, "[^0-9]")))
{
ok = false;
this.errorProvider1.SetError(shifttxt, "Please enter numbers only");
}
else
{
double num = Double.Parse(shifttxt.Text);
if (num <= 0)
{
ok = false;
this.errorProvider1.SetError(shifttxt, "Shifts must be greater than zero");
}
}
}
if (payratetxt.Text == "")
{
ok = false;
this.errorProvider1.SetError(payratetxt, "Pay Rate cannot be empty");
}
else
{
if ((System.Text.RegularExpressions.Regex.IsMatch(payratetxt.Text, "[^0-9]")))
{
ok = false;
this.errorProvider1.SetError(payratetxt, "Please enter numbers only");
}
else
{
double num = Double.Parse(payratetxt.Text);
if (num <= 0)
{
ok = false;
this.errorProvider1.SetError(payratetxt, "Pay Rate must be greater than zero");
}
}
}
return ok;
}
private void clearbtn_Click(object sender, EventArgs e)
{
emp = new Employee();
pd = new Production(emp);
removeerrors();
nametxt.Text = "";
numbertxt.Text = "";
shifttxt.Text = "";
payratetxt.Text = "";
finalnametxt.Text = "";
finalnumbertxt.Text = "";
finalshifttxt.Text = "";
finalpayratetxt.Text = "";
}
}
}
ProgrammingProblem2/ProductionWorker.Designer.cs
namespace ProgrammingProblem2
{
partial class ProductionWorker
{
///
/// Required designer variable.
/// private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
/// ///
true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.name = new System.Windows.Forms.Label();
this.nametxt = new System.Windows.Forms.TextBox();
this.numbertxt = new System.Windows.Forms.TextBox();
this.shifttxt = new System.Windows.Forms.TextBox();
this.payratetxt = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.finalpayratetxt = new System.Windows.Forms.TextBox();
this.finalshifttxt = new System.Windows.Forms.TextBox();
this.finalnumbertxt = new System.Windows.Forms.TextBox();
this.finalnametxt = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.payrate = new System.Windows.Forms.Label();
this.shiftlabel = new System.Windows.Forms.Label();
this.number = new System.Windows.Forms.Label();
this.closebtn = new System.Windows.Forms.Button();
this.clearbtn = new System.Windows.Forms.Button();
this.displaybtn = new System.Windows.Forms.Button();
this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
...