protected void btnDuzenle_Click(object sender, EventArgs e)
{
DB db = new DB();
string baslik = txtBaslik.Text;
string resim = txtResimAdi.Text;
string aciklama = txtAciklama.Text;
//string tarih = txtTarih.Text;
HttpPostedFile yukleDosya = fluDosya.PostedFile;
if (yukleDosya != null)
{
FileInfo dosyaBilgi = new FileInfo(yukleDosya.FileName);
string path = "../resimler/";
if (resim != dosyaBilgi.Name)
{
string yukleYer = Server.MapPath(path + dosyaBilgi.Name);
fluDosya.SaveAs(yukleYer);
resim = dosyaBilgi.Name;
}
}
SqlCommand cm = new SqlCommand("update yerlesimDuzenle set baslik= '" + baslik + "', resimYol= '" + resim + "', aciklama= '" + aciklama + "', tarih= getdate() where yerlesimID= '" + yID + "' ", db.conn);
db.ac();
int sonuc = cm.ExecuteNonQuery();
if (sonuc > 0)
{
Response.Redirect("yerlesimDuzenle.aspx");
}
db.kapat();
}