예제 #1
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void createOccupation(int Id, string occupation, int clusterId, int annualGross, int monthlyGross, int marriedAnnualTaxes,
     int marriedMonthlyTaxes, int marriedAfterTaxes, int singleAnnualTaxes, int singleMonthlyTaxes, int singleAfterTaxes, int studentLoans,
     double requiredGpa, int requiredEducation)
 {
     DB d1 = new DB();
     d1.Insert("INSERT INTO occupation VALUES (" + Id + ", '" + occupation + "' , " + clusterId + " , " + annualGross + ", " + monthlyGross + ", " + marriedAnnualTaxes + ", " +
         marriedMonthlyTaxes + ", " + marriedAfterTaxes + ", " + singleAnnualTaxes + ", " + singleMonthlyTaxes + ", " + singleAfterTaxes + " , " + studentLoans + ", " +
         requiredGpa + ", " + requiredEducation + ")");
 }
예제 #2
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void createStudent(string firstName, string lastName, string classPeriod, string teacher, string group, string sex, double gpa, int educationId,
     int occupationId, string married, string children, int childrenNumber, string creditCard, int creditUse, int creditScore, int schoolId, 
     int salary, int netMonthlyIncome, int studentLoans, int maritalStatusId)
 {
     DB d1 = new DB();
     d1.Insert("INSERT INTO student (FirstName, LastName, ClassPeriod, Teacher, StudentGroup, Sex, GPA, EducationId, OccupationId, Married, Children, ChildrenNumber, " +
         "CreditCard, CreditUseId, CreditScore, SchoolId, Salary, NetMonthlyIncome, StudentLoans, MaritalStatusId) " +
         "VALUES ('" + firstName + "' , '" + lastName + "' , '" + classPeriod + "' , '" + teacher + "' , '" + group + "' , '" + sex +
         "' , " + gpa + " , " + educationId + " , " + occupationId + " , '" + married + "' , '" + children + "' , " + childrenNumber +
         " , '" + creditCard + "' , " + creditUse + " , " + creditScore + " , " + schoolId + " , " + salary + " , " + netMonthlyIncome +
         " , " + studentLoans + " , " + maritalStatusId + ")");
 }
예제 #3
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectSingleAfterTaxes(int occupationId)
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT SingleAfterTaxes FROM occupation WHERE Id = " + occupationId + "");
     return dt;
 }
예제 #4
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectCreditUse()
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT * FROM credit");
     return dt;
 }
예제 #5
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void deleteStudents(string group)
 {
     DB d1 = new DB();
     d1.Delete("DELETE FROM student WHERE studentgroup = '" + group + "'");
 }
예제 #6
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void deleteSchool(int schoolId)
 {
     DB d1 = new DB();
     d1.Delete("DELETE FROM schools WHERE schoolId = " + schoolId + "");
 }
예제 #7
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateStudentMaritalStatusMaleMarried(int number, string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE Student SET MaritalStatusId = 3 WHERE StudentID IN " +
                 "(SELECT studentId FROM student WHERE StudentGroup = '" + group + "' AND Married = 'Yes' AND Sex = 'Male' LIMIT " + number + ")");
 }
예제 #8
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void createSchool(int schoolId, string school)
 {
     DB d1 = new DB();
     d1.Insert("INSERT INTO schools VALUES("+ schoolId + ", '" + school + "')");
 }
예제 #9
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void setNonCustodyCheckbook(string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET checkbook = netmonthlyincome - childsupport WHERE studentgroup = '" + group + "' AND Custody = 'No'");
 }
예제 #10
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void setCustodyCheckbook(string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET checkbook = netmonthlyincome + childsupport WHERE Custody = 'Yes' OR Custody IS null AND studentgroup = '" + group + "'");
 }
예제 #11
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void setChildSupportToZero(string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET childsupport = 0 WHERE studentgroup = '" + group + "'");
 }
예제 #12
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectStudents(string group)
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT s.studentId, s.FirstName, s.LastName, s.MarriedTo, " +
         "s.Sex, s.GPA, o.Occupation, s.Salary, s.NetMonthlyIncome, m.MaritalStatus, " +
         "s.ChildrenNumber, s.childSupport, s.CreditScore " +
         "FROM student s, schools sch, occupation o, education e, credit c, MaritalStatus m " +
         "WHERE c.creditId = s.creditUseId AND e.EducationId = s.EducationId AND m.Id = s.MaritalStatusId " +
         "AND o.Id = s.occupationId AND sch.SchoolId = s.schoolId AND s.studentGroup = '" + group + "'");
     return dt;
 }
예제 #13
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectStudentLoans(int occupationId)
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT studentLoans FROM occupation WHERE Id = " + occupationId + "");
     return dt;
 }
예제 #14
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectStudent(int studentId)
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT * FROM student WHERE studentId = " + studentId + "");
     return dt;
 }
