コード例 #1
0
        } // 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()
コード例 #2
0
 public string ToString(int a)
 {
     return("EMP" + EmpID.ToString().PadLeft(3, '0').PadRight(5, ' ') +
            FirstName.PadRight(10, ' ') +
            LastName.PadRight(10, ' ') +
            Phone);
 }
コード例 #3
0
        } // 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()
コード例 #4
0
 //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, ' '));
 }
コード例 #5
0
 //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);
 }
コード例 #6
0
 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++;
         }
     }
 }
コード例 #7
0
 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;
 }
コード例 #8
0
 private void SaveEmpID()
 {
     File.WriteAllText("empid.txt", EmpID.ToString());
 }
コード例 #9
0
 public override string ToString()
 {
     return(EmpID.ToString());
 }