public DialogAdd(Notebook notes, bool isAdd, int pos = 0) { this.notes = notes; this.isAdd = isAdd; InitializeComponent(); if (isAdd) { Text = "Добавление записи"; } else { Text = "Редактировние записи"; txtBx_surname.Text = notes.GetSurnameByPos(pos); txtBx_name.Text = notes.GetNameByPos(pos); txtBx_phone.Text = notes.GetPhoneByPos(pos); txtBx_birthday.Text = notes.GetDateByPos(pos); } txtBx_surname.Select(); SetIcon(); }
private string MakeText(int idx) { return(notes.GetSurnameByPos(idx) + " " + notes.GetNameByPos(idx) + " " + notes.GetPhoneByPos(idx) + " " + (notes.GetDateByPos(idx) == null || notes.GetDateByPos(idx).Equals("") ? null : notes.GetDateByPos(idx))); }