Beispiel #1
0
        private void FileHandleCallBack(FileActivity activity, OperateResult <ResumeResult> result)
        {
            _currentFile = activity.FilePath;

            PrintProcessInfo();

            UpdateUI(() =>
            {
                Notice("解析完成->" + _currentFile);

                if (result.Status == OperateStatus.Failure)
                {
                    Alert(result.Description);
                    if (result.Data != null)
                    {
                        txtTxt.Text = result.Data.Text;
                    }
                }
                else
                {
                    txtTxt.Text    = result.Data.Text;
                    txtResult.Text = Serialize(result.Data.ResumeInfo);
                }
            });
        }
Beispiel #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:FileActivityEventArgs" /> class.
 /// </summary>
 /// <param name="file">The file that changed, if any (full path).</param>
 /// <param name="oldFileName">The old name of the file, if any (full path).</param>
 /// <param name="directory">The directory that changed, if any (full path).</param>
 /// <param name="oldDirectoryName">The old name of the directory, if any (full path).</param>
 /// <param name="page">The page owning the attachment, if any.</param>
 /// <param name="activity">The activity.</param>
 public FileActivityEventArgs(StFileInfo file, string oldFileName,
                              StDirectoryInfo directory, string oldDirectoryName,
                              PageInfo page, FileActivity activity)
 {
     File             = file;
     OldFileName      = oldFileName;
     Directory        = directory;
     OldDirectoryName = oldDirectoryName;
     Page             = page;
     Activity         = activity;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:FileActivityEventArgs" /> class.
 /// </summary>
 /// <param name="file">The file that changed, if any (full path).</param>
 /// <param name="oldFileName">The old name of the file, if any (full path).</param>
 /// <param name="directory">The directory that changed, if any (full path).</param>
 /// <param name="oldDirectoryName">The old name of the directory, if any (full path).</param>
 /// <param name="page">The page owning the attachment, if any.</param>
 /// <param name="activity">The activity.</param>
 public FileActivityEventArgs(StFileInfo file, string oldFileName,
                              StDirectoryInfo directory, string oldDirectoryName,
                              PageInfo page, FileActivity activity)
 {
     this.file             = file;
     this.oldFileName      = oldFileName;
     this.directory        = directory;
     this.oldDirectoryName = oldDirectoryName;
     this.page             = page;
     this.activity         = activity;
 }
Beispiel #4
0
 public int UpdateFileActivityWithProjectData(FileActivity item)
 {
     using (var cmd = new SqlCommand("DevTrkr..UpdateFileActivityWithProjectData"))
     {
         cmd.Parameters.AddWithValue("@DevProjName", item.DevProjName);
         cmd.Parameters.AddWithValue("@DevProjectPath", item.DevProjectPath);
         cmd.Parameters.AddWithValue("@Machine", item.Machine);
         cmd.Parameters.AddWithValue("@UserName", item.Username);
         return(UpdateDatabase(cmd));
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:FileActivityEventArgs" /> class.
 /// </summary>
 /// <param name="file">The file that changed, if any (full path).</param>
 /// <param name="oldFileName">The old name of the file, if any (full path).</param>
 /// <param name="directory">The directory that changed, if any (full path).</param>
 /// <param name="oldDirectoryName">The old name of the directory, if any (full path).</param>
 /// <param name="page">The page owning the attachment, if any.</param>
 /// <param name="activity">The activity.</param>
 public FileActivityEventArgs(StFileInfo file, string oldFileName,
     StDirectoryInfo directory, string oldDirectoryName,
     PageInfo page, FileActivity activity)
 {
     this.file = file;
     this.oldFileName = oldFileName;
     this.directory = directory;
     this.oldDirectoryName = oldDirectoryName;
     this.page = page;
     this.activity = activity;
 }
Beispiel #6
0
 public bool Save(FileActivity activity, ResumeResult data)
 {
     try
     {
         _Save(activity, data);
         return(true);
     }
     catch (Exception ex)
     {
         LoggerWrapper.Logger.Error("简历数据存储异常", ex);
         return(false);
     }
 }
Beispiel #7
0
        protected override void _Save(FileActivity activity, ResumeResult data)
        {
            if (activity.IsChanged)
            {
                _conn.ExecuteScalar(string.Format("delete from resumelist where guid='{0}';delete from resumedetaillist where guid='{0}';", activity.HashCode));
            }

            DateTime dateTime = DateTime.Now;

            ResumeData resumeData = data.ResumeInfo;

            //记录简历信息
            _conn.ExecuteNonQuery(string.Format(InsertResumeSql, activity.HashCode, resumeData.Name, resumeData.Age, resumeData.Gender, resumeData.Phone, resumeData.Email, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.LatestDegree, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.Residence, activity.FilePath, "本地计算机", resumeData.WorkYears, dateTime.ToString(DateFormat), dateTime.ToUniversalTime(), Dorado.SystemInfo.SystemInfo.GetMacAddress(), data.Text));
        }
Beispiel #8
0
        private void FileEnqueueCallBack(FileActivity activity)
        {
            lblEnqueueStatus.Text = "扫描文件->" + activity.FilePath;

            PrintProcessInfo();

            UpdateUI(() =>
            {
                if (activity.IsChanged)
                {
                    Alert(string.Format("文件发生变化->{0}", activity.FilePath));
                }
                if (!activity.IsValid)
                {
                    Alert(string.Format("文件无效->{0} {1}", activity.Message, activity.FilePath));
                }
            });
        }
Beispiel #9
0
 public int InsertUpdateFileActivity(FileActivity item)
 {
     using (var cmd = new SqlCommand("DevTrkr..InsertUpdateFileActivity"))
     {
         cmd.Parameters.AddWithValue("@Machine", item.Machine);
         cmd.Parameters.AddWithValue("@DevProjName", item.DevProjName);
         cmd.Parameters.AddWithValue("@Filename", item.Filename);
         cmd.Parameters.AddWithValue("@Username", item.Username);
         cmd.Parameters.AddWithValue("@FileLength", item.FileLength);
         cmd.Parameters.AddWithValue("@LastAction", item.LastAction);
         cmd.Parameters.AddWithValue("@CreatedBy", item.CreatedBy);
         cmd.Parameters.AddWithValue("@UpdatedBy", item.UpdatedBy);
         cmd.Parameters.AddWithValue("@UpdateCount", item.UpdateCount);
         cmd.Parameters.AddWithValue("@DevProjectPath", item.DevProjectPath);
         cmd.Parameters.AddWithValue("@CodeLines", item.CodeLines);
         cmd.Parameters.AddWithValue("@BlankLines", item.BlankLines);
         cmd.Parameters.AddWithValue("@CommentLines", item.CommentLines);
         cmd.Parameters.AddWithValue("@DesignerLines", item.DesignerLines);
         return(UpdateDatabase(cmd));
     }
 }
Beispiel #10
0
        /// <summary>
        /// Fires the FileActivity event.
        /// </summary>
        /// <param name="provider">The provider that handles the attachment.</param>
        /// <param name="attachment">The old name of the renamed attachment, if any.</param>
        /// <param name="page">The page that owns the attachment.</param>
        /// <param name="oldAttachmentName">The old name of the renamed attachment, if any.</param>
        /// <param name="activity">The activity.</param>
        public void OnAttachmentActivity(string provider, string attachment, string page, string oldAttachmentName, FileActivity activity)
        {
            if(FileActivity != null) {
                IFilesStorageProviderV30 prov = Collectors.FilesProviderCollector.GetProvider(provider);
                PageInfo pageInfo = Pages.FindPage(page);

                FileActivity(this, new FileActivityEventArgs(
                    new StFileInfo(prov.GetPageAttachmentDetails(pageInfo, attachment), attachment, prov), oldAttachmentName, null, null, pageInfo, activity));
            }
        }
Beispiel #11
0
 protected override void _Save(FileActivity activity, ResumeResult data)
 {
     throw new NotImplementedException();
 }
 public void OnFileActivity(string provider, string file, string oldFileName, FileActivity activity)
 {
     throw new NotImplementedException();
 }
 public void OnDirectoryActivity(string provider, string directory, string oldDirectoryName, FileActivity activity)
 {
     throw new NotImplementedException();
 }
Beispiel #14
0
 protected abstract void _Save(FileActivity activity, ResumeResult data);
Beispiel #15
0
        /// <summary>
        /// Fires the FileActivity event.
        /// </summary>
        /// <param name="provider">The provider that handles the directory.</param>
        /// <param name="directory">The directory that changed.</param>
        /// <param name="oldDirectoryName">The old name of the renamed directory, if any.</param>
        /// <param name="activity">The activity.</param>
        public void OnDirectoryActivity(string provider, string directory, string oldDirectoryName, FileActivity activity)
        {
            if(FileActivity != null) {
                IFilesStorageProviderV30 prov = Collectors.FilesProviderCollector.GetProvider(provider);

                FileActivity(this, new FileActivityEventArgs(
                    null, null, new StDirectoryInfo(directory, prov), oldDirectoryName, null, activity));
            }
        }
Beispiel #16
0
        /// <summary>
        /// Fires the FileActivity event.
        /// </summary>
        /// <param name="provider">The provider that handles the file.</param>
        /// <param name="file">The name of the file that changed.</param>
        /// <param name="oldFileName">The old name of the renamed file, if any.</param>
        /// <param name="activity">The activity.</param>
        public void OnFileActivity(string provider, string file, string oldFileName, FileActivity activity)
        {
            if(FileActivity != null) {
                IFilesStorageProviderV30 prov = Collectors.FilesProviderCollector.GetProvider(provider);

                FileActivity(this, new FileActivityEventArgs(
                    new StFileInfo(prov.GetFileDetails(file), file, prov), oldFileName, null, null, null, activity));
            }
        }
 public void OnAttachmentActivity(string provider, string attachment, string page, string oldAttachmentName, FileActivity activity)
 {
     throw new NotImplementedException();
 }