protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated) { System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx"); } if (!IsPostBack) { hdnKul.Value = User.Identity.Name; using (Radius.radiusEntities dc = Radius.MyContext.Context(KullaniciIslem.firma())) { AyarIslemleri islem = new AyarIslemleri(dc); drdDurum.DataSource = islem.durumListesiR(); drdDurum.DataTextField = "Durum"; drdDurum.DataValueField = "Durum_ID"; drdDurum.DataBind(); } string id = Request.QueryString["durum"]; string atanan = Request.QueryString["atanan"]; if (!String.IsNullOrEmpty(id)) { drdDurum.SelectedValue = id; } //baslikDetay.InnerText += "-" + atanan; if (HttpContext.Current.User.IsInRole("Admin") || User.IsInRole("mudur")) { kullaniciSecim.Visible = true; if (!IsPostBack) { drdKullanici.AppendDataBoundItems = true; drdKullanici.DataSource = KullaniciIslem.firmaKullanicilari(); drdKullanici.DataValueField = "id"; drdKullanici.DataTextField = "userName"; drdKullanici.DataBind(); if (!String.IsNullOrEmpty(atanan)) { drdKullanici.SelectedValue = atanan; } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated) { System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx"); } if (!IsPostBack) { using (radiusEntities dc = MyContext.Context(firma)) { AyarIslemleri islem = new AyarIslemleri(dc); drdDurum.AppendDataBoundItems = true; drdDurum.DataSource = islem.durumListesiR().Where(x => x.baslangicmi == false && x.sonmu == false && x.onaymi == false && x.kararmi == false).ToList(); drdDurum.DataTextField = "Durum"; drdDurum.DataValueField = "Durum_ID"; drdDurum.DataBind(); } } }
private void durumGoster(AyarIslemleri ayarlar) { GridView1.DataSource = ayarlar.durumListesiR(); GridView1.DataBind(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("detail")) { int code2 = Int32.Parse(e.CommandArgument.ToString().Trim()); using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma())) { AyarIslemleri ayarlar = new AyarIslemleri(dc); DetailsView1.DataSource = ayarlar.durumListesiTekliR(code2); DetailsView1.DataBind(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#detailModal').modal('show');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "DetailModalScript2", sb.ToString(), false); } } else if (e.CommandName.Equals("del")) { string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Yes") { int code2 = Int32.Parse(e.CommandArgument.ToString().Trim()); using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma())) { AyarIslemleri ayarlar = new AyarIslemleri(dc); ayarlar.durumSilR(code2);; GridView1.DataSource = ayarlar.durumListesiR(); GridView1.DataBind(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append(" alertify.success('Kayıt silindi!');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScript3", sb.ToString(), false); } } } else if (e.CommandName.Equals("editRecord")) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow gvrow = GridView1.Rows[index]; LinkButton link = gvrow.Cells[2].Controls[1] as LinkButton; lblID.Value = HttpUtility.HtmlDecode(gvrow.Cells[1].Text); txtDurum.Text = HttpUtility.HtmlDecode(link.Text); chcSMS.Checked = (gvrow.Cells[3].Controls[0] as CheckBox).Checked; chcMail.Checked = (gvrow.Cells[4].Controls[0] as CheckBox).Checked; chcWhat.Checked = (gvrow.Cells[5].Controls[0] as CheckBox).Checked; if ((gvrow.Cells[6].Controls[0] as CheckBox).Checked) { rdDurum.SelectedValue = "son"; } else if ((gvrow.Cells[7].Controls[0] as CheckBox).Checked) { rdDurum.SelectedValue = "baslangic"; } else if ((gvrow.Cells[8].Controls[0] as CheckBox).Checked) { rdDurum.SelectedValue = "karar"; } else if ((gvrow.Cells[9].Controls[0] as CheckBox).Checked) { rdDurum.SelectedValue = "onay"; } else { rdDurum.SelectedIndex = -1; } lblResult.Visible = false; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#editModal').modal('show');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditModalScript", sb.ToString(), false); } }