/// <summary> /// Конструктор формы редактирования сертификата /// </summary> /// <param name="CertificateToEdit"></param> public CertificateForm(CertificatesListItem CertificateToEdit) { InitializeComponent(); this.isEdit = true; this.CertificateNameTextBox.Text = CertificateToEdit.Name; this.CertificateNumberTextBox.Text = CertificateToEdit.Number; this.BeginDatePicker.Value = CertificateToEdit.Begin; this.EndDatePicker.Value = CertificateToEdit.End; this.CurrentOrganization = CertificateToEdit.Organization; this.ID_Certificate = CertificateToEdit.ID_Certificate; }
private void FillTableWithList(IList <CertificatesListItem> CertificatesList) { this.CertificatesTable.Rows.Clear(); for (int i = 0; i < CertificatesList.Count; i++) { CertificatesListItem CurrentCertificate = CertificatesList[i]; this.CertificatesTable.Rows.Add(); this.CertificatesTable.Rows[i].Cells["ID"].Value = CurrentCertificate.ID_Certificate; this.CertificatesTable.Rows[i].Cells["CertificateName"].Value = CurrentCertificate.Name; this.CertificatesTable.Rows[i].Cells["Number"].Value = CurrentCertificate.Number; this.CertificatesTable.Rows[i].Cells["BeginDate"].Value = CurrentCertificate.Begin.ToShortDateString(); this.CertificatesTable.Rows[i].Cells["EndDate"].Value = CurrentCertificate.End.ToShortDateString(); this.CertificatesTable.Rows[i].Cells["Organization"].Value = CurrentCertificate.Organization; } this.CertificatesCount.Text = "Всего в базе: " + Convert.ToString(CertificatesList.Count); this.CertificatesTable.Sort(this.CertificatesTable.Columns[1], ListSortDirection.Ascending); }
private void SelectBtn_Click(object sender, EventArgs e) { if (isFirstSelection) { this.PrintAllBtn.Enabled = false; this.SelectedCertificatesList.Clear(); this.SelectedCertificates.Visible = true; this.PrintSelectedBtn.Visible = true; this.isFirstSelection = false; this.Width = 977; } CertificatesListItem SelectedCertificate = new CertificatesListItem(); SelectedCertificate.ID_Certificate = Convert.ToInt32(this.CertificatesTable.SelectedRows[0].Cells[0].Value); SelectedCertificate.Name = Convert.ToString(this.CertificatesTable.SelectedRows[0].Cells[1].Value); SelectedCertificate.Number = Convert.ToString(this.CertificatesTable.SelectedRows[0].Cells[2].Value); SelectedCertificate.Begin = Convert.ToDateTime(this.CertificatesTable.SelectedRows[0].Cells[3].Value); SelectedCertificate.End = Convert.ToDateTime(this.CertificatesTable.SelectedRows[0].Cells[4].Value); SelectedCertificate.Organization = Convert.ToString(this.CertificatesTable.SelectedRows[0].Cells[5].Value); this.SelectedCertificatesList.Add(SelectedCertificate); this.SelectedCertificates.Text += SelectedCertificate.Name + "\n----------\n"; }