} //end function public StudentGraduationRecord StudentGraduationRecordSelectByID(int intGraduationStudentID) { try { string sp_name = "StudentGraduationRecordSelectByID"; comStudentGraduationRecord.Parameters.AddWithValue("GraduationStudentID", intGraduationStudentID); ConnectAndExecute(sp_name); //no parameter will send to stored procedure if (dsStudentGraduationRecord.Tables[0].Rows.Count == 1) { DataRow drStudentGraduationRecord = dsStudentGraduationRecord.Tables[0].Rows[0]; StudentGraduationRecord objStudentGraduationRecord = new StudentGraduationRecord(); objStudentGraduationRecord.GraduationStudentID = Convert.ToInt64(drStudentGraduationRecord["GraduationStudentID"]); objStudentGraduationRecord.StudentID = Convert.ToInt64(drStudentGraduationRecord["StudentID"]); objStudentGraduationRecord.UniversityInstitute = Convert.ToString(drStudentGraduationRecord["UniversityInstitute"]); objStudentGraduationRecord.Collage = Convert.ToString(drStudentGraduationRecord["Collage"]); objStudentGraduationRecord.EducationSystem = Convert.ToString(drStudentGraduationRecord["EducationSystem"]); objStudentGraduationRecord.TotalMarks = Convert.ToInt32(drStudentGraduationRecord["TotalMarks"]); objStudentGraduationRecord.GraduationCGPA = Convert.ToInt64(drStudentGraduationRecord["GraduationCGPA"]); objStudentGraduationRecord.ObtainedMarks = Convert.ToInt32(drStudentGraduationRecord["ObtainedMarks"]); objStudentGraduationRecord.YearPassed = Convert.ToInt32(drStudentGraduationRecord["YearPassed"]); objStudentGraduationRecord.AddByID = Convert.ToInt64(drStudentGraduationRecord["AddByID"]); objStudentGraduationRecord.AddDateTime = Convert.ToDateTime(drStudentGraduationRecord["AddDateTime"]); objStudentGraduationRecord.LastUpdateID = Convert.ToInt64(drStudentGraduationRecord["LastUpdateID"]); objStudentGraduationRecord.LastUpdateDateTime = Convert.ToDateTime(drStudentGraduationRecord["LastUpdateDateTime"]); return(objStudentGraduationRecord); } return(null); } catch (Exception ex) { SetError(ex.Message); return(null); } //end try } //end function
private void StudentGraduationInsertUpdate(Int64 student_Id = 0) { StudentGraduationRecord studentGraduationRecord = new StudentGraduationRecord(); studentGraduationRecord.GraduationStudentID = 0; studentGraduationRecord.StudentID = student_id; studentGraduationRecord.UniversityInstitute = txtGraduationBoardInstituteUni.Text; studentGraduationRecord.Collage = txtGraduationCollegeIntitute.Text; studentGraduationRecord.EducationSystem = cmbGraduationStudentEducationSystem.Text; studentGraduationRecord.TotalMarks = Convert.ToInt32(txtInGraduationTotalMarks.Text); studentGraduationRecord.GraduationCGPA = Convert.ToInt64(txtGraduationStudentCGPA.Text); studentGraduationRecord.ObtainedMarks = Convert.ToInt32(txtGraduationObtainedMarks.Text); studentGraduationRecord.YearPassed = Convert.ToInt32(txtGraduationPassedYear.Text); studentGraduationRecord.AddByID = Convert.ToInt64(this.Tag); studentGraduationRecord.AddDateTime = System.DateTime.Now; studentGraduationRecord.LastUpdateID = Convert.ToInt64(this.Tag); studentGraduationRecord.LastUpdateDateTime = System.DateTime.Now; StudentGraduationRecordController.InsertUpdateStudentGraduationRecord(studentGraduationRecord); }
/////////////////////////////////////////////////////////////////////////////////////////// //Private Methods/////////////////////////////////////////////////////////////////////////// //DB to Model// private void GenerateModelList() { StudentGraduationRecordList.Clear(); foreach (DataRow drStudentGraduationRecord in dsStudentGraduationRecord.Tables[0].Rows) { StudentGraduationRecord objStudentGraduationRecord = new StudentGraduationRecord(); objStudentGraduationRecord.GraduationStudentID = Convert.ToInt64(drStudentGraduationRecord["GraduationStudentID"]); objStudentGraduationRecord.StudentID = Convert.ToInt64(drStudentGraduationRecord["StudentID"]); objStudentGraduationRecord.UniversityInstitute = Convert.ToString(drStudentGraduationRecord["UniversityInstitute"]); objStudentGraduationRecord.Collage = Convert.ToString(drStudentGraduationRecord["Collage"]); objStudentGraduationRecord.EducationSystem = Convert.ToString(drStudentGraduationRecord["EducationSystem"]); objStudentGraduationRecord.TotalMarks = Convert.ToInt32(drStudentGraduationRecord["TotalMarks"]); objStudentGraduationRecord.GraduationCGPA = Convert.ToInt64(drStudentGraduationRecord["GraduationCGPA"]); objStudentGraduationRecord.ObtainedMarks = Convert.ToInt32(drStudentGraduationRecord["ObtainedMarks"]); objStudentGraduationRecord.YearPassed = Convert.ToInt32(drStudentGraduationRecord["YearPassed"]); objStudentGraduationRecord.AddByID = Convert.ToInt64(drStudentGraduationRecord["AddByID"]); objStudentGraduationRecord.AddDateTime = Convert.ToDateTime(drStudentGraduationRecord["AddDateTime"]); objStudentGraduationRecord.LastUpdateID = Convert.ToInt64(drStudentGraduationRecord["LastUpdateID"]); objStudentGraduationRecord.LastUpdateDateTime = Convert.ToDateTime(drStudentGraduationRecord["LastUpdateDateTime"]); StudentGraduationRecordList.Add(objStudentGraduationRecord); } }
public static Int64 InsertUpdateStudentGraduationRecord(StudentGraduationRecord objIUStudentGraduationRecord) { Int64 new_id = objIUStudentGraduationRecord.InsertUpdateStudentGraduationRecord(); return(new_id); }