} // end Parameterized constructor /// <summary> /// To override the ToString method so object property values are returned /// </summary> /// <returns>The string containing the object property values</returns> public override string ToString() { return "\r\n" + FirstName.ToString() + " " + LastName.ToString() + ":\r\n\t" + "Type: " + EmpType.ToString().ToLowerInvariant() + "\r\n\t" + "ID: " + EmpID.ToString() + "\r\n\t" + "Monthly Salary: " + MonthlySalary.ToString("C") + "\n"; } // end method ToString()
public string ToString(int a) { return("EMP" + EmpID.ToString().PadLeft(3, '0').PadRight(5, ' ') + FirstName.PadRight(10, ' ') + LastName.PadRight(10, ' ') + Phone); }
} // end Parameterized constructor /// <summary> /// To override the ToString method so object property values are returned /// </summary> /// <returns>The string containing the object property values</returns> public override string ToString() { return "\r\n" + FirstName.ToString() + " " + LastName.ToString() + ":\r\n\t" + "Type: " + EmpType.ToString().ToLowerInvariant() + "\r\n\t" + "ID: " + EmpID.ToString() + "\r\n\t" + "Hourly Rate: " + HourlyRate.ToString("C") + "\n"; } // end method ToString()
//methods public override string ToString() { return("EMP" + EmpID.ToString().PadLeft(3, '0').PadRight(7, ' ') + " " + FirstName.PadRight(10, ' ') + " " + LastName.PadRight(10, ' ') + " " + WorkDate.ToShortDateString().PadRight(15, ' ') + " " + Hours.ToString().PadRight(10, ' ')); }
//method -- override toString to show info of object public override string ToString() { return("EMP" + EmpID.ToString().PadLeft(3, '0').PadRight(7, ' ') + FirstName.PadRight(10, ' ') + LastName.PadRight(10, ' ') + Email.PadRight(25, ' ') + DOB.ToShortDateString().PadRight(15, ' ') + Phone); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ProjectAccess obj = new ProjectAccess(); List <int> EmpIDList = obj.GetEmployeeID(); int i = 0; foreach (int EmpID in EmpIDList) { EmployeeIDDropDownList.Items.Insert(i, new ListItem(EmpID.ToString())); i++; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EmployeeDataAccess empobj = new EmployeeDataAccess(); List <int> EmpIDList = empobj.GetEmployeeID(); int i = 0; foreach (int EmpID in EmpIDList) { EmployeeIDDropDownList.Items.Insert(i, new ListItem(EmpID.ToString())); i++; } } UnobtrusiveValidationMode = UnobtrusiveValidationMode.None; }
private void SaveEmpID() { File.WriteAllText("empid.txt", EmpID.ToString()); }
public override string ToString() { return(EmpID.ToString()); }