private void BttnAnaSayfa_Click(object sender, EventArgs e) { Hide(); FrmTeknikServisFormu frm = new FrmTeknikServisFormu(); frm.Show(); }
private void FrmProfil_FormClosing(object sender, FormClosingEventArgs e) { FrmTeknikServisFormu frm = new FrmTeknikServisFormu(); frm.Show(); Dispose(); }
private void PcTrBoxProfiliDuzenle_Click(object sender, EventArgs e) { using (OpenFileDialog resimSec = new OpenFileDialog()) { resimSec.Title = Resources.resimSecTitle; resimSec.Filter = Resources.resimSecFilter; if (resimSec.ShowDialog() == DialogResult.OK) { string kaynakResimYolu = resimSec.FileName; if (!Directory.Exists(SMF.ProfilKlasoru)) { Directory.CreateDirectory(SMF.ProfilKlasoru); } PcTrBoxProfiliDuzenle.Image?.Dispose(); FrmTeknikServisFormu frm = new FrmTeknikServisFormu(); frm.PcTrBoxProfiliDuzenle.Image?.Dispose(); try { PcTrBoxProfiliDuzenle.Image = File.Exists(SMF.ProfilResmiYolu) ? Image.FromFile(SMF.ProfilResmiYolu) : Resources.varsayilanProfilResmi; File.Copy(kaynakResimYolu, SMF.ProfilResmiYolu, true); } catch (Exception) { PcTrBoxProfiliDuzenle.Image = Resources.varsayilanProfilResmi; } PcTrBoxProfiliDuzenle.Image = Image.FromFile(kaynakResimYolu); } } }
private void BttnGirisYap_Click(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(TxtKullaniciAdi.Text) || String.IsNullOrWhiteSpace(TxtSifre.Text)) { MessageBox.Show(Resources.kullaniciAdiveSifreBos, SMF.UygulamaAdi, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { SMF.Baglanti.Open(); MySqlCommand komutKullaniciVarMi = new MySqlCommand("SELECT * FROM kullanicilar", SMF.Baglanti); DataTable dataTable1 = new DataTable(); MySqlDataAdapter dataAdapter1 = new MySqlDataAdapter(komutKullaniciVarMi); dataAdapter1.Fill(dataTable1); if (dataTable1.Rows.Count == 0) { MessageBox.Show(Resources.kayitliKullaniciYok, SMF.UygulamaAdi, MessageBoxButtons.OK, MessageBoxIcon.Warning); BttnYeniKullaniciOluştur.Text = Resources.BttnYeniKullaniciOluştur; _sifremiUnuttumTiklandiMi = false; KullaniciOlusturGoster(); } else { MySqlCommand cmd = new MySqlCommand("SELECT * FROM kullanicilar WHERE KullaniciAdi=@KullaniciAdi AND Sifre=@Sifre", SMF.Baglanti); cmd.Parameters.AddWithValue("@KullaniciAdi", TxtKullaniciAdi.Text); cmd.Parameters.AddWithValue("@Sifre", TxtSifre.Text); DataTable dataTable2 = new DataTable(); MySqlDataAdapter dataAdapter2 = new MySqlDataAdapter(cmd); dataAdapter2.Fill(dataTable2); if (dataTable2.Rows.Count > 0) { FrmTeknikServisFormu frm = new FrmTeknikServisFormu(); frm.Show(); Hide(); } else { MessageBox.Show(Resources.kullaniciAdiveSifreYanlis, SMF.UygulamaAdi, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } SMF.Baglanti.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, Resources.Hata); } }