/// <summary>
        /// Documents
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public ActionResult Documents(int Id)
        {
            if (!SavePermissionsToViewBag(FeatureEnum.DocumentLibrary))
                return Redirect("~/home/unauthorized");

            DocumentLibraryModel documentLibraryModel = new DocumentLibraryModel();
            documentLibraryModel.DocumentLibraryId = Id;
            if (Request.IsAjaxRequest())
                return PartialView(documentLibraryModel);
            else
                return View(documentLibraryModel);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// GetDocumentLibrary
 /// </summary>
 /// <param name="contentId"></param>
 /// <returns></returns>
 public DocumentLibraryModel GetDocumentLibrary(int contentId)
 {
     DocumentLibraryModel documentLibraryResult = new DocumentLibraryModel();
     ServiceResponse<DocumentLibraryDC> documentLibraryResponse = _contentProxy.Execute(opt => opt.GetDocumentLibrary(contentId));
     if (documentLibraryResponse.Status == ResponseStatus.Success)
     {
         documentLibraryResult = Mapper.Map<DocumentLibraryDC, DocumentLibraryModel>(documentLibraryResponse.Result);
     }
     else
     {
         HandleError(documentLibraryResponse.Status, documentLibraryResponse.ResponseMessage);
     }
     return documentLibraryResult;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// SaveDocumentLibrary
        /// </summary>
        /// <param name="documentLibrary"></param>
        public void SaveDocumentLibrary(DocumentLibraryModel documentLibrary)
        {
            DocumentLibraryDC documentLibraryDC = Mapper.Map<DocumentLibraryModel, DocumentLibraryDC>(documentLibrary);
            ServiceResponse<int> saveDocumentLibraryResponse = _contentProxy.Execute(opt => opt.SaveDocumentLibrary(documentLibraryDC));

            if (saveDocumentLibraryResponse.Status != ResponseStatus.Success)
                HandleError(saveDocumentLibraryResponse.Status, saveDocumentLibraryResponse.ResponseMessage);
            else
                documentLibrary.DocumentLibraryId = saveDocumentLibraryResponse.Result;
        }
 public HttpResponseMessage SaveDocumentLibrary(DocumentLibraryModel documentLibraryModel,int siteId)
 {
     ContentClientProcessor.UserContext.SiteId = siteId;
     ContentClientProcessor.SaveDocumentLibrary(documentLibraryModel);
     return Request.CreateResponse(HttpStatusCode.OK, new { Message = CoreMessages.SavedSuccessfully, Id = documentLibraryModel.DocumentLibraryId });
 }