![]() ![]() (object value) is implemented as follows in. Update 1 : some insides about this behavior However, since you are interested in user entered value, please use - TextBox.Text property instead of passing the TextBox. , Text: Shift SystemWindowsForm.TextBox, Text:Ĭonvert.ToString doesnt give you an error because one of it calls its overload with object - public static string ToString(object value). Name, Text: GlitterIDNumber 0Hourly rate ![]() The information I put into it is, Glitter for name, 12 for ID number, 1 for shift, and 12 for pay. Thanks to help from the commets I was able to fix the first problem I had, now I'm having a problem with the message box at the end. I have no idea how to fix the problem, hopefully its a little mistake. The string EmpShift thing is in there because I couldn't figure out how to work with the shift code more or less am using that as a place holder until I finger it out. The code itself isn't showing any errors, but when I try to run it I get: MessageBox.Show("Name " + EmployeeName + "IDNumber " + EmployeeNumber + "Hourly rate " + txtPay + "Shift " + txtShift) Private void btnShow_Click(object sender, EventArgs e) ProductionWorker.HourlyPayRate = Convert.ToInt32(txtPay.text) ĮmpShift = Convert.ToString(txtShift.text) ProductionWorker.EmployeeNumber = Convert.ToInt32(txtIdNumb.text) ProductionWorker.EmployeeName = txtName.ToString() ĮmployeeName = productionWorker.EmployeeName //Added mostly because I couldn't get EmployeeName to show anything in the messagebox ![]() ProductionWorker productionWorker = new ProductionWorker() Private void btnGetInfo_Click(object sender, EventArgs e) Private void bt圎xit_Click(object sender, EventArgs e) Public partial class frmMainClasses : Form Here is the code I working on for it: using System Retrieve the object's properties and display their values. The day shift is shift 1 and the night shift is shift 2.Ĭreate an application that creates an object of the ProductionWorker class and lets the user enter data for each of the object's properties. The Shift property will hold an integer value representing the shift that the employee works. The workday is divided into two shifts: day and night. Next, write a class named ProductionWorker that extends the. Shift number (an integer, such as 1, 2, or 3) Write one or more constructors and the appropriate accessor and mutator methods for the class.Next, make a class named ProductionWorker that extends the Employee class. Write one or more constructors and the appropriate accessor and mutator methods for the class. The ProudctionWorker class should have properties to hold the following data: Employee number in the format XXX-L, where each X is a digit within the range (0-9) and the letter L is a letter within the range (A-M). Next, create a class named ProductionWorker that is derived from the Employee class. The following is the problem I'm working on.Ĭreate an Employee class that has properties for the following data: I'm stuck on an assignment for school there is suppose to be a video to shows how to do this but for the life of me I can't figure out how to download the student files from the pearson website. I'm not completely sure the title was good for this. ![]()
0 Comments
Leave a Reply. |