//add new admin public void AddAdmin(string userName, string password, string fullName, string birthDate, string age, string email, string contactNo, string cityName) { AdminTable at = new AdminTable(); at.UserName = userName; at.Password = password; at.FullName = fullName; at.Birthdate = birthDate; at.Age = age; at.Email = email; at.ContactNo = contactNo; at.CityName = cityName; context.AdminTables.InsertOnSubmit(at); context.SubmitChanges(); }
//offer new course public void AddCourse(string department, string subID, string subName, string section, string time, string seat) { if (department == "CS") { CSCourseTable ct = new CSCourseTable(); ct.SubjectID = subID; ct.SubjectName = subName; ct.Section = section; ct.Time = time; ct.Seat = seat; ct.AvailableSeat = seat; context.CSCourseTables.InsertOnSubmit(ct); context.SubmitChanges(); } else if (department == "EEE") { EEECourseTable et = new EEECourseTable(); et.SubjectID = subID; et.SubjectName = subName; et.Section = section; et.Time = time; et.Seat = seat; et.AvailableSeat = seat; context.EEECourseTables.InsertOnSubmit(et); context.SubmitChanges(); } else if (department == "BBA") { BBACourseTable bt = new BBACourseTable(); bt.SubjectID = subID; bt.SubjectName = subName; bt.Section = section; bt.Time = time; bt.Seat = seat; bt.AvailableSeat = seat; context.BBACourseTables.InsertOnSubmit(bt); context.SubmitChanges(); } }
//add new faculty public void AddStudent(string studentID, string password, string fullName, string cgpa, string program, string fatherName, string motherName, string presentAddress, string permanentAddress, string phone, string email, string dob, string sex, string nationality, string religion, string maritalStatus, string bloodGroup, string admissionDate, string graduationDate, Image pic, string department) { if (department == "CS") { CSStudentsTable csst = new CSStudentsTable(); csst.StudentID = studentID; csst.Password = password; csst.FullName = fullName; csst.CGPA = cgpa; csst.Program = program; csst.FatherName = fatherName; csst.MotherName = motherName; csst.PresentAddress = presentAddress; csst.PermanentAddress = permanentAddress; csst.Phone = phone; csst.Email = email; csst.DOB = dob; csst.Sex = sex; csst.Nationality = nationality; csst.Religion = religion; csst.MaritalStatus = maritalStatus; csst.BloodGroup = bloodGroup; csst.AdmissionDate = admissionDate; csst.GraduationDate = graduationDate; //img byte[] fileByte = ImageToByteArray(pic); System.Data.Linq.Binary fileBinary = new System.Data.Linq.Binary(fileByte); csst.Image = fileBinary; context.CSStudentsTables.InsertOnSubmit(csst); context.SubmitChanges(); } else if (department == "EEE") { EEEStudentsTable eeest = new EEEStudentsTable(); eeest.StudentID = studentID; eeest.Password = password; eeest.FullName = fullName; eeest.CGPA = cgpa; eeest.Program = program; eeest.FatherName = fatherName; eeest.MotherName = motherName; eeest.PresentAddress = presentAddress; eeest.PermanentAddress = permanentAddress; eeest.Phone = phone; eeest.Email = email; eeest.DOB = dob; eeest.Sex = sex; eeest.Nationality = nationality; eeest.Religion = religion; eeest.MaritalStatus = maritalStatus; eeest.BloodGroup = bloodGroup; eeest.AdmissionDate = admissionDate; eeest.GraduationDate = graduationDate; //img byte[] fileByte = ImageToByteArray(pic); System.Data.Linq.Binary fileBinary = new System.Data.Linq.Binary(fileByte); eeest.Image = fileBinary; context.EEEStudentsTables.InsertOnSubmit(eeest); context.SubmitChanges(); } else if (department == "BBA") { BBAStudentsTable bbast = new BBAStudentsTable(); bbast.StudentID = studentID; bbast.Password = password; bbast.FullName = fullName; bbast.CGPA = cgpa; bbast.Program = program; bbast.FatherName = fatherName; bbast.MotherName = motherName; bbast.PresentAddress = presentAddress; bbast.PermanentAddress = permanentAddress; bbast.Phone = phone; bbast.Email = email; bbast.DOB = dob; bbast.Sex = sex; bbast.Nationality = nationality; bbast.Religion = religion; bbast.MaritalStatus = maritalStatus; bbast.BloodGroup = bloodGroup; bbast.AdmissionDate = admissionDate; bbast.GraduationDate = graduationDate; //img byte[] fileByte = ImageToByteArray(pic); System.Data.Linq.Binary fileBinary = new System.Data.Linq.Binary(fileByte); bbast.Image = fileBinary; context.BBAStudentsTables.InsertOnSubmit(bbast); context.SubmitChanges(); } }
//add new faculty public void AddFaculty(string userName, string password, string fullName, string roomNo, string contactNo, string email, string dob, string age, string sex, string bloodGroup, string college, string university, string address, Image pic, string department) { if (department == "CS") { CSFacultyTable csft = new CSFacultyTable(); csft.UserName = userName; csft.Password = password; csft.FullName = fullName; csft.RoomNo = roomNo; csft.CntactNo = contactNo; csft.Email = email; csft.DOB = dob; csft.Age = age; csft.Sex = sex; csft.BloodGroup = bloodGroup; csft.College = college; csft.University = university; csft.Address = address; //img byte[] fileByte = ImageToByteArray(pic); System.Data.Linq.Binary fileBinary = new System.Data.Linq.Binary(fileByte); csft.Image = fileBinary; context.CSFacultyTables.InsertOnSubmit(csft); context.SubmitChanges(); } else if (department == "EEE") { EEEFacultyTable eeeft = new EEEFacultyTable(); eeeft.UserName = userName; eeeft.Password = password; eeeft.FullName = fullName; eeeft.RoomNo = roomNo; eeeft.CntactNo = contactNo; eeeft.Email = email; eeeft.DOB = dob; eeeft.Age = age; eeeft.Sex = sex; eeeft.BloodGroup = bloodGroup; eeeft.College = college; eeeft.University = university; eeeft.Address = address; //img byte[] fileByte = ImageToByteArray(pic); System.Data.Linq.Binary fileBinary = new System.Data.Linq.Binary(fileByte); eeeft.Image = fileBinary; context.EEEFacultyTables.InsertOnSubmit(eeeft); context.SubmitChanges(); } else if (department == "BBA") { BBAFacultyTable bbaft = new BBAFacultyTable(); bbaft.UserName = userName; bbaft.Password = password; bbaft.FullName = fullName; bbaft.RoomNo = roomNo; bbaft.CntactNo = contactNo; bbaft.Email = email; bbaft.DOB = dob; bbaft.Age = age; bbaft.Sex = sex; bbaft.BloodGroup = bloodGroup; bbaft.College = college; bbaft.University = university; bbaft.Address = address; //img byte[] fileByte = ImageToByteArray(pic); System.Data.Linq.Binary fileBinary = new System.Data.Linq.Binary(fileByte); bbaft.Image = fileBinary; context.BBAFacultyTables.InsertOnSubmit(bbaft); context.SubmitChanges(); } }