|
|
@ -74,13 +74,19 @@ public class Ghre_CourseWareServices : BaseServices<Ghre_CourseWare, Ghre_Course |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await _ghre_CourseWareAttachmentServices.Delete(x => x.CourseWareId == Id); |
|
|
|
await _ghre_CourseWareAttachmentServices.Delete(x => x.CourseWareId == Id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (editModel.Source == "Attachments") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
editModel.Attachments.ForEach(x => |
|
|
|
editModel.Attachments.ForEach(x => |
|
|
|
{ |
|
|
|
{ |
|
|
|
x.CourseWareId = Id; |
|
|
|
x.CourseWareId = Id; |
|
|
|
x.RelativePath = x.RelativePath.Replace("/Advanced", null); |
|
|
|
x.RelativePath = x.RelativePath.Replace("/Advanced", null); |
|
|
|
}); |
|
|
|
}); |
|
|
|
await _ghre_CourseWareAttachmentServices.Add(editModel.Attachments); |
|
|
|
await _ghre_CourseWareAttachmentServices.Add(editModel.Attachments); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
if (editModel.Links != null && editModel.Links.Any()) |
|
|
|
if (editModel.Links != null && editModel.Links.Any()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var attachments = editModel.Links.Select(x => new InsertGhre_CourseWareAttachmentInput() |
|
|
|
var attachments = editModel.Links.Select(x => new InsertGhre_CourseWareAttachmentInput() |
|
|
@ -92,6 +98,7 @@ public class Ghre_CourseWareServices : BaseServices<Ghre_CourseWare, Ghre_Course |
|
|
|
}).ToList(); |
|
|
|
}).ToList(); |
|
|
|
await _ghre_CourseWareAttachmentServices.Add(attachments); |
|
|
|
await _ghre_CourseWareAttachmentServices.Add(attachments); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return await base.Update(Id, editModel); |
|
|
|
return await base.Update(Id, editModel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|