public PrintProcessFlowCommand(IAggregateLogger aggregateLogger, CoverLetterService coverLetterService, IFACertificateService ifaCertificateService, ICertificatesRepository certificatesRepository, NotificationService notificationService) { _aggregateLogger = aggregateLogger; _coverLetterService = coverLetterService; _ifaCertificateService = ifaCertificateService; _certificatesRepository = certificatesRepository; _notificationService = notificationService; }
/// <summary> /// 更新介绍信列表 /// </summary> private void RefreshDgvCoverletterData() { coverletterservice = new CoverLetterService(); coverletterList = coverletterservice.GetCoverLetterListByResume(resume); try { dgvCoverLetterList.AutoGenerateColumns = false; dgvCoverLetterList.DataSource = coverletterList; number.Text = (10 - dgvCoverLetterList.Rows.Count).ToString(); } catch(Exception e) { MessageBox.Show("获取信息失败" + e.Message);throw new NotImplementedException(); } }
/// <summary> /// 操作数据列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvCoverLetterList_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) return; if (dgvCoverLetterList.Columns[e.ColumnIndex].Name == "Modify") { List<CoverLetter> clList = dgvCoverLetterList.DataSource as List<CoverLetter>; coverletter = clList[e.RowIndex]; FormCoverLetterAdd fclAdd = new FormCoverLetterAdd(); fclAdd.setCoverLetter = coverletter; fclAdd.Text = "修改求职信..."; //this.flagCreating = true; fclAdd.ShowDialog(); } if (dgvCoverLetterList.Columns[e.ColumnIndex].Name == "Delete") { List<CoverLetter> temp =dgvCoverLetterList.DataSource as List<CoverLetter>; CoverLetter cl = GetCoverLetterFromDgv(e.RowIndex); DialogResult result = MessageBox.Show("确定要删除该项?删除后不可恢复", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { coverletterservice = new CoverLetterService(); try { coverletterservice.Delete(cl); } catch (Exception ex) { MessageBox.Show("删除记录出错" + ex.Message); } dgvCoverLetterList.DataSource = null; temp.Remove(cl); dgvCoverLetterList.DataSource = temp; } } }