private void PlaceInfo_ApplyChangesButton_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Вы действительно хотите внести изменения в БД?", "Внимание", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) { return; } string data = ""; Control[] ctrls = new Control[] { PlaceInfo_NewData1Box, PlaceInfo_NewData2Box, PlaceInfo_NewData3Box, PlaceInfo_NewData4Box, PlaceInfo_NewData5Box }; int index = 0; foreach (Control ctrl in ctrls) { data += ctrl.Text + ((index >= ctrls.Length - 1) ? "" : "\r\n"); index++; } PlaceInfoHelper.SetPlaceData(PlaceInfo_GetConnectString(), data); MessageBox.Show("Изменения успешно внесены", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); PlaceInfo_PrintCurrentData(); PlaceInfo_SaveUsedVals(); } catch (Exception ex) { AppHelper.CreateMessage(ex.ToString(), Feodosiya.Lib.Logs.MessageType.Error, true); } }