private void insertCompanyData() { Persistence pers = new PersistenceImpl(); var myconf = new MyConfiguration(); myconf.currentBatch = "2012-16"; myconf.currentDegree = "B.TECH"; var compList = new List <Object>(); for (int i = 108; i < 109; i++) { var compObj = new Entity_Company(); compObj.companyId = i; compObj.companyName = "COMPANY" + i; var compDetail = new Entity_CompanyDetails(); compDetail.DOR = DateTime.Now.AddDays(20 + i); compDetail.host = "ACET"; compDetail.myConfigObj = myconf; compDetail.staffId = 1; compDetail.status = 1; compDetail.type = 0; compDetail.companyObj = compObj; compList.Add(compDetail); } pers.bulkInsert(compList); }
public int insertStudentData(IList<object> coll) { if (coll != null && coll.Count > 0) { var studentList = coll[0] as List<object>; var scoreList = coll[1] as List<object>; if (studentList.Count > 0) { Persistence persistence = new PersistenceImpl(); if (persistence.bulkInsert(studentList)) { if (persistence.bulkInsert(scoreList)) { if (persistence.nativeQuery(Common.mySqlUpdateQuery1_studentscore)) return 1; } } else return 3; } else return 2; } return 0; }
private void insertStudentData() { Persistence p = new PersistenceImpl(); var conf = new MyConfiguration(); conf.currentBatch = "2012-16"; conf.currentDegree = "B.TECH"; string[] branch = new string[5] { "Software", "COMPUTER SCIENCE", "MECHANICAL", "ECE", "CIVIL" }; string[] gender = new string[2] { "MALE", "FEMALE" }; int studentId = 1704; long scoreID = 247; var mylist = new List <Object>(); var scoreList = new List <Object>(); for (int i = 200; i < 2201; i++) { var student = new Entity_Student(); student.branch = branch[i % branch.Length]; student.collegeId = studentId.ToString(); student.email = "*****@*****.**"; student.gender = gender[i % gender.Length]; student.myConfigObj = conf; student.phone = "111111111"; student.studentName = "Student" + i; mylist.Add(student); studentId++; var score = new Entity_StudentScore(); score.arrears = 0; score.cgpa = 7.6; score.X = 85; score.XII = 78; score.studentId = scoreID; scoreList.Add(score); scoreID++; } if (p.bulkInsert(mylist)) { p.bulkInsert(scoreList); } }
public int updateStudentData(IList<object> coll) { if (coll != null ) { if (coll.Count > 0) { Persistence persistence = new PersistenceImpl(); if (persistence.truncateTable<Entity_UpdateScore>()) { if (persistence.bulkInsert(coll)) { if (persistence.nativeQuery(Common.mySqlUpdateQuery1_updatescore)) return 1; } return 0; } return 0; } return 2; } return 0; }