void deleteuser(object param) { Mouse.OverrideCursor = Cursors.Wait; if (SelectedUser != null) { MessageBoxResult result = MessageBox.Show("Do you want to Delete User?\n" + "@ Simple Accounting Software Pte Ltd", "Delete Content", MessageBoxButton.YesNo); switch (result) { case MessageBoxResult.Yes: var user = SelectedUser as UsersSecurityEntity; if (user.ID > 0) { var deleteuser = securityRepository.DeleteUser(user.ID); if (deleteuser == false) { MessageBox.Show("Oops there seems to be a problem right now, kindly close the application and restart!\n" + "@ Simple Accounting Software Pte Ltd"); } this.LoadBackground(); } else { UserSecurityEntity.Remove(user); } break; case MessageBoxResult.No: break; } } Mouse.OverrideCursor = null; }
void DoSave(object param) { MessageBoxResult result = MessageBox.Show("Do you want to save changes?\n", "Save Content", MessageBoxButton.YesNo); switch (result) { case MessageBoxResult.Yes: var user = UserSecurityEntity.ToList(); var saveuser = securityRepository.SaveUsers(user); this.LoadBackground(); if (saveuser == false) { MessageBox.Show("Oops there seems to be a problem right now, kindly close the application and restart!\n" + "@ Simple Accounting Software Pte Ltd"); } break; case MessageBoxResult.No: break; //var demo = UserRoleModelCollection; //var demo = UserRoleModelCollection; //if (SelectedIndex == -1) //{ // personnel.AddEmployee(employee); // RaisePropertyChanged("Employee"); // Update the list from the data source //} //else // personnel.UpdateEmployee(employee); //SelectedUser = null; } }
void addRow(object param) { UserSecurityEntity.Add(new UsersSecurityEntity { Isinactive = false }); }