Пример #1
0
 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 + ")");
 }
Пример #2
0
 public static void updateStudentMarriedTo(string name, int id)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET marriedto = '" + name + "' WHERE studentId = " + id + "");
 }
Пример #3
0
 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 + ")");
 }
Пример #4
0
 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");
 }
Пример #5
0
 public static void updateSchool(int schoolId, string schoolName)
 {
     DB d1 = new DB();
     d1.Update("UPDATE schools SET schoolName = '" + schoolName + "' WHERE schoolId = " + schoolId + "");
 }
Пример #6
0
 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 + "");
 }
Пример #7
0
 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 + "");
 }
Пример #8
0
 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 + "");
 }
Пример #9
0
 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");
 }
Пример #10
0
 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 + ")");
 }
Пример #11
0
 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 + "'");
 }
Пример #12
0
 public static void updateChildrenNumber(int id, int children)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET childrenNumber = " + children + ", maritalStatusId = 2 WHERE StudentId = " + id + "");
 }
Пример #13
0
 public static void setNonCustodyCheckbook(string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET checkbook = netmonthlyincome - childsupport WHERE studentgroup = '" + group + "' AND Custody = 'No'");
 }
Пример #14
0
 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 + "'");
 }
Пример #15
0
 public static void setChildSupportToZero(string group)
 {
     DB d1 = new DB();
     d1.Update("UPDATE student SET childsupport = 0 WHERE studentgroup = '" + group + "'");
 }