예제 #15
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateStudent(int studentId, string studentGroup, string firstName, string lastName, int schoolId, string teacher, string classPeriod, string sex,
     double gpa, int occupationId, int maritalStatusId, string marriedTo, int childrenNumber, int childSupport, int netMonthlyIncome, int studentLoans, int creditScore, int checkbook)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET studentgroup = '" + studentGroup + "', firstname = '" + firstName + "', lastname = '" + lastName + "', schoolId = " + schoolId +
         ", teacher = '" + teacher + "', classperiod = '" + classPeriod + "', sex = '" + sex + "', gpa = " + gpa + ", occupationId = " + occupationId +
         ", maritalstatusId = " + maritalStatusId + ", marriedTo = '" + marriedTo + "', childrenNumber = " + childrenNumber + ", childsupport = " + childSupport +
         ", netMonthlyIncome = " + netMonthlyIncome + ", studentLoans = " + studentLoans + ", creditScore = " + creditScore + ", checkbook = " + checkbook + " WHERE studentId = " + studentId + "");
 }
예제 #16
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateChildrenNumber(int id, int children)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET childrenNumber = " + children + ", maritalStatusId = 2 WHERE StudentId = " + id + "");
 }
예제 #17
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateStudentMaritalStatusDivorced(int number, string group)
 {
     DB d1 = new DB();
     d1.Update("Update Student SET maritalstatusId = 5 WHERE StudentID IN " +
                "(SELECT studentId FROM student WHERE studentGroup = '" + group + "' AND Married != 'No' AND maritalStatusId != 3 LIMIT " + number + ")");
 }
예제 #18
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateChildrenNumberto0(string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET childrenNumber = 0 WHERE maritalStatusId != 2 AND maritalStatusId != 4 AND studentGroup = '" + group + "'");
 }
예제 #19
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateStudentMaritalStatusDivorced(string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE Student SET MaritalStatusId = 5 WHERE StudentGroup = '" + group + "' AND Married != 'No' AND MaritalStatusId != 3");
 }
예제 #20
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateCustodyNo(string group)
 {
     DB d1 = new DB();
     d1.Update("Update Student SET custody = 'No' Where studentgroup = '" + group + "' AND maritalStatusId = 4 AND custody IS null");
 }
예제 #21
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateStudentMarriedTo(string name, int id)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET marriedto = '" + name + "' WHERE studentId = " + id + "");
 }
예제 #22
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateMaleCustody(string group, int number)
 {
     DB d1 = new DB();
     d1.Update("Update Student SET custody = 'Yes' WHERE studentId IN " +
                 "(SELECT studentId FROM student WHERE studentGroup = '" + group + "' AND sex = 'Male' AND maritalStatusId = 4 LIMIT " + number + ")");
 }
예제 #23
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void deleteOccupation(int occupationId)
 {
     DB d1 = new DB();
     d1.Delete("DELETE FROM occupation WHERE Id = " + occupationId + "");
 }
예제 #24
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateMaritalStatusDivorcedWithChildren(int studentId, int children, int childsupport)
 {
     DB d1 = new DB();
     d1.Update("UPDATE Student SET MaritalStatusId = 4, ChildrenNumber = " + children + ", ChildSupport = " + childsupport + " WHERE StudentId = " + studentId + "");
 }
예제 #25
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void deleteStudent(int studentId)
 {
     DB d1 = new DB();
     d1.Delete("DELETE FROM student WHERE studentId = " + studentId + "");
 }
예제 #26
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateOccupation(int occupationId, string occupation, int clusterId, int annualGross, int monthlyGross, int marriedAnnualTaxes, int marriedMonthlyTaxes, 
     int marriedAfterTaxes, int singleAnnualTaxes, int singleMonthlyTaxes, int singleAfterTaxes, int studentLoans, double requiredGpa, int requiredEducation)
 {
     DB d1 = new DB();
     d1.Update("UPDATE occupation SET occupation = '" + occupation + "', clusterId = " + clusterId + ", annualGrossSalary = " + annualGross + ", monthlyGrossSalary = " + monthlyGross +
         ", marriedAnnualTaxes = " + marriedAnnualTaxes + ", marriedMonthlyTaxes = " + marriedMonthlyTaxes + ", marriedAfterTaxes = " + marriedAfterTaxes +
         ", singleAnnualTaxes = " + singleAnnualTaxes + ", singleMonthlyTaxes = " + singleMonthlyTaxes + ", singleAfterTaxes = " + singleAfterTaxes + ", studentLoans = " + studentLoans +
         ", requiredGpa = " + requiredGpa + ", requiredEducationLevelId = " + requiredEducation +
         " WHERE Id = " + occupationId + "");
 }
예제 #27
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectClusters()
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT * FROM cluster");
     return dt;
 }
예제 #28
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static void updateSchool(int schoolId, string schoolName)
 {
     DB d1 = new DB();
     d1.Update("UPDATE schools SET schoolName = '" + schoolName + "' WHERE schoolId = " + schoolId + "");
 }
예제 #29
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectDivorcedStudentsWithChildren(string group, int number)
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT * FROM Student WHERE StudentGroup = '" + group + "' AND MaritalStatusId = 5 LIMIT " + number + "");
     return dt;
 }
예제 #30
0
파일: DB.cs 프로젝트: keithsullivan3/CIS
 public static DataTable selectSchools()
 {
     DB d1 = new DB();
     DataTable dt = d1.Select("SELECT * FROM schools ORDER BY schoolName");
     return dt;
 }