Esempio n. 1
0
        public JsonResult CreateDocument(AssociateDocumentModel doc)
        {
            try
            {
                string userName = this.MembershipService.GetCurrentUserName();
                if (doc.DocumentId != null && doc.DocumentId != Guid.Empty)
                {
                    return UpdateDocumentMain(doc, userName);
                }
                else
                {

                    this.documentService.CreateDocument(doc, userName);
                }
                return this.Json(true);
            }
            catch (Exception)
            {
                return this.Json("There was an error adding the document.");
            }
            return this.Json(false);
        }
Esempio n. 2
0
 public JsonResult UpdateDocumentMain(AssociateDocumentModel doc, string userName)
 {
     try
     {
         this.documentService.UpdateDocumentMain(doc, userName);
         return this.Json(true);
     }
     catch
     {
         return this.Json(false);
     }
 }