예제 #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        lblHata.Text = "";

        isim.Text  = isim.Text.Replace("'", "").Trim();
        sifre.Text = sifre.Text.Replace("'", "").Trim();
        isim.Text  = isim.Text.Replace('"', ' ');
        sifre.Text = sifre.Text.Replace('"', ' ');

        kullanici k = new kullanici();

        if (k.giris(isim.Text, sifre.Text) == false)
        {
            lblHata.Text = "Giriþ baþarýsýz";
        }
        else
        {
            lblHata.Text         = "Hoþgeldin, sayýn " + isim.Text;
            Session["kullanici"] = isim.Text;
            Session["tip"]       = k.tipGetir(isim.Text);

/*            Label isim1 = new Label();
 *          Label tip1 = new Label();
 *          Label lblGondericiMenu = new Label();
 *          Menu gondericiMenu = new Menu();
 *          Label lblSorumluMenu = new Label();
 *          Menu sorumluMenu = new Menu();
 *          Panel panel = new Panel();
 *
 *          isim1 = (Label)Master.FindControl("kullaniciIsmi");
 *          isim1.Text = Session["kullanici"].ToString();
 *          tip1 = (Label)Master.FindControl("kullaniciTip");
 *          tip1.Text = Session["tip"].ToString();
 *          panel = (Panel)Master.FindControl("panel");
 *          panel.Visible = true;
 *          lblGondericiMenu = (Label)Master.FindControl("lblGondericiMenu");
 *          lblGondericiMenu.Visible = true;
 *          gondericiMenu = (Menu)Master.FindControl("gondericiMenu");
 *          gondericiMenu.Visible = true;
 *
 *          if (Session["tip"].ToString() == "sorumlu")
 *          {
 *              lblSorumluMenu = (Label)Master.FindControl("lblSorumluMenu");
 *              lblSorumluMenu.Visible = true;
 *              sorumluMenu = (Menu)Master.FindControl("sorumluMenu");
 *              sorumluMenu.Visible = true;
 *          }
 */
            Session["yollayanid_session"] = k.idGetir(isim.Text);
            Response.Redirect("Default.aspx");
        }

        isim.Text  = "";
        sifre.Text = "";
    }
예제 #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     gelenkullanici = new string[3];
     gelenkullanici = kul.giris(textbox1.Text, textbox2.Text);
     if (gelenkullanici != null)
     {
         MessageBox.Show("Giriş Başarılı");
         tabControl1.SelectTab(4);
         textBox5.Text = gelenkullanici[0];
         textBox4.Text = gelenkullanici[1];
         textBox3.Text = gelenkullanici[2];
     }
     else
     {
         MessageBox.Show("Kullanıcı Adı veya Şifre Hatalı.");
     }
 }
예제 #3
0
 public bool giris(string isim, string sifre)
 {
     return(k.giris(isim, sifre));
 }