Esempio n. 1
0
 public Boolean UpdateDocumentsDataForUser(Int64 fileId, String fileName, String userName, String metaTags, String companyInfo
                                           , String categoryType, String comment, Byte[] overwriteStream)
 {
     try
     {
         ICPresentationEntities entity = new ICPresentationEntities();
         if (overwriteStream == null)
         {
             entity.UpdateDocumentsData(fileId, userName, metaTags, companyInfo, categoryType, comment);
         }
         else
         {
             FileMaster fileMaster = entity.FileMasters.Where(record => record.FileID == fileId).FirstOrDefault();
             if (fileMaster != null)
             {
                 String uploadUrl = UploadDocument(fileName, overwriteStream, fileMaster.Location);
                 Int32? result    = entity.SetUploadFileInfo(userName, fileName, uploadUrl, companyInfo, null, null
                                                             , categoryType, metaTags, comment).FirstOrDefault();
                 if (result == 0)
                 {
                     entity.DeleteFileMaster(fileMaster.FileID);
                 }
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         ExceptionTrace.LogException(ex);
         string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
         throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
     }
 }
Esempio n. 2
0
 public bool DeleteFileMasterRecord(Int64 fileId)
 {
     try
     {
         ICPresentationEntities entity = new ICPresentationEntities();
         entity.DeleteFileMaster(fileId);
         return(true);
     }
     catch (Exception ex)
     {
         ExceptionTrace.LogException(ex);
         string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
         throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
     }
 }