public AdminInforTeachers(Employee employee) { InitializeComponent(); this._employee = employee; _position = positionServices.getPositionById((int)_employee.PositionId); _deparment = departmentServices.getDepartmentById((int)_position.DepartmentId); // This line of code is generated by Data Source Configuration Wizard dataLayoutControl1.DataSource = new QuanLyDaiHocGiaDinh.Model.LinQDataContext().Accounts; }
private void btnSuaChucVu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { string id = gridViewPositon.Columns.View.GetFocusedRowCellValue("PositionId").ToString(); string positionName = gridViewPositon.Columns.View.GetFocusedRowCellValue("PositionName").ToString(); AdminUpdatePosition adminUpdatePosition = new AdminUpdatePosition(positionServices.getPositionById(Int32.Parse(id))); adminUpdatePosition.updatePosition(positionName); adminUpdatePosition.ShowDialog(); load_allGridView(); }
public AdminUpdateTeachers(Employee employee) { InitializeComponent(); this._employee = employee; this._position = positionServices.getPositionById((int)_employee.PositionId); this._deparment = departmentServices.getDepartmentById((int)_position.DepartmentId); this._account = accountServices.getAccountById((int)_employee.AccountId); PositionNameDepartmentNameCheckComboBoxEdit.Properties.SelectAllItemVisible = false; PositionNameDepartmentNameCheckComboBoxEdit.LookAndFeel.StyleChanged += LookAndFeel_StyleChanged; DepartmentNameCheckComboBoxEdit.Properties.SelectAllItemVisible = false; DepartmentNameCheckComboBoxEdit.LookAndFeel.StyleChanged += LookAndFeel_StyleChanged; }
public MongoEmployee setAddEmployee(Employee x) { String department = positionServices.getDepartmentByIdPosition((int)x.PositionId).DepartmentName; String position = positionServices.getPositionById((int)x.PositionId).PositionName; DateTime dateTime = (DateTime)x.BirthDate; String birthdate = dateTime.Day + "/" + dateTime.Month + "/" + dateTime.Year; List <MongoSchedule> schedulesList = new List <MongoSchedule>(); MongoAccount acc = new MongoAccount(x.AccountId.ToString(), x.Email, x.Email, "employee"); Console.WriteLine("------------------------>" + acc.UserName); MongoEmployee emp = new MongoEmployee(x.EmployeeId.ToString(), x.FullName, x.Email, x.Address, x.PhoneNumber, position, department, "Hình nè", birthdate, acc, schedulesList); return(emp); }
public UserHome(Account account) { InitializeComponent(); DateTime now = DateTime.Now; this._account = account; employeeService = new EmployeeService(account); Employee employee = new Employee(); employee = employeeService.getEmployeeByAccountId(_account.AccountId); //lấy employee đang đăng nhập showEmployee(employee); _position = positionServices.getPositionById((int)employee.PositionId); ShowPosition(_position); _department = departmentServices.getDepartmentById((int)_position.DepartmentId); ShowDepartment(_department); setVisibleScheduleRibbonPage(false); // this.p_selectAllEmployeeTableAdapter.Fill(this.giaDinhUniversityDataSet.p_selectAllEmployee); this.scheduleTableAdapter.Fill(this.giaDinhUniversityDataSet.Schedule, this._account.AccountId, _department.DepartmentId, _position.PositionId); //Ví dụ để lấy employee đang đăng nhập // employee.FullName = "Duy Hieu"; // employee.FirstName = "Việt Nè"; //employeeService.updateEmployee(employee);//ví dụ về cập nhật // MessageBox.Show(employee.Position.PositionName); //Position position = new Position(); ///show PositionName // position = employeeService.getEmployeeByAccountId(); //ShowPosition(position); schedulerControl1.Start = DateTime.Now; schedulerControl.Start = DateTime.Now; Console.WriteLine(employeeService.getEmployeeByAccountId().FullName); //////////// // dataLayoutControl1.DataSource = new QuanLyDaiHocGiaDinh.Model.LinQDataContext().Accounts; }