private void btnGiris_Click(object sender, EventArgs e) { string kullanici_adi = txtKullaniciAdi.Text; string sifre = txtSifre.Text; //OracleCommand cmd = con.CreateCommand(); //cmd.CommandText = "SELECT EMPLOYEE_ID, LAST_NAME, JOB_ID, HIRE_DATE, EMAIL FROM EMPLOYEES"; string sql = "SELECT PRIVILIGESID from K_USER where USERNAME ="******" AND PASSWORD="******"mudur") { this.Hide(); MudurPanel mudur = new MudurPanel(); mudur.Show(); } }
private void add_btn_Click(object sender, RoutedEventArgs e) { String connectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString; con = new OracleConnection(connectionString); try { con.Open(); } catch (Exception exp) { } string yetki = ""; string kullanici_adi = txtKullaniciAdi.Text; string sifre = txtSifre.Text; string sql = "SELECT * from K_USER where USERNAME ='******' AND PASSWORD='******'"; OracleCommand cmd = new OracleCommand(sql, con); OracleDataReader reader = cmd.ExecuteReader(); OracleDataAdapter da = new OracleDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { while (reader.Read()) { yetki = (string)reader["PRIVILIGESID"]; Sitatikler.kullanici_id = Int32.Parse(reader["USER_ID"].ToString()); } if (yetki == "mudur") { this.Hide(); MudurPanel mudur = new MudurPanel(); mudur.Show(); } else if (yetki == "admin") { this.Hide(); Form1 admin = new Form1(); admin.Show(); } else { this.Hide(); Form1 admin = new Form1(); admin.Show(); } } else { MessageBox.Show("Kullanıcı Adı veya Şifrenizi Yanlış Girdiniz!"); txtKullaniciAdi.Text = ""; txtSifre.Text = ""; } con.Close(); }