NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

sikayet.oku/aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;


public partial class sikayetoku : System.Web.UI.Page
{
string kategori_ismi;
PagedDataSource adsource;
int sayfa_no;
SikayetOku YeniSikayet = new SikayetOku();
Kullanicilar kullan = new Kullanicilar();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ViewState["vs"] = 0;
}
sayfa_no = (int)this.ViewState["vs"];


sayfalamagoster.Visible = true;
int SikayetAdet = YeniSikayet.SikayetAdet();
lblsikayetsayisi.Text = SikayetAdet.ToString();

//kategorileri veritabanından dolduruyoruz..

DataTable Kategoriler = YeniSikayet.KategoriDoldur();
dlKategori.DataSource = Kategoriler;
dlKategori.DataBind();
//Şikayetleri veritabanından dolduruyoruz
Listele();
}

public void Listele()
{
int tarih = drpsikayettarih.SelectedIndex;
DataTable Sikayetler = YeniSikayet.SikayetDoldur(tarih);
adsource = new PagedDataSource();
adsource.DataSource = Sikayetler.DefaultView;
adsource.PageSize = 4;
adsource.AllowPaging = true;
adsource.CurrentPageIndex = sayfa_no;
btnfirst.Enabled = !adsource.IsFirstPage;
btnprevious.Enabled = !adsource.IsFirstPage;
btnlast.Enabled = !adsource.IsLastPage;
btnnext.Enabled = !adsource.IsLastPage;
dlSikayet.DataSource = adsource;
dlSikayet.DataBind();
}
protected void btnfirst_Click(object sender, EventArgs e)
{
sayfa_no = 0;
Listele();
}

protected void btnprevious_Click(object sender, EventArgs e)
{
sayfa_no = (int)this.ViewState["vs"];
sayfa_no -= 1;
this.ViewState["vs"] = sayfa_no;
Listele();
}

protected void btnnext_Click(object sender, EventArgs e)
{
sayfa_no = (int)this.ViewState["vs"];
sayfa_no += 1;
this.ViewState["vs"] = sayfa_no;
Listele();
}

protected void btnlast_Click(object sender, EventArgs e)
{

sayfa_no = adsource.PageCount - 1;
this.ViewState["vs"] = sayfa_no;
Listele();
}

//Elle Oluşturuldu
protected void btnKategori_Click(object sender, EventArgs e)
{
Button kategoributonu = (Button)sender;
kategori_ismi = kategoributonu.Text;
YeniSikayet.kategori_id=kullan.KategoriId_Gonder(kategori_ismi);
Listele();
}
protected void btnTumu_Click(object sender, EventArgs e)
{
Button kategoributonu = (Button)sender;
kategori_ismi = kategoributonu.Text;
YeniSikayet.kategori_id = kullan.KategoriId_Gonder(kategori_ismi);
Listele();
}


}





sikayetoku.aspx


<%@ Page Title="" Language="C#" EnableEventValidation="false" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="sikayetoku.aspx.cs" Inherits="sikayetoku" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<link href="css/sikayetoku.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="sikayetokukapsayici">

<div id="anadiv">

<div id="ustdiv">
<div id="sikayetsayisi">
<span style="font-size: 16px; color: #c8c1c1; font-family: Arial;">Toplam Şikayet Sayısı:</span>
<asp:Label ID="lblsikayetsayisi" runat="server" Text=""></asp:Label>
</div>
<div id="sikayettarih">
<asp:DropDownList ID="drpsikayettarih" runat="server" CssClass="form-control" AutoPostBack="true">
<asp:ListItem>Tüm Zamanlar</asp:ListItem>
<asp:ListItem>2016</asp:ListItem>
<asp:ListItem>2015</asp:ListItem>
<asp:ListItem>2014</asp:ListItem>
</asp:DropDownList>
</div>
</div>

<div id="ortakapsayici">
<div id="ortakategori">
<div id="kategoriust">
<img src="images/ok.jpg" />&nbsp
<span style="font-size: 17px; color: #c8c1c1;">Şikayet <b>Kategorileri</b></span>
</div>

<div id="kategorimenu">
<div class="menueleman"><asp:Button ID="btnTumu" runat="server" Text="Tüm Kategoriler" CssClass="menueleman" OnClick="btnTumu_Click" /></div>

<asp:DataList ID="dlKategori" runat="server">
<ItemTemplate>
<asp:Button ID="btnKategori" runat="server" CssClass="menueleman" Text='<%#Eval("Kategori_Ad") %>' OnClick="btnKategori_Click" />
</ItemTemplate>

</asp:DataList>
<%-- <asp:DataList ID="dlKategori" runat="server">
<ItemTemplate>
<asp:Button ID="btnKategori" CssClass="menueleman" runat="server" Text='<%#Eval("Kategori_Ad") %>' />
</ItemTemplate>
</asp:DataList>--%>
</div>
</div>
<div id="sagsikayet">
<asp:DataList ID="dlSikayet" runat="server">
<ItemTemplate>
<div class="sikayet1divi">

