public void Reload() { DBSummonNotes DBSN = new DBSummonNotes(); dgNote.DataSource = DBSN.GetAllNotesByIDSummon(ID); if (dgNote.RowCount >= 1) { dgNote.FirstDisplayedScrollingRowIndex = dgNote.RowCount - 1; } }
private void button2_Click(object sender, EventArgs e) { if (textBox1.Text.Length > 750) { MessageBox.Show("Вы превысили ограничение в 750 знаков для одного примечания! (" + textBox1.Text.Length + ")"); return; } result = true; DBSummonNotes dbsn = new DBSummonNotes(); dbsn.AddNote(id, textBox1.Text, idu); //MessageBox.Show("Сохранено успешно!"); Close(); }
private void SummonNotes_Load(object sender, EventArgs e) { DBSummonNotes DBSN = new DBSummonNotes(); dgNote.DataSource = DBSN.GetAllNotesByIDSummon(ID); dgNote.Columns["ID"].Visible = false; dgNote.Columns["IDSUMMON"].Visible = false; dgNote.Columns["CREATED"].HeaderText = "Дата"; dgNote.Columns["CREATED"].Width = 70; dgNote.Columns["CREATED"].DefaultCellStyle.Format = "dd.MM.yyyy HH:mm"; dgNote.Columns["ROLENAME"].HeaderText = "Отдел"; dgNote.Columns["ROLENAME"].Width = 80; dgNote.Columns["FIO"].HeaderText = "ФИО"; dgNote.Columns["FIO"].Width = 90; dgNote.Columns["NOTE"].HeaderText = "Примечание"; dgNote.Columns["NOTE"].Width = 260; }
private void button2_Click(object sender, EventArgs e) { /*SVO.NOTE = textBox1.Text; * dbs.SaveSummon(SVO); * notetext = textBox1.Text;*/ if (textBox1.Text == "") { MessageBox.Show("Введите текст!"); return; } DBSummonNotes dbsn = new DBSummonNotes(); dbsn.UpdateNote(idnote, textBox1.Text); result = true; MessageBox.Show("Сохранено успешно!"); Close(); }