protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated) { System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx"); } using (radiusEntities dc = MyContext.Context(firma)) { goster(dc); if (!IsPostBack) { AyarCurrent ay = new AyarCurrent(dc); if (ay.calismaTipli() == true) { btnSatis.Visible = false; btnFatura.Visible = false; } else { btnSatis.Visible = true; btnFatura.Visible = true; } } } if (User.IsInRole("servis")) { btnTahsilat.Visible = false; btnOde.Visible = false; btnExtre.Visible = false; btnFatura.Visible = false; panelOdeme.Visible = false; panelAlim.Visible = false; } else if (User.IsInRole("dukkan")) { btnFatura.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { userdiv.DataBind(); //kullanici_repo kul = KullaniciIslem.currentKullanici(); IPrincipal use = HttpContext.Current.User; if (!use.IsInRole("canEdit")) { kiralama_link.HRef = "/TeknikMakine/HizliKirala2"; } if (use.IsInRole("Admin")) { ayar.Visible = true; ayarLi2.Visible = true; maliyetLi.Visible = true; } else if (use.IsInRole("mudur")) { maliyetLi.Visible = true; } else { ayar.Visible = false; ayarLi2.Visible = false; cihazLi.Visible = false; roporLi.Visible = false; stokLi.Visible = false; satisListesiLi.Visible = false; alimLi.Visible = false; if (use.IsInRole("servis")) { cariHesapLi.Visible = false; satisLi.Visible = false; satistopLi.Visible = false; } paraHesapLi.Visible = false; //butunAntenLink.HRef = "/ButunAntenlerBayi.aspx?bayi=" + kul.owner; } using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma())) { if (!IsPostBack) { AyarCurrent ay = new AyarCurrent(dc); if (ay.calismaTipli() == true) { stokLi.Visible = false; Li3.Visible = true; cihazLi.Visible = false; paraHesapLi.Visible = false; alimLi.Visible = false; satisLi.Visible = false; Li4.Visible = false; roporLi.Visible = false; } else { stokLi.Visible = true; Li3.Visible = true; cihazLi.Visible = true; paraHesapLi.Visible = true; alimLi.Visible = true; satisLi.Visible = true; Li4.Visible = false; roporLi.Visible = true; } } } }