コード例 #1
0
        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(KullaniciIslem.firma()))
            {
                if (!IsPostBack)
                {
                    AyarCurrent ay = new AyarCurrent(dc);
                    if (ay.lisansKontrol() == false)
                    {
                        Response.Redirect("/LisansError");
                    }
                    AyarIslemleri servis = new AyarIslemleri(dc);
                    List <Radius.service_tips> tipler = servis.tipListesiR();
                    if (tipler != null)
                    {
                        drdTip.AppendDataBoundItems = true;
                        drdTip.DataSource           = tipler;
                        drdTip.DataValueField       = "tip_id";
                        drdTip.DataTextField        = "tip_ad";
                        drdTip.DataBind();
                    }



                    drdPaketler.AppendDataBoundItems = true;

                    drdPaketler.DataSource     = servis.servis_paketleri();
                    drdPaketler.DataValueField = "paket_id";
                    drdPaketler.DataTextField  = "paket_adi";
                    drdPaketler.DataBind();
                    txtKimlikNo.Value = AletEdavat.KimlikUret(10);
                }
                if (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();
                    }
                }

                string s = txtAra.Value;

                if (!String.IsNullOrEmpty(s))
                {
                    MusteriIslemleri m = new MusteriIslemleri(dc);

                    GridView1.DataSource = m.musteriAraR2(s, "musteri");

                    GridView1.SelectedIndex = 0;
                    GridView1.DataBind();
                }
            }
        }