예제 #1
0
 public WcfFileUploader(UserFile file)
 {
     _file = file;
     if (file.FileStream != null) //删除时用
         _dataLength = file.FileStream.Length;
     Init_event();
 }
예제 #2
0
 public WcfFileUploader(UserFile file, T_SYS_FILEUPLOAD FileUpload)
 {
     _file       = file;
     _fileupload = FileUpload;
     _dataLength = _file.FileStream.Length;
     Init_event();
     _client.AddCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_client_AddCompleted);
 }
예제 #3
0
 public WcfFileUploader(UserFile file, T_SYS_FILEUPLOAD FileUpload)
 {
     _file = file;
     _fileupload = FileUpload;
     _dataLength = _file.FileStream.Length;
     Init_event();
     _client.AddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(_client_AddCompleted);
 }
예제 #4
0
 public WcfFileUploader(UserFile file)
 {
     _file = file;
     if (file.FileStream != null) //删除时用
     {
         _dataLength = file.FileStream.Length;
     }
     Init_event();
 }
예제 #5
0
        /// <summary>
        /// 上传附件之前,初始化 将要上传的 文件信息
        /// </summary>
        /// <param name="name"></param>
        /// <param name="strm"></param>
        /// <param name="folderKey"></param>
        /// <param name="childFolder">最底层的文件夹,可以是模块名</param>
        public void InitFiles(string name, FileStream strm)
        {
            UserFile userFile = new UserFile();

            userFile.FileName   = name;
            userFile.FileStream = strm;
            string compName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;

            userFile.FileName_Path = compName + "\\" + SystemName + "\\" + ModelName + "\\" + name;
            //向文件列表中添加文件信息
            _files.Add(userFile);
        }
예제 #6
0
        /// <summary>
        ///  移除单个上传文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonDelete_Click(object sender, RoutedEventArgs e)
        {
            UserFile file = (UserFile)((Button)e.OriginalSource).DataContext;

            if (file.State == Constants.FileStates.Pending)
            {
                file.State = Constants.FileStates.Remove;
            }
            else
            {
                // 逻辑删除 true 表示是 btnupload隐藏
                file.State = Constants.FileStates.Deleteing;
            }
        }
예제 #7
0
        private void Init_Data(UserFile file, T_SYS_FILEUPLOAD info)
        {
            UserPost PostInfo = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0];

            info.COMPANYID          = PostInfo.CompanyID;
            info.CREATEDATE         = DateTime.Now;
            info.CREATEDEPARTMENTID = PostInfo.DepartmentID;
            info.CREATEPOSTID       = PostInfo.PostID;
            info.CREATEUSERID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            info.CREATEUSERNAME    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
            info.FILENAME          = file.FileName_Path;
            info.FILEUPLOADID      = file.ID;
            info.CREATECOMPANYID   = PostInfo.CompanyID;
            info.FORMID            = FormID;
            info.MODELNAME         = ModelName;
            info.OWNERCOMPANYID    = PostInfo.CompanyID;
            info.OWNERDEPARTMENTID = PostInfo.DepartmentID;
            info.OWNERID           = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            info.OWNERNAME         = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
            info.OWNERPOSTID       = PostInfo.PostID;
            info.SYSTEMCODE        = _systemName;
        }
예제 #8
0
        private void Init_Data(UserFile file, T_SYS_FILEUPLOAD info)
        {
            UserPost PostInfo = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0];

            info.COMPANYID = PostInfo.CompanyID;
            info.CREATEDATE = DateTime.Now;
            info.CREATEDEPARTMENTID = PostInfo.DepartmentID;
            info.CREATEPOSTID = PostInfo.PostID;
            info.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

            info.CREATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
            info.FILENAME = file.FileName_Path;
            info.FILEUPLOADID = file.ID;
            info.CREATECOMPANYID = PostInfo.CompanyID;
            info.FORMID = FormID;
            info.MODELNAME = ModelName;
            info.OWNERCOMPANYID = PostInfo.CompanyID;
            info.OWNERDEPARTMENTID = PostInfo.DepartmentID;
            info.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            info.OWNERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
            info.OWNERPOSTID = PostInfo.PostID;
            info.SYSTEMCODE = _systemName;
        }
예제 #9
0
        /// <summary>
        /// 上传附件之前,初始化 将要上传的 文件信息
        /// </summary>
        /// <param name="name"></param>
        /// <param name="strm"></param>
        /// <param name="folderKey"></param>
        /// <param name="childFolder">最底层的文件夹,可以是模块名</param>
        public void InitFiles(string name, FileStream strm)
        {
            UserFile userFile = new UserFile();
            userFile.FileName = name;
            userFile.FileStream = strm;
            string compName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;

            userFile.FileName_Path = compName + "\\" + SystemName + "\\" + ModelName + "\\" + name;
            //向文件列表中添加文件信息
            _files.Add(userFile);
            
        }