public Employee(int id, string Name, string gender, DateTime DOB, EmplyeeStatus status, Role role, DateTime startDate, string password, bool is_new) { this.employeeID = id; this.employeeName = Name; this.gender = gender; this.dob = DOB; this.status = status; this.role = role; this.startDate = startDate; this.password = password; }
public static void init_Employees()//מילוי רשימת העובדים מתוך בסיס הנתונים { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE Get_all_EmployeeS"; SQL_CON SC = new SQL_CON(); SqlDataReader rdr = SC.execute_query(c); Employees = new List <Employee>(); while (rdr.Read()) { EmplyeeStatus es = (EmplyeeStatus)Enum.Parse(typeof(EmplyeeStatus), rdr.GetValue(4).ToString()); Role r = (Role)Enum.Parse(typeof(Role), rdr.GetValue(5).ToString()); Employee e = new Employee(int.Parse(rdr.GetValue(0).ToString()), rdr.GetValue(1).ToString(), rdr.GetValue(2).ToString(), DateTime.Parse(rdr.GetValue(3).ToString()), es, r, DateTime.Parse(rdr.GetValue(6).ToString()), rdr.GetValue(7).ToString(), false); Employees.Add(e); } }
public void setStatus(EmplyeeStatus status) { this.status = status; }