Example #1
0
 public ActionResult CreateMetadata(CreateMetadataViewModel metadata)
 {
     if (ModelState.IsValid)
     {
         var isMetadataAlreadyExist = _metadataDataProvider.IsMetadataWithThisNameAdded(metadata.Name);
         if (isMetadataAlreadyExist)
         {
             ModelState.AddModelError("MetadataAlreadyExist", Resources.MetadataAlreadyExist);
             return(View());
         }
         _metadataService.AddMetadata(FilmViewerMapper.Mapper.Map <MetadataDto>(metadata));
         TempData[UserMessages.UserMessage] = new MessageViewModel()
         {
             CssClass = "alert-success",
             Message  = Resources.MetadataCreatedMessage
         };
         return(RedirectToAction("CreateMetadata"));
     }
     return(View(metadata));
 }
Example #2
0
 public Basic.Framework.Web.BasicResponse <Sys.Safety.DataContract.MetadataInfo> AddMetadata(Sys.Safety.Request.Metadata.MetadataAddRequest metadatarequest)
 {
     return(_service.AddMetadata(metadatarequest));
 }