-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cagrilarim.aspx.cs
140 lines (129 loc) · 4.38 KB
/
Cagrilarim.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using IsTakipProgramı.App_Code;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace IsTakipProgramı
{
public partial class Cagrilarim : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
pnlKullaniciYetki.Visible = true;
lblKullaniciYetki.Visible = false;
if (Request.QueryString["listele"] != null)
{
pnlCagrilarim.Visible = false;
}
else if (!IsPostBack)
{
UstlenenKisiDoldur();
AsamaDoldur();
if (Session["KullaniciYetki"].ToString() == "2")
{
lblKullaniciYetki.Visible = true;
pnlKullaniciYetki.Visible = false;
}
else
{
if (Request.QueryString["s"] != null)
{
Kodlar.CagriSil(Request.QueryString["s"]);
Response.Redirect("Cagrilarim.aspx?listele=1");
}
else if (Request.QueryString["id"] != null)
{
DataTable dt = Kodlar.CagriCek(Request.QueryString["id"]);
if (dt.Rows.Count > 0)
{
lblCagriNumara.Text = dt.Rows[0]["CagriID"].ToString();
lblBaslik.Text = dt.Rows[0]["Baslik"].ToString();
txtAciklama.InnerText = dt.Rows[0]["Aciklama"].ToString();
txtMetin.InnerText = dt.Rows[0]["Islemler"].ToString();
ddlUstlenenKisi.SelectedValue = dt.Rows[0]["UstlenenKisi"].ToString();
ddlAsama.SelectedValue = dt.Rows[0]["Durumu"].ToString();
lblKullaniciAdi.Text = dt.Rows[0]["KullaniciAdi"].ToString();
}
}
}
}
Listele();
}
void UstlenenKisiDoldur()
{
ddlUstlenenKisi.DataSource = Kodlar.Calisanlar();
ddlUstlenenKisi.DataValueField = "KullaniciID";
ddlUstlenenKisi.DataTextField = "KullaniciAdi";
ddlUstlenenKisi.DataBind();
}
void AsamaDoldur()
{
ddlAsama.DataSource = Kodlar.Asama();
ddlAsama.DataValueField = "CagriSurecID";
ddlAsama.DataTextField = "Ad";
ddlAsama.DataBind();
}
void Listele()
{
rptCagrilar.DataSource = Kodlar.CagriListele(Session["KullaniciID"].ToString());
rptCagrilar.DataBind();
}
protected void btnKaydet_Click(object sender, EventArgs e)
{
//int durum = 0;
if (Request.QueryString["id"] != null)
{
int durum = Kodlar.CagriDuzelt(ddlUstlenenKisi.SelectedValue, ddlAsama.SelectedValue, txtMetin.InnerText, Request.QueryString["id"]);
if (durum > 0)
{
lblDurum.Text = "Düzeltme Yapılmıştır";
Response.AppendHeader("Refresh", "1;url=Cagrilarim.aspx?listele=1");
}
else
{
lblDurum.Text = "Düzeltme sırasında hata oluştu";
}
}
Listele();
}
public static string DurumKontrol(string durum)
{
if (durum == "0")
{
return "label label-important";
}
else
{
return "label label-success";
}
}
public static string AktifKontrol(string durum, string type)// type = 1 buton, type = 2 icon
{
if (type == "1")
{
if (durum != "0")
{
return "btn btn-danger";
}
else
{
return "btn btn-success";
}
}
else
{
if (durum != "0")
{
return "icon-trash";
}
else
{
return "icon-repeat";
}
}
}
}
}