public void ClearStarter()
        {
            DatabaseCall dbc = new DatabaseCall("Assignments_ClearStarter", DBCallType.Execute);

            dbc.AddParameter("@AssignmentID", _assignmentID);
            dbc.Execute();
        }
Example #2
0
        public void DeleteResource(int resourceID)
        {
            DatabaseCall dbc = new DatabaseCall("Courses_DeleteResource", DBCallType.Execute);

            dbc.AddParameter("@CourseResourceID", resourceID);
            dbc.Execute();
        }
        internal static void Delete(int assignid)
        {
            DatabaseCall dbc = new DatabaseCall("Assignments_Purge", DBCallType.Execute);

            dbc.AddParameter("@AssignmentID", assignid);
            dbc.Execute();
        }
Example #4
0
        private void AddFile(string filename)
        {
            DatabaseCall dbc = new DatabaseCall("StudentAssignments_AddFile", DBCallType.Execute);

            dbc.AddParameter("@UserAssignmentID", _userAssignmentID);
            dbc.AddParameter("@FileName", filename);
            dbc.Execute();
        }
        public static void RemoveFromCourse(int userID, int courseID)
        {
            DatabaseCall dbc = new DatabaseCall("Users_Purge", DBCallType.Execute);

            dbc.AddParameter("@UserID", userID);
            dbc.AddParameter("@CourseID", courseID);
            dbc.Execute();
        }
Example #6
0
        public void AddResource(string name, string resourceValue)
        {
            DatabaseCall dbc = new DatabaseCall("Courses_AddResource", DBCallType.Execute);

            dbc.AddParameter("@CourseID", _courseID);
            dbc.AddParameter("@Name", name);
            dbc.AddParameter("@ResourceValue", resourceValue);
            dbc.Execute();
        }
Example #7
0
        public void ClearSubmissions()
        {
            DatabaseCall dbc = new DatabaseCall("StudentAssignments_ClearSubmissions", DBCallType.Execute);

            dbc.AddParameter("@UserID", _userID);
            dbc.AddParameter("@AssignmentID", _assignmentID);

            dbc.Execute();
        }
