public void DeleteEntity(int Id) { KullaniciSifre ks = (from k in _db.DbKullaniciSifre where k.KullaniciID == Id where k.AktifMi == true select k).First(); ks.AktifMi = false; SaveEntity(); }
public int AddEntitiy(KullaniciSifre nesne) { _db.DbKullaniciSifre.Add(nesne); int ID = nesne.ID; return(ID); }
public KullaniciSifre SifreGetir(int kullaniciID) { KullaniciSifre sifre = (from k in db.KullaniciSifre where k.KullaniciID == kullaniciID select k).FirstOrDefault(); return(sifre); }
public string GetPassword(int _kullaniciID) { KullaniciSifre temp = new KullaniciSifre(); temp = (from sifre in _db.DbKullaniciSifre where sifre.AktifMi == true && sifre.KullaniciID == _kullaniciID select sifre).FirstOrDefault(); return(temp.Sifre); }
//public const int WM_NCLBUTTONDOWN = 0xA1; //public const int HT_CAPTION = 0x2; //[DllImportAttribute("user32.dll")] //public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); //[DllImportAttribute("user32.dll")] //public static extern bool ReleaseCapture(); //private void KullaniciEkle_MouseDown(object sender, MouseEventArgs e) //{ // if (e.Button == MouseButtons.Left) // { // ReleaseCapture(); // SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); // } //} #endregion private void btnKullaniciEkle_Click(object sender, EventArgs e) { Kullanici _kullanici = new Kullanici(); _kullanici.KullaniciAdi = txtKullaniciAdi.Text; _kullanici.AdminMi = chkAdminMi.Checked; _kullanici.AktifMi = true; KullaniciSifre _sifre = new KullaniciSifre(); _sifre.Sifre = txtSifre.Text; _sifre.KullaniciID = _ekleController.EklemeyeGonder(_kullanici); _sifre.AktifMi = true; _ekleController.EklemeyeGonder(_sifre); this.Close(); }
public bool[] KullanıcıKontrol(string kullaniciAdi, string sifre) { List <Kullanici> _list = lm.KullaniciGetir(); bool[] giris = new bool[2] { false, false }; foreach (Kullanici item in _list) { if (item.KullaniciAdi == kullaniciAdi) { KullaniciSifre sifreTemp = lm.SifreGetir(item.KullaniciID); if (sifreTemp.Sifre == sifre) { giris[0] = true; giris[1] = item.AdminMi; } } } return(giris); }
public string AddKullanici(Kullanici item, string sifre) { KullaniciSifre ks = new KullaniciSifre(); if (item.PersonelID != null && !String.IsNullOrEmpty(sifre) && !String.IsNullOrEmpty(item.KullaniciAdi)) { try { ks.KullaniciID = km.AddEntitiy(item); ks.Sifre = sifre; ks.OlusturulmaTarihi = DateTime.Now; ks.OlusturanPersonelID = item.OlusturanPersonelID; ks.AktifMi = true; ksm.AddEntitiy(ks); ksm.SaveEntity(); return("İşlem Başarılı!"); } catch (Exception) { return("Lütfen Girdiğiniz değerleri konrol ediniz."); } } return("Lütfen Girdiğiniz değerleri konrol ediniz."); }