public bool AddAnswer()
        {
            bool          isInserted = false;
            string        tableName = "Answer";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(this);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("questionId");
            columns.Add("Answer");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }
        public bool AddOutcome()
        {
            bool          isInserted = false;
            string        tableName = "Outcome";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(this);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("SubjectID");
            columns.Add("name");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }
Пример #3
0
        public bool AddAccount()
        {
            bool          isInserted = false;
            string        tableName = "Account";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(this);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("username");
            columns.Add("AccPassword");
            columns.Add("AccPriority");
            columns.Add("isAdmin");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }
        public bool AddQuestion(QuestionModel obj)
        {
            bool          isInserted = false;
            string        tableName = "Question";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(obj);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("OutcomeDetailsID");
            columns.Add("QuestionTypeID");
            columns.Add("Questions");
            columns.Add("QuestionWeight");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }
        public bool AddCourse()
        {
            bool          isInserted = false;
            string        tableName = "Course";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(this);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("code");
            columns.Add("name");
            columns.Add("NQFLevel");
            columns.Add("CourseDescription");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }
        public bool AddSubject()
        {
            bool          isInserted = false;
            string        tableName = "Subjects";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(this);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("name");
            columns.Add("code");
            columns.Add("duration");
            columns.Add("SubjectWeight");
            columns.Add("SubjectDescription");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }
Пример #7
0
        public bool AddLecturerCourseSubject()
        {
            bool          isInserted = false;
            string        tableName = "LecturerCourseSubject";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(this);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("LecturerID");
            columns.Add("CourseSubjectID");
            columns.Add("startDate");
            columns.Add("endDate");
            columns.Add("isFlagged");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }
        public bool AddLecturer()
        {
            bool          isInserted = false;
            string        tableName = "Lecturer";
            List <string> columns = new List <string>(), colValues = ConvertToColumnValues(this);

            DataAccess.DataHandler dh = new DataAccess.DataHandler();

            columns.Add("AccountID");
            columns.Add("name");
            columns.Add("surname");
            columns.Add("cell");
            columns.Add("email");
            columns.Add("LecturerLevel");

            isInserted = dh.Insert(tableName, columns, colValues);
            columns.Clear();
            colValues.Clear();

            return(isInserted);
        }