private void ExecuteFindStudent(object sender)
        {
            UC_FindStudentScreen findStuent = new 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)
                {
                    CurrentChequeInwardModel = new ChequeInwardsModel()
                    {
                        Student_ID  = findStudentVM.SelectedStudent.StudentId,
                        RegNo       = findStudentVM.SelectedStudent.RegNo,
                        StudentName = findStudentVM.SelectedStudent.Name + " " + findStudentVM.SelectedStudent.SurName + " " + findStudentVM.SelectedStudent.Father,
                        Section_ID  = findStudentVM.SelectedStudent.SectionId,
                        Section     = findStudentVM.SelectedStudent.Section,
                        ChequeNo    = "000000",
                        ChqAmount   = 0
                    };
                }
            }
        }
Example #2
0
        private void ExecuteFindStudent(object sender)
        {
            UC_FindStudentScreen findStuent = new 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 DetainStudentModel()
                    {
                        StudentId  = findStudentVM.SelectedStudent.StudentId,
                        RegNo      = findStudentVM.SelectedStudent.RegNo,
                        Name       = findStudentVM.SelectedStudent.Name,
                        SurName    = findStudentVM.SelectedStudent.SurName,
                        Father     = findStudentVM.SelectedStudent.Father,
                        Section    = findStudentVM.SelectedSection.Name,
                        SectionId  = findStudentVM.SelectedSection.Section_Id,
                        StandardID = findStudentVM.SelectedStudent.StandardID,
                        Standard   = findStudentVM.SelectedStudent.Standard
                    };
                    IEnumerable <GEN_Standards_Lookup> stds = new StudentBusinessLogic().GetAllStandards();
                    DetainStd = stds.Where(S => S.Standard_Id == (this.CurrentStudent.StandardID - 1)).FirstOrDefault().Name;

                    OldSection = _sections.Where(Sec => Sec.Section_Id == stds.Where(S => S.Standard_Id == (this.CurrentStudent.StandardID - 1))
                                                 .FirstOrDefault().Section_Id).FirstOrDefault();
                }
            }
        }
        private void ExecuteFindStudent(object sender)
        {
            UC_FindStudentScreen findStuent = new 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)
                {
                    CurrentChequeInwardModel.Student_ID  = findStudentVM.SelectedStudent.StudentId;
                    CurrentChequeInwardModel.StudentName = findStudentVM.SelectedStudent.Name + " " + findStudentVM.SelectedStudent.SurName + " " + findStudentVM.SelectedStudent.Father;
                    CurrentChequeInwardModel.RegNo       = findStudentVM.SelectedStudent.RegNo;
                    CurrentChequeInwardModel.Section_ID  = findStudentVM.SelectedStudent.SectionId;
                    CurrentChequeInwardModel.Section     = findStudentVM.SelectedStudent.Section;
                    RaisePropertyChanged("CurrentChequeInwardModel");

                    ChequeBusinessLogic business             = new ChequeBusinessLogic();
                    IEnumerable <CHQ_Cheques_Master> cheques = business.GetAllCheques().Where(C => C.Student_ID == findStudentVM.SelectedStudent.StudentId &&
                                                                                              C.ChqStatus_ID == 1 /*Chq Recieved*/ && C.IsActive == true);
                    int serial = 1;
                    foreach (CHQ_Cheques_Master chq in cheques)
                    {
                        this.ChequeList.Add(ConvertToCheque(chq, serial++));
                    }
                }
            }
        }