public static ejpAssignment CreateEmpty(string title, ejpStudent ownerUser, bool isManagedByEJournalServer, string tempFilePath) { try { //SiliconStudio.DebugManagers.DebugReporter.Report( // SiliconStudio.DebugManagers.MessageType.Information, // "EjpLib - ejpAssignment", // "Creating Empty Assignment" + // "\nTitle: " + title + // "\nTemp File Path: " + tempFilePath); //TODO: Improve. ejpAssignment a = new ejpAssignment(Helpers.IdManipulation.GetNewGuid(), title, isManagedByEJournalServer, ownerUser.Id); AssignmentOperations.LocalAssignmentFileOperations.SaveTemporaryAssignment(a, tempFilePath); a.Dispose(); ejpAssignment b = AssignmentOperations.LocalAssignmentFileOperations.ImportAssignment(tempFilePath, true); b.tempFilePath = tempFilePath; b.FilePackagePath = ""; return(b); } catch (Exception ex) { //SiliconStudio.DebugManagers.DebugReporter.Report( // SiliconStudio.DebugManagers.MessageType.Error, // "EjpLib - ejpAssignment", // "Creating Empty Assignment Failed" + // "\nTitle: " + title + // "\nTemp File Path: " + tempFilePath + // "\nError :" + ex.Message); System.Diagnostics.Debug.WriteLine(ex.Message); return(null); } }
public static ejpAssignment CreateEmpty(string title, ejpStudent ownerUser, bool isManagedByEJournalServer, string tempFilePath) { try { //TODO: Improve. ejpAssignment a = new ejpAssignment(Helpers.IdManipulation.GetNewGuid(), title, isManagedByEJournalServer, ownerUser.Id); AssignmentOperations.LocalAssignmentFileOperations.SaveTemporaryAssignment(a, tempFilePath); a.Dispose(); ejpAssignment b = AssignmentOperations.LocalAssignmentFileOperations.ImportAssignment(tempFilePath, true); b.tempFilePath = tempFilePath; b.FilePackagePath = ""; return(b); } catch (Exception) { return(null); } }