public int adresEkleString(adres a) { dm.AddInParameters("@emlakId", SqlDbType.Int, a.EmlakId); dm.AddInParameters("@shrId", SqlDbType.Int, a.SehirId); dm.AddInParameters("@ilceId", SqlDbType.Int, a.IlceId); dm.AddInParameters("@smtId", SqlDbType.Int, a.SemtId); dm.AddInParameters("@adresTarifi", SqlDbType.NVarChar, a.AdresTarifi); dm.AddInParameters("@cdId", SqlDbType.Int, a.CaddeId); int sonuc = dm.ExecuteNonQuery("insert into Adres values(@emlakId,@shrId,@ilceId,@smtId,@adresTarifi,@cdId)", CommandType.Text); return(sonuc); }
public int adresGuncelleId(adres gelenA) { int sonuc = 0; try { dm.AddInParameters("@emlakId", SqlDbType.Int, gelenA.EmlakId); dm.AddInParameters("@sehirId", SqlDbType.Int, gelenA.SehirId); dm.AddInParameters("@ilceId", SqlDbType.Int, gelenA.IlceId); dm.AddInParameters("@semtId", SqlDbType.Int, gelenA.SemtId); dm.AddInParameters("@adresTarifi", SqlDbType.NVarChar, gelenA.AdresTarifi); dm.AddInParameters("@cdId", SqlDbType.Int, gelenA.CaddeId); sonuc = dm.ExecuteNonQuery("update Adres set SehirId = @sehirId, IlceId = @ilceId, SemtId = @semtId, AdresTarifi = @adresTarifi, CaddeId = @cdId where EmlakId = @emlakId", CommandType.Text); } catch (Exception ex) { } return(sonuc); }
public adres adresGetirId(int gelenEmlakId) { adres a = new adres(); try { SqlCommand com = new SqlCommand("prcAdresGetirId", con); com.CommandType = CommandType.StoredProcedure; com.Parameters.AddWithValue("@emlakId", gelenEmlakId); con.Open(); SqlDataReader dr = com.ExecuteReader(); while (dr.Read()) { a.AdresTarifi = dr["AdresTarifi"].ToString(); a.EmlakId = Convert.ToInt32(dr["EmlakId"]); a.IlceAd = dr["IlceAd"].ToString(); a.IlceId = Convert.ToInt32(dr["IlceId"]); a.SehirAd = dr["SehirAd"].ToString(); a.SehirId = Convert.ToInt32(dr["SehirId"]); a.SemtAd = dr["SemtAd"].ToString(); a.SemtId = Convert.ToInt32(dr["SemtId"]); a.CaddeId = Convert.ToInt32(dr["CaddeId"]); a.CaddeAd = dr["CaddeAd"].ToString(); } dr.Close(); } catch (Exception ex) { } finally { con.Close(); } return(a); }