Exemplo n.º 1
0
        public Firma GirisYapanFirma(string kullaniciAdi, string sifre)
        {
            List <Firma> Firmalar = new FirmaRepo().GetAll().Where(x => x.AktifMi).ToList();
            Firma        Firma    = Firmalar.FirstOrDefault(x => x.KullanıcıAdi == kullaniciAdi && x.Sifre == sifre);

            return(Firma);
        }
Exemplo n.º 2
0
        public void KullaniciAdiKontrol(string kullaniciAdi, string tckn, string email, string telefon)
        {
            List <Yonetici> Yoneticiler = new YoneticiRepo().GetAll();

            foreach (var item in Yoneticiler)
            {
                if (item.KullanıcıAdi == kullaniciAdi)
                {
                    throw new Exception("Bu kullanıcı adı zaten mevcut");
                }
                if (item.TCKN == tckn)
                {
                    throw new Exception("TCKN numarası daha önce kullanılmış");
                }
                if (item.Telefon == telefon)
                {
                    throw new Exception("Telefon numarası daha önce kullanılmış");
                }
            }
            List <Firma> Firmalar = new FirmaRepo().GetAll();

            foreach (var item in Firmalar)
            {
                if (item.KullanıcıAdi == kullaniciAdi)
                {
                    throw new Exception("Bu kullanıcı adı zaten mevcut");
                }
            }
            List <Musteri> Musteriler = new MusteriRepo().GetAll();

            foreach (var item in Musteriler)
            {
                if (item.KullanıcıAdi == kullaniciAdi)
                {
                    throw new Exception("Bu kullanıcı adı zaten mevcut");
                }
                if (item.TCKN == tckn)
                {
                    throw new Exception("TCKN numarası daha önce kullanılmış");
                }
                if (item.Email == email)
                {
                    throw new Exception("Bu email adresi kullanılıyor");
                }
                if (item.Telefon == telefon)
                {
                    throw new Exception("Telefon numarası daha önce kullanılmış");
                }
            }
        }
Exemplo n.º 3
0
        public Firma FirmayiGetir(int firmaid)
        {
            Firma firma = new FirmaRepo().GetAll().FirstOrDefault(x => x.ID == firmaid);

            return(firma);
        }