public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                string id       = context.Request["id"];
                string aciklama = context.Request["aciklama"];
                try
                {
                    SqlCommand guncelle = new SqlCommand("UPDATE galeriFotograf SET aciklama='" + aciklama + "' where ID=" + id + "", baglanti.baglanti());

                    guncelle.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(id);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                HttpPostedFile postedFile = context.Request.Files["Filedata"];
                string         haberid    = context.Request["haberid"];
                string         id         = context.Request["id"];
                try
                {
                    SqlCommand guncelle = new SqlCommand("UPDATE SliderHaber SET haberid=" + haberid + "  where id=" + Convert.ToInt16(id) + "", baglanti.baglanti());

                    guncelle.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(yazi);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                string id   = context.Request["yazar_id"];
                string sira = context.Request["ord"];
                try
                {
                    SqlCommand guncelle = new SqlCommand("UPDATE yazarlar SET ord=" + sira + " where yazar_id=" + id + "", baglanti.baglanti());

                    guncelle.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(id);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                string sira = context.Request["sira"];
                string ad   = context.Request["ad"];
                try
                {
                    SqlCommand sor = new SqlCommand("insert into turlerHaber (AnasayfaSira,tur_ad,Anasayfada) values(" + sira + ",'" + ad + "',1)", baglanti.baglanti());

                    sor.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(yazi);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                string cid = context.Request["veri"];
                try
                {
                    SqlDataReader okuyucu;

                    SqlCommand sor = new SqlCommand("SELECT Anasayfada as durum FROM turlerHaber where tur_id=" + Convert.ToInt32(cid) + "", baglanti.baglanti());


                    okuyucu = sor.ExecuteReader();
                    int    durumoku = 0;
                    string sonuc    = "";

                    while (okuyucu.Read())

                    {
                        durumoku = Convert.ToInt16(okuyucu["durum"].ToString());
                    }
                    if (durumoku == 1)
                    {
                        sonuc = "0";
                        yazi  = cid;
                    }
                    else
                    {
                        sonuc = "1";
                        yazi  = cid;
                    }


                    SqlCommand guncelle = new SqlCommand("UPDATE turlerHaber SET Anasayfada=" + sonuc + " where tur_id=" + Convert.ToInt16(cid) + "", baglanti.baglanti());

                    guncelle.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(yazi);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
Exemplo n.º 6
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                HttpPostedFile postedFile = context.Request.Files["Filedata"];
                string         cid        = context.Request["veri"];
                try
                {
                    fonk          baglanti = new fonk();
                    SqlCommand    sor      = new SqlCommand("SELECT * FROM yoneticiler", baglanti.baglanti());
                    SqlDataReader okuyucu  = sor.ExecuteReader();
                    string        sifrete  = "";
                    while (okuyucu.Read())
                    {
                        sifrete = okuyucu["adm_password"].ToString();
                    }



                    baglanti.son();


                    SmtpClient sc = new SmtpClient();
                    sc.Port        = 587;
                    sc.Host        = "mail.qualitydergisi.com";
                    sc.EnableSsl   = false;
                    sc.Timeout     = 50000;
                    sc.Credentials = new NetworkCredential("*****@*****.**", "QUality265");
                    MailMessage mail = new MailMessage();
                    mail.From = new MailAddress("*****@*****.**", "*****@*****.**");
                    mail.To.Add("*****@*****.**");
                    mail.Subject    = "Site Yönetim Şifresi";
                    mail.IsBodyHtml = true;
                    mail.Body       = sifrete;
                    sc.Send(mail);
                    yazi = "Adresinize gönderildi";
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(yazi);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            fonk baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            string sonuc = "";

            try
            {
                try
                {
                    SqlCommand sor = new SqlCommand("SELECT turlerHaber.tur_ad as adi,turlerHaber.renk as renk, ( select count(id) from haberler where haberler.tur_id=turlerHaber.tur_id ) AS hit FROM turlerHaber   ORDER BY hit DESC", baglanti.baglanti());

                    SqlDataReader oku = sor.ExecuteReader();

                    while (oku.Read())
                    {
                        sonuc += "<div class='new' style='background:" + oku["renk"].ToString() + "'><b>" + oku["adi"].ToString() + "</b>  <br> " + oku["hit"].ToString() + "<br></div>";
                    }


                    baglanti.son();



                    string habersayisiSTR = "";

                    SqlCommand    habersayisisorgu      = new SqlCommand("select count(*) from haberler", baglanti.baglanti());
                    SqlDataReader habersayisisorgusuoku = habersayisisorgu.ExecuteReader();
                    while (habersayisisorgusuoku.Read())
                    {
                        habersayisiSTR = habersayisisorgusuoku[0].ToString();
                    }

                    context.Response.Write("<div style=''>'" + sonuc + "</div><br><br><div class='clearfix'></div><br><br><div style='background:#dff0d8;color:#468847;border:1px solid #468847; padding:20px;>'<p style='font-size:20px !important'>" + habersayisiSTR + " Haber </p></div>");

                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write("Hata Oldu Kapat Hemen");
            }
        }
Exemplo n.º 8
0
        public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            string tur_id = context.Request["tur_id"];
            string baslik = context.Request["baslik"];
            string metin  = context.Request["metin"].ToString();
            string foto   = context.Request["foto"].ToString();

            try
            {
                try
                {
                    //context.Response.Write(tur_id.ToString() + baslik + metin + foto.ToString());
                    SqlCommand kayit = new SqlCommand("insert into haberler (tur_id,baslik,metin,foto,akt) " +
                                                      "values(" + Convert.ToInt16(tur_id) + ",'" + baslik.ToString() + "','" +
                                                      System.Net.WebUtility.HtmlEncode(metin.ToString()) + "','" + foto.ToString() + "',1)", baglanti.baglanti());

                    kayit.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(yazi);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
Exemplo n.º 9
0
        public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            string ad    = context.Request["ad"];
            string resim = context.Request["resim"];

            try
            {
                try

                {
                    //context.Response.Write(tur_id.ToString() + baslik + metin + foto.ToString());
                    SqlCommand kayit = new SqlCommand("insert into yazarlar (ad,resim,akt) values('" + ad + "','" + resim + "',1)", baglanti.baglanti());

                    kayit.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(yazi);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }
Exemplo n.º 10
0
        public void ProcessRequest(HttpContext context)
        {
            string yazi     = "";
            fonk   baglanti = new fonk();

            context.Response.ContentType = "text/plain";
            context.Response.Expires     = -1;
            try
            {
                HttpPostedFile postedFile = context.Request.Files["Filedata"];
                string         cid        = context.Request["veri"];
                try
                {
                    SqlDataReader okuyucu;

                    SqlCommand sor = new SqlCommand("SELECT aktif as durum FROM galeri where ID=" + Convert.ToInt32(cid) + "", baglanti.baglanti());


                    okuyucu = sor.ExecuteReader();
                    string durumoku = "";
                    string sonuc    = "";

                    bool yeni = true;
                    while (okuyucu.Read())

                    {
                        durumoku = okuyucu["durum"].ToString();
                        yeni     = bool.Parse(durumoku);
                    }
                    if (yeni)
                    {
                        sonuc = "0";
                        yazi  = "NO";
                    }
                    else
                    {
                        sonuc = "1";
                        yazi  = "OK";
                    }


                    SqlCommand guncelle = new SqlCommand("UPDATE galeri SET aktif=" + sonuc + " where ID=" + Convert.ToInt16(cid) + "", baglanti.baglanti());

                    guncelle.ExecuteNonQuery();
                    baglanti.son();
                }
                catch (Exception ex)
                {
                    context.Response.Write(ex.ToString());
                }
                finally
                {
                    context.Response.Write(yazi);
                    context.Response.StatusCode = 200;
                }
            }
            catch
            {
                context.Response.Write(yazi);
            }
        }