private void simpleButton4_Click(object sender, EventArgs e) { this.Close(); UserHome userHome = new UserHome(_account); userHome.ShowDialog(); }
// Picture từ camera !!! // private void showCamera() // { //DevExpress.XtraEditors.Camera.TakePictureDialog dialog = new DevExpress.XtraEditors.Camera.TakePictureDialog(); //if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) //{ // System.Drawing.Image image = dialog.Image; // using (var stream = new MemoryStream()) // { // image.Save(stream, ImageFormat.Jpeg); // ImageByArray = stream.ToArray(); // pictureEmployeeEdit.EditValue = stream.ToArray(); // } //} // } private void btnSave_Click(object sender, EventArgs e) { SplashScreenManager.ShowForm(this, typeof(WaitForm), true, true, false); SplashScreenManager.Default.SetWaitFormCaption("Chờ tí nhé....."); Employee emp = employeeService.getEmployeeByAccountId(_account.AccountId); Employee employee = new Employee(); employee.EmployeeId = emp.EmployeeId; employee.AccountId = emp.AccountId; employee.Address = AddressTextEdit.Text; employee.BirthDate = BirthDateDateEdit.DateTime; employee.City = CityTextEdit.Text; employee.District = DistrictTextEdit.Text; employee.Email = EmailTextEdit.Text; employee.FirstName = FirstNameTextEdit.Text; employee.FullName = FullNameTextEdit.Text; employee.LastName = LastNameTextEdit.Text; employee.PhoneNumber = PhoneNumberTextEdit.Text; employee.PositionId = emp.PositionId; employee.Status = StatusTextEdit.Text; employee.Ward = WardTextEdit.Text; employee.Image = ImageByArray; employeeService.updateEmployee(employee); XtraMessageBox.Show("Update successful"); UserHome userHome = new UserHome(_account); SplashScreenManager.CloseForm(); userHome.ShowDialog(); this.Close(); }
private void openFormWithRole(string role) { SplashScreenManager.ShowForm(this, typeof(WaitForm), true, true, false); SplashScreenManager.Default.SetWaitFormCaption("Chờ tí nhé....."); if (String.Compare(role.Trim(), "employee", true) == 0) { Views.UserHome userHome = new Views.UserHome(homeController.getAccountLoggedIn()); SplashScreenManager.CloseForm(); userHome.ShowDialog(); isLoginAdready(true, userName); } else if (String.Compare(role.Trim(), "manage", true) == 0) { AdminHome adminHome = new AdminHome(homeController.getAccountLoggedIn()); SplashScreenManager.CloseForm(); adminHome.ShowDialog(); isLoginAdready(true, userName); } else { SplashScreenManager.CloseForm(); laNotice.Text = "Sai tài khoản hoặc mật khẩu"; } }