/// <summary> /// Method to save Student Promotion detail /// </summary> /// <param name="studentAcademicDetails"></param> public void SavePromotion(STUD_StudentAcademic_Details studentsaccademicdetails) { //insert into STUD_StudentAcademic_Details table Decimal LastAccDetId = studentsaccademicdetails.AcademicDet_ID; if (studentsaccademicdetails != null) { try { _StudentAcademicRepository.Insert(studentsaccademicdetails); STUD_DetainingOrPromotions_Details promotion = new STUD_DetainingOrPromotions_Details() { CurrentAcadDetail_ID = studentsaccademicdetails.AcademicDet_ID, LastAcadDetail_ID = LastAccDetId, Status_ID = 1, Student_ID = studentsaccademicdetails.Student_ID, EnteredBy = S360Model.S360Configuration.Instance.UserID, Login_ID = S360Model.S360Configuration.Instance.LoginID }; //Insert into STUD_DetainingOrPromotions_Details table SaveStudentDetainPromotion(promotion); } catch (Exception Ex) { throw new S360Exceptions.S360Exception(Ex.Message, Ex.InnerException); } } }
private void ExecuteChangeDivisionCommand(object sender) { StudentBusinessLogic business = new StudentBusinessLogic(); STUD_Students_Master student = business.GetAllStudents().Where(S => S.Student_ID == this.CurrentStudent.StudentId).FirstOrDefault(); STUD_StudentAcademic_Details Acc = business.GetAllStudentsAccademicDetails().Where(A => A.Student_ID == this.CurrentStudent.StudentId && A.AcademicDet_ID == this.CurrentStudent.AccDetId).FirstOrDefault(); student.CurrentDiv = CurrentStudent.NewDivision.ToUpper(); Acc.Division = CurrentStudent.NewDivision.ToUpper(); business.UpdateStudent(student); business.UpdateStudentAcademics(Acc); //Result = string.Format(SelectedSection.Name.Substring(0, 1) + " " + CurrentStudent.RegNo + " - " + CurrentStudent.Fullname + "\t\t" + "Division Changed from " + CurrentStudent.OldDivision + " to " + CurrentStudent.NewDivision); Result = string.Format("{0} {1} - {2} \t\tDivision changed from {3} to {4}", SelectedSection.Name.Substring(0, 1), CurrentStudent.RegNo, CurrentStudent.Fullname, CurrentStudent.OldDivision, CurrentStudent.NewDivision); }
/// <summary> /// Save Student accademic details /// </summary> /// <param name="studentDetails"></param> /// <param name="studentAcademicDetails"></param> /// <returns></returns> public STUD_StudentAcademic_Details SaveStudentAcademicDetails(STUD_Students_Master studentDetails, STUD_StudentAcademic_Details studentAcademicDetails) { STUD_StudentAcademic_Details AcademicDetails = new STUD_StudentAcademic_Details(); AcademicDetails.RegNo = studentDetails.RegNo; AcademicDetails.Student_ID = studentDetails.Student_ID; AcademicDetails.AcademicDet_ID = (decimal)studentDetails.CurrentAcaDetail_ID; AcademicDetails.Remarks = studentDetails.Remarks; AcademicDetails.Standard_ID = (short)studentDetails.CurrentStd_ID; AcademicDetails.Section_ID = studentAcademicDetails.Section_ID; AcademicDetails.AcademicYearStart = studentAcademicDetails.AcademicYearStart; AcademicDetails.AcademicYearEnd = studentAcademicDetails.AcademicYearEnd; AcademicDetails.IsActive = true; STUD_StudentAcademic_Details academicdetails = _StudentAcademicRepository.Insert(AcademicDetails); studentDetails.CurrentAcaDetail_ID = academicdetails.AcademicDet_ID; _StudentRepository.Update(studentDetails); return(AcademicDetails); }
private void ExecuteSaveCommand(object sender) { try { ControlValidationStatus controlValidationStatus = ValidateControls.ValidateAllControls(sender); if (controlValidationStatus != null && !controlValidationStatus.isValid) { WPFCustomMessageBox.CustomMessageBox.ShowOK(controlValidationStatus.ValidationMessage, "S360 Application", "OK"); return; } STUD_Students_Master studentDetails = new STUD_Students_Master(); if (!string.IsNullOrEmpty(GRNO)) { studentDetails.RegNo = GRNO; } if (!string.IsNullOrEmpty(ReligionText)) { studentDetails.Religion = ReligionText; } if (!string.IsNullOrEmpty(StudentName)) { studentDetails.Name = StudentName; } if (!string.IsNullOrEmpty(FatherName)) { studentDetails.FatherName = FatherName; } if (!string.IsNullOrEmpty(SurName)) { studentDetails.Surname = SurName; } if (!string.IsNullOrEmpty(StudentAddress)) { studentDetails.Address = StudentAddress; } if (!string.IsNullOrEmpty(StudentRemarks)) { studentDetails.Remarks = StudentRemarks; } if (!string.IsNullOrEmpty(MotherTongue)) { studentDetails.MotherTongue = MotherTongue; } if (!string.IsNullOrEmpty(MotherName)) { studentDetails.MotherName = MotherName; } if (!string.IsNullOrEmpty(StudentDivision) && StudentDivision.Length < 3) { studentDetails.CurrentDiv = StudentDivision; } else { WPFCustomMessageBox.CustomMessageBox.ShowOK("Invalid Division", "S360 Application", "OK"); return; } if (DateOfBirth != null) { studentDetails.DOB = DateOfBirth; } if (!string.IsNullOrEmpty(Cast)) { studentDetails.Caste = Cast; } if (!string.IsNullOrEmpty(Mobile1)) { studentDetails.Mobile1 = Mobile1; } if (!string.IsNullOrEmpty(Mobile2)) { studentDetails.Mobile2 = Mobile2; } if (!string.IsNullOrEmpty(Mobile3)) { studentDetails.Mobile3 = Mobile3; } if (!string.IsNullOrEmpty(HomeNo)) { studentDetails.HomePh = HomeNo; } if (!string.IsNullOrEmpty(WorkNo)) { studentDetails.WorkPh = WorkNo; } if (!string.IsNullOrEmpty(Email)) { studentDetails.Email = Email; } if (!string.IsNullOrEmpty(RFID)) { studentDetails.RFIDTag = RFID; } if (!string.IsNullOrEmpty(AadharNo)) { studentDetails.AadharNo = AadharNo; } if (!string.IsNullOrEmpty(Contact1)) { studentDetails.PrimaryContact = Contact1; } if (SelectedCategory != null) { studentDetails.Category_ID = SelectedCategory.Category_Id; } if (SelectedStandard != null) { studentDetails.CurrentStd_ID = SelectedStandard.Standard_Id; } if (SelectedLanguage != null) { studentDetails.Language_ID = SelectedLanguage.Language_Id; } if (!string.IsNullOrEmpty(SelectedGender) && SelectedGender.Length < 2) { studentDetails.Gender = SelectedGender; } if (SelectedReligion != null) { studentDetails.Religion_ID = SelectedReligion.Religion_Id; } studentDetails.CurrentAcaDetail_ID = 1; studentDetails.LastModifiedBy_ID = S360Configuration.Instance.UserID; studentDetails.LastModifiedOn = DateTime.Now; studentDetails.IsActive = true; studentDetails.EnteredBy_ID = S360Configuration.Instance.UserID; studentDetails.EnteredOn = DateTime.Now; STUD_Students_Master studentdetails = studentBusinessLogic.SaveStudent(studentDetails); if (studentdetails != null) { STUD_StudentAcademic_Details AcademicDetails = new STUD_StudentAcademic_Details(); AcademicDetails.Section_ID = SelectedSection.Section_Id; AcademicDetails.AcademicYearStart = S360Configuration.Instance.AcademicYearStart; AcademicDetails.AcademicYearEnd = S360Configuration.Instance.AcademicYearEnd; STUD_StudentAcademic_Details result = studentBusinessLogic.SaveStudentAcademicDetails(studentdetails, AcademicDetails); if (result != null) { WPFCustomMessageBox.CustomMessageBox.ShowOK("Student Saved Sucessfull", "S360 Application", "OK"); bool clearAll = ValidateControls.ClearAllControls(sender); } } } catch (Exception ex) { throw new S360Exception(ex.Message, ex.InnerException); } }
/// <summary> /// Method to update Student master table after Promotion or detain /// </summary> /// <param name="students"></param> public void UpdateStudentAcademics(STUD_StudentAcademic_Details studentsAcc) { _StudentAcademicRepository.Update(studentsAcc); }