Beispiel #1
0
 private void FrmLogin_Load(object sender, EventArgs e)
 {
     if (IaseLib.GetLineCFG("KULLANICI ADI") != "")
     {
         teKullaniciAdi.Text = IaseLib.GetLineCFG("KULLANICI ADI");
         teSifre.Text        = IaseLib.GetLineCFG("SIFRE");
     }
 }
Beispiel #2
0
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            var u = new UserLookAndFeel(this);

            u.UseDefaultLookAndFeel = false;
            u.UseWindowsXPTheme     = false;
            u.Style    = LookAndFeelStyle.Skin;
            u.SkinName = IaseLib.skinName;

            if (teKullaniciAdi.Text == "" || teSifre.Text == "")
            {
                XtraMessageBox.Show(u, "Kullanıcı Adı ve Şifre Boş Olamaz!!!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            conn.Open();
            var cmd = new OleDbCommand("SELECT * FROM TBLKULLANICI WHERE KULLANICI_ADI = '" + teKullaniciAdi.Text + "' AND SIFRE = '" + teSifre.Text + "'", conn);
            var dt  = new DataTable();
            var da  = new OleDbDataAdapter(cmd);

            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                DataRow row = dt.Rows[0];
                IaseLib.userNo   = Convert.ToInt32(row["REC_ID"]);
                IaseLib.userName = teKullaniciAdi.Text;

                IaseLib.SaveLineCFG("KULLANICI ADI", teKullaniciAdi.Text);
                IaseLib.SaveLineCFG("SIFRE", teSifre.Text);

                MainMenu mainMenu = new MainMenu();
                mainMenu.Show();
                this.Hide();
            }
            else
            {
                Thread thrError = new Thread(new ThreadStart(ErrorThr));
                thrError.Start();
            }
            conn.Close();
        }