Example #8
0
        public static void SetRoleInCourse(int userID, int courseID, int roleID)
        {
            DatabaseCall dbc = new DatabaseCall("Roles_UpdateRoleInCourse", DBCallType.Execute);

            dbc.AddParameter("@UserID", userID);
            dbc.AddParameter("@CourseID", courseID);
            dbc.AddParameter("@RoleID", roleID);
            dbc.Execute();
        }
        private int SaveAssignmentToDatabase(StoredProcType procType)
        {
            int          retID = 0;
            DatabaseCall dbc   = null;

            switch (procType)
            {
            case StoredProcType.New:
                dbc = new DatabaseCall("Assignments_AddNewAssignment", DBCallType.Execute);
                dbc.AddOutputParameter("@AssignmentID");
                dbc.AddOutputParameter("@CourseAssignmentID");
                break;

            case StoredProcType.Update:
                dbc = new DatabaseCall("Assignments_UpdateExistingAssignment", DBCallType.Execute);
                dbc.AddParameter("@AssignmentID", this.AssignmentID);
                break;

            default:
                throw new Exception("Invalid Stored Procedure");
            }

            dbc.AddParameter("@ShortName", this.ShortName);
            dbc.AddNTextParameter("@Description", this.Description);
            dbc.AddParameter("@LastUpdatedDate", this.LastUpdatedDate);
            dbc.AddParameter("@LastUpdatedUserID", this.LastUpdatedUserID);
            dbc.AddParameter("@StarterProjectFlag", this.StarterProjectFlag);
            dbc.AddParameter("@MakeFile", this.MakeFile);
            dbc.AddParameter("@CompilerType", this.CompilerType);
            dbc.AddParameter("@CourseID", this.CourseID);
            dbc.AddParameter("@DueDate", this.DueDate);
            dbc.AddParameter("@MultipleSubmitsFlag", this.MultipleSubmitsFlag);
            dbc.AddParameter("@SendReminders", this.SendReminders);
            dbc.AddParameter("@AutoGradeFlag", this.AutoGradeFlag);
            dbc.AddParameter("@InputFile", this.InputFile);              // set to either DBNull or String Valu);
            dbc.AddParameter("@OutputFile", this.OutputFile);            // set to either DBNull or String Valu);
            dbc.AddParameter("@GradeType", this.GradeType);
            dbc.AddParameter("@AutoCompileFlag", this.AutoCompileFlag);
            dbc.AddParameter("@AssignmentURL", this.AssignmentURL);               // set to either DBNull or String Valu);
            dbc.AddParameter("@CommandLineArgs", this.CommandLineArgs);
            dbc.AddParameter("@SendPastDue", this.SendPastDue);
            dbc.AddParameter("@SendNewProject", this.SendNewProject);
            dbc.AddParameter("@SendUpdatedProject", this.SendUpdatedProject);
            dbc.AddParameter("@PastDueWarningDays", this.PastDueWarningDays);
            dbc.AddParameter("@ReminderWarningDays", this.ReminderWarningDays);

            dbc.Execute();

            if (procType == StoredProcType.New)
            {
                retID = Convert.ToInt32(dbc.GetOutputParam("@AssignmentID"));
                _courseAssignmentID = Convert.ToInt32(dbc.GetOutputParam("@CourseAssignmentID"));
            }

            return(retID);
        }
        public void ImportToCourse(int courseID, string importID)
        {
            DatabaseCall dbc = new DatabaseCall("Users_ImportToCourse", DBCallType.Execute);

            dbc.AddParameter("@UserID", _userID);
            dbc.AddParameter("@CourseID", courseID);
            dbc.AddParameter("@ImportID", importID);

            dbc.Execute();
        }
        internal void AddToCourse(int courseID, PermissionsID roleID)
        {
            DatabaseCall dbc = new DatabaseCall("Users_AddToCourse", DBCallType.Execute);

            dbc.AddParameter("@UserID", _userID);
            dbc.AddParameter("@CourseID", courseID);
            dbc.AddParameter("RoleID", (int)roleID);

            dbc.Execute();
        }
        public void SetPassword(string password, bool hasChanged)
        {
            Byte[] passwd         = SharedSupport.ConvertStringToByteArray(password.Trim());
            byte[] hashValue      = ((HashAlgorithm)CryptoConfig.CreateFromName(Constants.HashMethod)).ComputeHash(passwd);
            string hashedPassword = BitConverter.ToString(hashValue);


            DatabaseCall dbc = new DatabaseCall("Users_ChangePassword", DBCallType.Execute);

            dbc.AddParameter("@UserID", _userID);
            dbc.AddParameter("@Password", hashedPassword);
            dbc.AddParameter("@ChangedPassword", hasChanged);
            dbc.Execute();
        }
Example #13
0
        private void SaveToDatabase(StoredProcType procType)
        {
            DatabaseCall dbc;

            switch (procType)
            {
            case StoredProcType.New:

                dbc = new DatabaseCall("StudentAssignments_AddNewAssignment", DBCallType.Execute);
                dbc.AddOutputParameter("@UserAssignmentID");
                break;

            case StoredProcType.Update:
                dbc = new DatabaseCall("StudentAssignments_UpdateExistingAssignment", DBCallType.Execute);
                break;

            default:
                throw new Exception("Invalid Stored Procedure");
            }

            dbc.AddParameter("@UserID", this._userID);
            dbc.AddParameter("@AssignmentID", this._assignmentID);
            dbc.AddParameter("@LastSubmitDate", this._lastSubmitDate);
            dbc.AddParameter("@LastUpdatedDate", this._lastUpdatedDate);
            dbc.AddParameter("@OverallGrade", this._overallGrade);
            dbc.AddNTextParameter("@GradeComments", this._gradeComments);
            dbc.AddParameter("@AutoCompileStatus", this._autoCompileStatus);
            dbc.AddParameter("@AutoGradeStatus", this._autoGradeStatus);
            dbc.AddNTextParameter("@BuildDetails", this._buildDetails);
            dbc.AddNTextParameter("@CheckDetails", this._checkDetails);
            dbc.AddParameter("@BuildResultCode", this._buildResultCode);
            dbc.AddParameter("@CheckResultCode", this._checkResultCode);

            dbc.Execute();

            if (procType == StoredProcType.New)
            {
                this._userAssignmentID = Convert.ToInt32(dbc.GetOutputParam("@UserAssignmentID"));
            }
        }