/// <summary> /// The actual Work to be done. /// </summary> protected override void Execute() { collection collection = null; switch (Request.WellKnownModificationType) { case Core.Enums.WellKnownModificationType.Add: collection = Util.ConvertToCollection(Request.CollectionModel); CollectionRepository.Add(collection); CollectionRepository.Save(); SubseryRepository.Add(new subsery() { CollectionId = collection.Id, SubseriesName = "N/A" }); SubseryRepository.Save(); break; case Core.Enums.WellKnownModificationType.Edit: collection = CollectionRepository.GetCollecrtionToEdit(Request.CollectionModel.Id); collection = Util.ConvertToCollection(collection, Request.CollectionModel); CollectionRepository.Edit(collection); CollectionRepository.Save(); break; default: break; } Response = new ResponseModel() { IsOperationSuccess = true }; }
/// <summary> /// The actual Work to be done. /// </summary> protected override void Execute() { subsery subsery = null; switch (Request.WellKnownModificationType) { case Core.Enums.WellKnownModificationType.Add: subsery = Util.ConvertToSubsery(Request.SubseryModel); SubseryRepository.Add(subsery); SubseryRepository.Save(); break; case Core.Enums.WellKnownModificationType.Edit: subsery = SubseryRepository.GetSubseriesToEdit(Request.SubseryModel.Id); subsery.CollectionId = Request.SubseryModel.CollectionId; subsery = Util.ConvertToSubsery(subsery, Request.SubseryModel); SubseryRepository.Edit(subsery); SubseryRepository.Save(); break; default: break; } Response = new ResponseModel() { IsOperationSuccess = true }; }