public string AddNewAdressOffUko(Adress _adress) { try { SqlCommand cmd = new SqlCommand("AddAdressOffUko", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Type", _adress.Type); cmd.Parameters.AddWithValue("@ID", _adress.Id); cmd.Parameters.AddWithValue("@PostCode", _adress.Index); cmd.Parameters.AddWithValue("@City", nullCheck.checkStringNull(_adress.City)); cmd.Parameters.AddWithValue("@Street", nullCheck.checkStringNull(_adress.Street)); cmd.Parameters.AddWithValue("@Building", nullCheck.checkIntNull(_adress.HouseNumber)); cmd.Parameters.AddWithValue("@BuildingCode", nullCheck.checkIntNull(_adress.BuildingCode)); cmd.Parameters.AddWithValue("@Block", nullCheck.checkIntNull(_adress.Block)); cmd.Parameters.AddWithValue("@Flat", nullCheck.checkIntNull(_adress.Flat)); cmd.Parameters.AddWithValue("@Floor", nullCheck.checkIntNull(_adress.Floor)); cmd.Parameters.AddWithValue("@Entrance", _adress.Entrance); cmd.Parameters.AddWithValue("@Comment", nullCheck.checkStringNull(_adress.Comment)); con.Open(); cmd.ExecuteNonQuery(); con.Close(); return("Адрес добавлен"); } catch { con.Close(); throw; } }