当前位置: 首页>>代码示例>>C#>>正文


C# Common.GetVolumeLocation方法代码示例

本文整理汇总了C#中Common.GetVolumeLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Common.GetVolumeLocation方法的具体用法?C# Common.GetVolumeLocation怎么用?C# Common.GetVolumeLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Common的用法示例。


在下文中一共展示了Common.GetVolumeLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StartNewDocumentUploadForOrganisation

        /// <summary>
        /// Start New Document Upload for the specific organisation
        /// </summary>
        /// <param name="logonId"></param>
        /// <param name="ModifiedDate"></param>
        /// <param name="Size"></param>
        /// <param name="Hash"></param>
        /// <param name="docSearchItem"></param>
        /// <returns></returns>
        public StartDocumentUploadReturnValue StartNewDocumentUploadForOrganisation(Guid logonId,
            DateTime ModifiedDate, long Size, byte[] Hash, DocumentSearchItem docSearchItem)
        {
            StartDocumentUploadReturnValue ReturnValue = new StartDocumentUploadReturnValue();

            docSearchItem.ProjectId = Guid.Empty;
            docSearchItem.MemberId = Guid.Empty;

            try
            {
                // Get the logged on user from the current logons and add their
                // ApplicationSettings the list of concurrent sessions.
                Host.LoadLoggedOnUser(logonId);

                try
                {
                    Functions.RestrictRekoopIntegrationUser(UserInformation.Instance.DbUid);
                    switch (UserInformation.Instance.UserType)
                    {
                        case DataConstants.UserType.Staff:
                            // Can do everything
                            break;
                        case DataConstants.UserType.Client:
                        case DataConstants.UserType.ThirdParty:
                            if (!ApplicationSettings.Instance.IsUser(DataConstants.DummyGuid, docSearchItem.OrganisationId) || !UserSecuritySettings.GetUserSecuitySettings(274))
                                throw new Exception("Access denied");
                            break;
                        default:
                            throw new Exception("Access denied");
                    }

                    // Check File Type before upload
                    this.CheckFileTypeBeforeUpload(Path.GetFileName(docSearchItem.FileName));

                    DocumentStorageData documentStorageData = Host.GetDocumentStorageData(logonId);

                    #region Load Associate Data to DocumentStorageData

                    documentStorageData.ExitingDocument = false;
                    documentStorageData.DocDetails = docSearchItem;

                    SrvDocument srvDoc = new SrvDocument();
                    // If New document is being uploaded, Get the volume location which will help to upload document on documentuploadcomplete
                    srvDoc.ApplicationId = (int)DataConstants.Application.PMS;
                    srvDoc.FileName = docSearchItem.FileName;
                    srvDoc.DocumentModuleId = docSearchItem.OrganisationId;
                    srvDoc.Type = DmEnums.DmPMSDocType.Org;

                    bool isVoumeCreated = false;
                    Common commonFunction = new Common();
                    isVoumeCreated = commonFunction.GetVolumeLocation(ref srvDoc);

                    if (!isVoumeCreated)
                    {
                        throw new Exception("Upload document failed on the server.");
                    }
                    else
                    {
                        documentStorageData.VolumeLocation = srvDoc.VolumeLocation;
                        documentStorageData.VolumeId = srvDoc.VolumeId;
                        documentStorageData.FileName = srvDoc.FileName;
                    }

                    #endregion

                    ReturnValue.MaxChunkSize = Host.FileTransferChunkSize;

                    ReturnValue.TransferId = FileTransfer.StartFileUpload(logonId, Path.GetFileName(docSearchItem.FileName), ModifiedDate, Size, Hash, documentStorageData);
                }
                finally
                {
                    // Remove the logged on user's ApplicationSettings from the
                    // list of concurrent sessions
                    Host.UnloadLoggedOnUser();
                }
            }
            catch (System.Data.SqlClient.SqlException)
            {
                ReturnValue.Success = false;
                ReturnValue.Message = Functions.SQLErrorMessage;
            }
            catch (Exception ex)
            {
                ReturnValue.Success = false;
                ReturnValue.Message = ex.Message;
            }

            return ReturnValue;
        }
开发者ID:advanced-joelloyd,项目名称:UghWebforms,代码行数:98,代码来源:DocumentService.svc.cs


注:本文中的Common.GetVolumeLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。