Пример #1
0
        public void setVivaResult(string mark, string teacherID, string stdID)
        {
            DataClassesLinqDataContext db = new DataClassesLinqDataContext
                                                (DataAccessClassLinq.connectionStringLinq);

            //var max = db.Admission_Exam_Results.OrderByDescending(i => i.Admission_Exam_ID).FirstOrDefault();

            Admission_Exam_Result re = db.Admission_Exam_Results.FirstOrDefault(e => e.Admission_Student_ID.Equals(stdID));

            if (re != null)
            {
                re.Viva_Examiner_ID = teacherID;
                re.Viva_Exam_Mark   = mark;
            }

            db.SubmitChanges();
        }
Пример #2
0
        public void setWrittenResult(string mark, string teacherID, string stdID)
        {
            DataClassesLinqDataContext db = new DataClassesLinqDataContext
                                                (DataAccessClassLinq.connectionStringLinq);

            var max = db.Admission_Exam_Results.OrderByDescending(i => i.Admission_Exam_ID).FirstOrDefault();

            Admission_Exam_Result re = db.Admission_Exam_Results.FirstOrDefault(e => e.Admission_Student_ID.Equals(stdID));

            if (re == null)
            {
                string id = "";
                foreach (char a in max.Admission_Exam_ID)
                {
                    int val = (int)Char.GetNumericValue(a);
                    id = (val + 1).ToString();
                }

                Admission_Exam_Result rs = new Admission_Exam_Result();

                rs.Admission_Exam_ID    = id;
                rs.Written_Examiner_ID  = teacherID;
                rs.Writtern_Exam_Mark   = mark;
                rs.Admission_Student_ID = stdID;
                rs.Viva_Exam_Mark       = "0";
                rs.Viva_Examiner_ID     = "0";
                db.Admission_Exam_Results.InsertOnSubmit(rs);
            }
            else
            {
                re.Writtern_Exam_Mark  = mark;
                re.Written_Examiner_ID = teacherID;
            }

            db.SubmitChanges();
        }