<div id="sikayet1baslik"><a href="#" class="hvr-skew-forward"><%#Eval("Sikayet_Baslik").ToString().Length<=30 ? Eval("Sikayet_Baslik").ToString(): Eval("Sikayet_Baslik").ToString().Substring(0,30)+"..." %></a></div>
<div id="sikayet1bilgi"><%#Eval("Kul_Ad").ToString()+" "+Eval("Kul_Soyad").ToString() %> | <%#Eval("Sikayet_Tarih").ToString() %> | <%#Eval("Sikayet_ID").ToString() %></div>
<div id="sikayet1icerik"><%#Eval("Sikayet_İcerik").ToString().Length<=200 ? Eval("Sikayet_İcerik").ToString(): Eval("Sikayet_İcerik").ToString().Substring(0,200)+"..."%></div>
<div id="sikayet1butonlar">
<button class="btn btn-default glyphicon glyphicon-user hvr-grow-rotate"><span style="font-family: Calibri; margin-left: 4px;">0 Kişi Gördü</span></button>
<button class="btn btn-default glyphicon glyphicon-share hvr-buzz"><span style="font-family: Calibri; margin-left: 4px;">Paylaş</span></button>
<button class="btn btn-danger glyphicon glyphicon-time hvr-wobble-bottom"><span style="font-family: Calibri; margin-left: 4px;">Cevap Bekleniyor</span></button>
</div>
</div>
</ItemTemplate>
</asp:DataList>
<div id="sayfalamagoster" runat="server" style="float:right">
<div class="ilk"> <asp:Button ID="btnfirst" runat="server" Font-Bold="true" Text="<<" Height="31px"
Width="43px" OnClick="btnfirst_Click" /></div>
<div class="ilk"> <asp:Button ID="btnprevious" runat="server" Font-Bold="true" Text="<" Height="31px"
Width="43px" OnClick="btnprevious_Click" /></div>
<div class="ilk"> <asp:Button ID="btnnext" runat="server" Font-Bold="true" Text=">" Height="31px"
Width="43px" OnClick="btnnext_Click" /></div>
<div class="ilk"> <asp:Button ID="btnlast" runat="server" Font-Bold="true" Text=">>" Height="31px"
Width="43px" OnClick="btnlast_Click" /></div>
</div>

</div>
</div>
</div>


</div>
</asp:Content>




sikayetoku.cs



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.OleDb;

public class SikayetOku
{
private OleDbCommand komut;
private OleDbDataReader okuyucu;
private string sorgu;
public int kategori_id;

//Bağlantı metodudur....
private OleDbConnection Baglan()
{
string kaynak = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|SikayetVar.accdb";
OleDbConnection con = new OleDbConnection(kaynak);
con.Open();
return con;

}
//Bağlantı Metodu Sonu
//Şikayet Adedini Getiren Metot
public int SikayetAdet()
{
sorgu = @"select count(*) from tblSikayetler";
komut = new OleDbCommand(sorgu, Baglan());
int adet = (int)komut.ExecuteScalar();
Baglan().Close();
return adet;
}
public DataTable KategoriDoldur()
{
sorgu = @"select * from tblKategori";
OleDbDataAdapter daKategori = new OleDbDataAdapter(sorgu, Baglan());
DataTable dtKategori = new DataTable("KategoriTablosu");
daKategori.Fill(dtKategori);
Baglan().Close();
return dtKategori;
}

public DataTable SikayetDoldur(int secilen_tarih)
{
if (secilen_tarih == 0)
{
if (kategori_id==0)
{
sorgu = @"Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID ORDER BY Sikayet_Tarih DESC";
}
else
{
sorgu =string.Format("Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kategori_ID={0} and tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID ORDER BY Sikayet_Tarih DESC",kategori_id);
}

}
else if (secilen_tarih == 1)
{
if (kategori_id==0)
{
sorgu = @"Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID and Sikayet_Tarih>#31/12/2015# and Sikayet_Tarih<#01/01/2017# ORDER BY Sikayet_Tarih DESC";
}
else
{
sorgu=string.Format("Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kategori_ID={0} and tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID and Sikayet_Tarih>#31/12/2015# and Sikayet_Tarih<#01/01/2017# ORDER BY Sikayet_Tarih DESC",kategori_id);
}

}
else if (secilen_tarih == 2)
{
if (kategori_id==0)
{
sorgu = @"Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID and Sikayet_Tarih>#31/12/2014# and Sikayet_Tarih<#01/01/2016# ORDER BY Sikayet_Tarih DESC";
}
else
{
sorgu = string.Format("Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kategori_ID={0} and tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID and Sikayet_Tarih>#31/12/2014# and Sikayet_Tarih<#01/01/2016# ORDER BY Sikayet_Tarih DESC",kategori_id);
}
}
else
{
if (kategori_id==0)
{
sorgu = @"Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID and Sikayet_Tarih>#31/12/2013# and Sikayet_Tarih<#01/01/2015# ORDER BY Sikayet_Tarih DESC";
}
else
{
sorgu = string.Format("Select tblSikayetler.Sikayet_Baslik,tblSikayetler.Sikayet_İcerik,tblSikayetler.Sikayet_Tarih,tblSikayetler.Sikayet_ID,tblKullanicilar.Kul_Ad,tblKullanicilar.Kul_Soyad from tblSikayetler,tblKullanicilar where tblSikayetler.Kategori_ID={0} and tblSikayetler.Kullanici_ID=tblKullanicilar.Kullanici_ID and Sikayet_Tarih>#31/12/2013# and Sikayet_Tarih<#01/01/2015# ORDER BY Sikayet_Tarih DESC",kategori_id);
}

}
OleDbDataAdapter daSikayet = new OleDbDataAdapter(sorgu, Baglan());
DataTable dtSikayetler = new DataTable("SikayetlerTablosu");
daSikayet.Fill(dtSikayetler);
Baglan().Close();
return dtSikayetler;
}
}




     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.