Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (ADMINCRUD.IdyeGoreADMINGetir(Convert.ToInt32(Session["admin"])).YET != "1")
            {
                Response.Redirect("Anasayfa");
            }

            if (!String.IsNullOrEmpty(Request.QueryString["id"]))
            {
                AddEdit = Convert.ToInt32(Request.QueryString["id"]);
            }
            else
            {
                AddEdit = 0;
            }

            if (!Page.IsPostBack)
            {
                if (AddEdit != 0)
                {
                    btnKaydet.Text = "Düzenle";
                    ADMIN mst = ADMINCRUD.IdyeGoreADMINGetir(AddEdit);
                    tbK_Ad.Text             = mst.K_AD;
                    tbPass.Text             = mst.SFR;
                    tbMail.Text             = mst.MAIL;
                    rbtnYetki.SelectedValue = mst.YET;
                }
                ADMGetir();
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((string)Session["anahtar"] == null || (string)Session["anahtar"] == "kapali")
            {
                Response.Redirect("login.aspx");
            }

            if (!Page.IsPostBack)
            {
                spanAdmin.InnerText = "Hoşgeldin " + ADMINCRUD.IdyeGoreADMINGetir(Convert.ToInt32(Session["admin"])).K_AD;
            }
        }
Beispiel #3
0
        protected void btnGiris_Click(object sender, EventArgs e)
        {
            int adminsay = Convert.ToInt32(ADMINCRUD.TekDegerGetir("SELECT COUNT(*) FROM ADMIN"));

            for (int i = 1; i <= adminsay; i++)
            {
                ADMIN admin = ADMINCRUD.IdyeGoreADMINGetir(i);

                if (tbK_Ad.Text == admin.K_AD && tbPass.Text == admin.SFR)
                {
                    Session["anahtar"] = "acik";
                    Session["admin"]   = admin.ID.ToString();
                    admin.SON_GRS      = DateTime.Now.ToShortDateString().ToString() + " - " + DateTime.Now.ToShortTimeString().ToString();
                    admin.MAIL         = admin.MAIL;
                    admin.ID           = admin.ID;
                    ADMINCRUD.Guncelle(admin);
                    Response.Redirect("Anasayfa");
                }
                else
                {
                    divSonuc.Visible = true;
                }
            }
        }