예제 #1
0
파일: LINQ.cs 프로젝트: Beraliv/Csharp
        public void Add(StudentElem stud, SubjectElem subj, ASSESSMENT assessment)
        {
            StudentElem stud_temp = _Student.Find(stud.FIO);
            SubjectElem subj_temp = _Subject.Find(subj.Name);
            bool stud_null = (stud_temp == null);
            bool subj_null = (subj_temp == null);

            if (stud_null && subj_null)
            {
                stud.Add(subj, assessment);
                _Student.Add(stud);
                _Subject.Add(subj);
            }
            else if (!stud_null && subj_null)
            {
                stud_temp.Add(subj, assessment);
                _Subject.Add(subj);
            }
            else if (stud_null && !subj_null)
            {
                stud.Add(subj_temp, assessment);
                _Student.Add(stud);
            }
            else if (!stud_null && !subj_null)
                stud_temp.Add(subj_temp, assessment);
        }
예제 #2
0
 public bool AddOrUpdate(int score, string cmt, string id_submit)
 {
     try
     {
         ASSESSMENT ass = new ASSESSMENT {
             SUBMIT_ID = id_submit, SCORE = score, COMMENT = cmt
         };
         db.ASSESSMENTs.AddOrUpdate(ass);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #3
0
파일: LINQ.cs 프로젝트: Beraliv/Csharp
 public SubjectElem(SubjectElem subj, ASSESSMENT assessment)
 {
     Name = subj.Name;
     Year = subj.Year;
     Semester = subj.Semester;
     Credit = subj.Credit;
     Lecturer = subj.Lecturer;
     Assessment = assessment;
 }
예제 #4
0
파일: LINQ.cs 프로젝트: Beraliv/Csharp
 public void Add(SubjectElem subj, ASSESSMENT assessment)
 {
     Subject[count] = new SubjectElem(subj, assessment);
     count++;
     if (count == max_count)
     {
         int length = Subject.Length;
         SubjectElem [] temp = Subject;
         max_count += 10;
         Subject = new SubjectElem[max_count];
         for (int i = 0; i < length; i++)
             Subject[i] = temp[i];
     }
 }