private STRegion read_data() { STRegion ret = new STRegion(); CCountry country; try { if (gstRegion.id != 0) { ret.id = gstRegion.id; } else { ret.id = clRegion.GetFreeId(); } if (textBoxName.Text.Length > 0) { ret.name = textBoxName.Text.Trim(); } else { ret.name = null; } if (textBoxShortName.Text.Length > 0) { ret.shortname = textBoxShortName.Text.Trim(); } else { ret.shortname = null; } string str = comboBoxCountry.Text.Trim(); if (str.Length > 0) { country = new CCountry(connect, str); ret.idcountry = country.stCountry.id; } else { ret.idcountry = 0; } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } return(ret); }