private void ExecuteFindStudentWithGRCommand(object obj) { if (String.IsNullOrEmpty(SelectedSection.Name)) { WPFCustomMessageBox.CustomMessageBox.ShowOK("Please Select Any Section", "Warning", "OK"); return; } S360Model.PromoteStudentModel student = new StudentBusinessLogic().GetStudentWithRegNoAndSection(this.CurrentStudent.RegNo, this.SelectedSection.Section_Id); if (student == null) { WPFCustomMessageBox.CustomMessageBox.ShowOK("No Records Found", "Message", "OK"); this.CurrentStudent.RegNo = string.Empty; this.CurrentStudent = null; Result = string.Empty; } else { CurrentStudent = new S360Model.ChangeDivisionModel() { StudentId = student.StudentId, RegNo = student.RegNo, Name = student.Name, SurName = student.SurName, Father = student.Father, AccDetId = student.AccDetId, OldDivision = student.Standard + student.Division }; Result = string.Empty; } }
private void ExecuteFindStudentCommand(object sender) { View.Student.UC_FindStudentScreen findStuent = new View.Student.UC_FindStudentScreen(); findStuent.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; FindStudentViewModel findStudentVM = new FindStudentViewModel(); findStudentVM.SelectedSection = this._selectedSection; findStuent.DataContext = findStudentVM; if (findStuent.ShowDialog() == true) { findStudentVM = findStuent.DataContext as FindStudentViewModel; if (findStudentVM.SelectedStudent != null && findStudentVM.SelectedStudent.StudentId > 0) { CurrentStudent = new S360Model.ChangeDivisionModel() { StudentId = findStudentVM.SelectedStudent.StudentId, RegNo = findStudentVM.SelectedStudent.RegNo, Name = findStudentVM.SelectedStudent.Name, SurName = findStudentVM.SelectedStudent.SurName, Father = findStudentVM.SelectedStudent.Father, AccDetId = findStudentVM.SelectedStudent.AccDetId, OldDivision = findStudentVM.SelectedStudent.Standard + findStudentVM.SelectedStudent.Division }; Result = string.Empty; } } }