示例#1
0
    private void RequestFileSync()
    {
        if (IsRemote())
        {
            string DataType = GetAttachmentType(Request.QueryString["DataType"]);
            if (DataType == "Library")
            {
                var fileId = Request.QueryString["fileId"];
                //set status
                var libraryDoc = EntityFactory.GetById <ILibraryDocs>(fileId);
                if ((libraryDoc.Status != null) && ((libraryDoc.Status == LibraryDocsStatus.Ordered) || (libraryDoc.Status == LibraryDocsStatus.RevisionOrdered)))
                {
                    WriteFileSyncRequested();
                    return;
                }
                if ((libraryDoc.Status == null) || (libraryDoc.Status == LibraryDocsStatus.Available))
                {
                    libraryDoc.Status = LibraryDocsStatus.Ordered;
                    libraryDoc.Save();
                }
                else if (libraryDoc.Status == LibraryDocsStatus.Revised)
                {
                    libraryDoc.Status = LibraryDocsStatus.RevisionOrdered;
                    libraryDoc.Save();
                }
                //log sync request...
                var synclogger = new FileSyncRequest();
                synclogger.LogLibraryFileRequest(fileId);

                WriteFileSyncRequested();
                return;
            }
        }
        WriteErrorMessage(string.Empty);
    }
示例#2
0
 private void RequestFileSync()
 {
     if (IsRemote())
     {
         string DataType = GetAttachmentType(Request.QueryString["DataType"]);
         var    fileId   = Request.QueryString["fileId"];
         if (DataType == "Library")
         {
             //set status
             var libraryDoc = EntityFactory.GetById <ILibraryDocs>(fileId);
             if ((libraryDoc.Status != null) && ((libraryDoc.Status == LibraryDocsStatus.Ordered) || (libraryDoc.Status == LibraryDocsStatus.RevisionOrdered)))
             {
                 WriteFileSyncRequested();
                 return;
             }
             if ((libraryDoc.Status == null) || (libraryDoc.Status == LibraryDocsStatus.Available))
             {
                 libraryDoc.Status = LibraryDocsStatus.Ordered;
                 libraryDoc.Save();
             }
             else if (libraryDoc.Status == LibraryDocsStatus.Revised)
             {
                 libraryDoc.Status = LibraryDocsStatus.RevisionOrdered;
                 libraryDoc.Save();
             }
             //log sync request...
             FileSyncRequest.LogLibraryFileRequest(fileId);
             WriteFileSyncRequested();
             return;
         }
         if (DataType == "Attachment")
         {
             var attachment = EntityFactory.GetById <IAttachment>(fileId);
             if (attachment != null)
             {
                 bool result;
                 Sage.SalesLogix.Attachment.Rules.RequestAttachment(attachment, out result);
                 WriteFileSyncRequested();
             }
         }
     }
     WriteErrorMessage(string.Empty);
 }
示例#3
0
    private void RequestFileSync()
    {
        if (IsRemote())
        {
            string DataType = GetAttachmentType(Request.QueryString["DataType"]);
            if (DataType == "Library")
            {
                var fileId = Request.QueryString["fileId"];
                //set status
                var libraryDoc = EntityFactory.GetById<ILibraryDocs>(fileId);
                if ((libraryDoc.Status != null) && ((libraryDoc.Status == LibraryDocsStatus.Ordered) || (libraryDoc.Status == LibraryDocsStatus.RevisionOrdered)))
                {
                    WriteFileSyncRequested();
                    return;
                }
                if ((libraryDoc.Status == null) || (libraryDoc.Status == LibraryDocsStatus.Available))
                {
                    libraryDoc.Status = LibraryDocsStatus.Ordered;
                    libraryDoc.Save();
                }
                else if (libraryDoc.Status == LibraryDocsStatus.Revised)
                {
                    libraryDoc.Status = LibraryDocsStatus.RevisionOrdered;
                    libraryDoc.Save();
                }
                //log sync request...
                var synclogger = new FileSyncRequest();
                synclogger.LogLibraryFileRequest(fileId);

                WriteFileSyncRequested();
                return;
            }
        }
        WriteErrorMessage(string.Empty);
    }