public ActionResult Guncelle(Kullanici model, string yeniSifre) { Kullanici kullanici = Session["loginSU"] as Kullanici; if (model.Sifre != kullanici.Sifre) { TempData["Message"] = new TempDataDictionary { { "class", "alert alert-danger" }, { "msg", "Şifre Hatalı" } }; return(RedirectToAction("Guncelle", new { id = model.KullaniciId })); } else { using (KullaniciRepository repo = new KullaniciRepository()) { bool result = repo.Create(model); TempData["Message"] = result == true ? new TempDataDictionary { { "class", "alert alert-success" }, { "msg", "İşletme Güncellendi" } } : new TempDataDictionary { { "class", "alert alert-danger" }, { "msg", "İşletme Güncellenemedi" } }; return(RedirectToAction("Liste")); } } }
public ActionResult Liste() { using (KullaniciRepository repo = new KullaniciRepository()) { return(View(repo.GetList())); } }
public List <KullaniciDTO> Get(int sirketId) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { var model = kullaniciRepo.Get(); var Kullanicilar = new List <KullaniciDTO>(); foreach (var ent in model.ToList()) { if (ent.rolID == 1 && ent.sirketID == sirketId) { var kullanicidto = new KullaniciDTO(); kullanicidto.adi = ent.adi; kullanicidto.kullaniciID = ent.kullaniciID; kullanicidto.password = ent.password; kullanicidto.rol = ent.Rol.rol1; kullanicidto.rolID = ent.rolID; kullanicidto.sirketAdi = ent.Sirket.sirketAdi; kullanicidto.sirketID = ent.sirketID; kullanicidto.soyadi = ent.soyadi; kullanicidto.username = ent.username; Kullanicilar.Add(kullanicidto); } } return(Kullanicilar); } catch (Exception ex) { throw; } } }
public KullaniciDTO GetById(int id) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { var ent = kullaniciRepo.GetById(id); var kullanicidto = new KullaniciDTO(); kullanicidto.adi = ent.adi; kullanicidto.kullaniciID = ent.kullaniciID; kullanicidto.password = ent.password; kullanicidto.rol = ent.Rol.rol1; kullanicidto.rolID = ent.rolID; kullanicidto.sirketAdi = ent.Sirket.sirketAdi; kullanicidto.sirketID = ent.sirketID; kullanicidto.soyadi = ent.soyadi; kullanicidto.username = ent.username; return(kullanicidto); } catch (Exception ex) { throw; } } }
public ActionResult Index() { Kullanici user = Session["loginSU"] as Kullanici; KategoriMenuUrunKullaniciModel model = new KategoriMenuUrunKullaniciModel(); if (user.Yetki == (int)EnumYetki.Admin) { using (KategoriRepository repo = new KategoriRepository()) { model.KategoriList = repo.GetList(); } using (MenuRepository repo = new MenuRepository()) { model.MenuList = repo.GetList(); } using (UrunRepository repo = new UrunRepository()) { model.UrunList = repo.GetList(); } using (KullaniciRepository repo = new KullaniciRepository()) { model.KullaniciList = repo.GetList(); } return(View(model)); } else if (user.Yetki == (int)EnumYetki.Isletme) { using (IsletmeUrunRepository repo = new IsletmeUrunRepository()) { ViewBag.IsletmeUrunList = repo.IsletmeninUrunleri(user.KullaniciId); } } return(View()); }
public ActionResult Login(LoginViewModel model) { if (ModelState.IsValid) { using (KullaniciRepository repo = new KullaniciRepository()) { Kullanici durum = repo.Getir(x => x.KullaniciAdi == model.KullaniciAdi && x.Parola == model.Parola && x.Silindi == false); if (durum != null) { //TempData["Mesaj"] = new TempDataDictionary { { "class", "alert alert-success" }, { "mesaj", "Başarılı." } }; //TempData["Mesaj"] = new TempDataDictionary { { "class", "alert alert-success" }, { "mesaj", "Başarılı." } }; Session["User"] = durum; durum.SonGirisZamani = DateTime.Now; repo.Guncelle(durum); return(RedirectToAction("Index", "Home")); } else { //TempData["Mesaj"] = new TempDataDictionary { { "class", "alert alert-danger" }, { "mesaj", "Başarısız." } }; TempData["Mesaj"] = "Yanlış kullanıcı adı veya parola"; return(View()); } } } //TempData["Mesaj"] = new TempDataDictionary { { "class", "alert alert-danger" }, { "mesaj", "Bilgileri eksiksiz giriniz." } }; TempData["Mesaj"] = "LÜtfen bilgileri eksiksiz giriniz."; return(View()); }
public void Delete(int id) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { kullaniciRepo.Delete(id); using (KullaniciBilgileriRepository kullaniciBilRepo = new KullaniciBilgileriRepository()) { try { kullaniciBilRepo.Delete(id); } catch { throw; } } } catch { throw; } } }
public Unit(PlutoContext context) { _context = context; KuaforAktiflik = new KuaforAktiflikRepository(_context); KuaforAnketCevap = new KuaforAnketCevapRepository(_context); KuaforAnket = new KuaforAnketRepository(_context); KuaforElemanlari = new KuaforElemanlariRepository(_context); KuaforFirsat = new KuaforFirsatRepository(_context); Kuaforler = new KuaforlerRepository(_context); KuaforMesaj = new KuaforMesajRepository(_context); KuaforPuan = new KuaforPuanRepository(_context); KuaforSaatleri = new KuaforSaatleriRepository(_context); KuaforSahip = new KuaforSahipRepository(_context); KuaforSira = new KuaforSiraRepository(_context); KuaforTrasCesitleri = new KuaforTrasCesitleriRepository(_context); KuaforTrasSaatiAralik = new KuaforTrasSaatiAralikRepository(_context); KuaforYorum = new KuaforYorumRepository(_context); KullaniciCuzdan = new KullaniciCuzdanRepository(_context); KullaniciFavorileri = new KullaniciFavorileriRepository(_context); KullaniciIslemleri = new KullaniciIslemleriRepository(_context); Kullanici = new KullaniciRepository(_context); KullaniciRozet = new KullaniciRozetRepository(_context); Rozetler = new RozetlerRepository(_context); YeniEklenenKuaforler = new YeniEklenenKuaforlerRepository(_context); Yonetici = new YoneticiRepository(_context); }
public IList <Kullanici> KullanicilariGetir() { using (var context = new DbContext(connectionFactory)) { var kullaniciRepo = new KullaniciRepository(context); return(kullaniciRepo.KullanicilariGetir()); } }
public ActionResult Index() { using (KullaniciRepository repo = new KullaniciRepository()) { var model = repo.Listele(); return(View(model)); } }
public ActionResult Delete(int id) { using (var repo = new KullaniciRepository()) { var model = repo.Getir(x => x.Id == id); return(View(model)); } }
public int KullaniciSil(Kullanici kullanici) { using (var context = new DbContext(connectionFactory)) { var kullaniciRepo = new KullaniciRepository(context); return(kullaniciRepo.KullaniciSil(kullanici)); } }
public Kullanici KullaniciGuncelle(Kullanici kullanici) { using (var context = new DbContext(connectionFactory)) { var kullaniciRepo = new KullaniciRepository(context); return(kullaniciRepo.KullaniciGuncelle(kullanici)); } }
public KullaniciFotograflariController(KullaniciRepository repo, IOptions <FotografAyarlari> fotografAyarlari, IHostingEnvironment host, IMapper mapper, IOptions <CloudinarySettings> cloudinaryConfig) { this.repo = repo; this.fotografAyarlari = fotografAyarlari.Value; this.host = host; this.cloudinaryConfig = cloudinaryConfig; Account acc = new Account(cloudinaryConfig.Value.CloudName, cloudinaryConfig.Value.ApiKey, cloudinaryConfig.Value.ApiSecret); cloudinary = new Cloudinary(acc); }
public UnitOfWork(SOHTSContext context) { _SOHTSContext = context; CikisRepository = new CikisRepository(_SOHTSContext); HastaRepository = new HastaRepository(_SOHTSContext); IslemRepository = new IslemRepository(_SOHTSContext); KullaniciRepository = new KullaniciRepository(_SOHTSContext); PoliklinikRepository = new PoliklinikRepository(_SOHTSContext); SevkRepository = new SevkRepository(_SOHTSContext); }
/// <summary> /// Email adresinin sistemde var olup olmadığının kontrolünü sağlar. /// </summary> /// <param name="emailAdress"></param> /// <returns></returns> public bool checkEmailControl(string emailAdress) { brokenRules = new StringBuilder(); KullaniciRepository repo = new KullaniciRepository(); if (repo.GetUserList(x => x.Email == emailAdress) != null) { brokenRules.AppendLine("Daha önce kullanılmış bir email adresi ile tekrar kayıt işlemi gerçekleştirilemez."); return(true); } return(false); }
public void Add(Kullanici model) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { kullaniciRepo.Add(model); } catch (Exception ex) { throw; } } }
public ActionResult Sil(int id, string path) { using (KullaniciRepository repo = new KullaniciRepository()) { bool result = repo.Delete(id); TempData["Message"] = result == true ? new TempDataDictionary { { "class", "alert alert-success" }, { "msg", "İşletme silindi" } } : new TempDataDictionary { { "class", "alert alert-danger" }, { "msg", "İşletme silinemedi" } }; return(RedirectToAction("Liste")); } }
public ActionResult Ekle(Kullanici model) { using (KullaniciRepository repo = new KullaniciRepository()) { model.Sifre = Guid.NewGuid().ToString(); bool result = repo.Create(model); TempData["Message"] = result == true ? new TempDataDictionary { { "class", "alert alert-success" }, { "msg", "İşletme eklendi." } } : new TempDataDictionary { { "class", "alert alert-danger" }, { "msg", "İşletme eklenemedi." } }; return(RedirectToAction("Liste")); } }
public void Delete(int id) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { kullaniciRepo.Delete(id); } catch (Exception ex) { throw; } } }
public ActionResult Guncelle(int id) { Kullanici kullanici = Session["loginSU"] as Kullanici; if (id == kullanici.KullaniciId) { using (KullaniciRepository repo = new KullaniciRepository()) { Kullanici model = repo.GetOne(f => f.KullaniciId == id); return(View(model)); } } return(RedirectToAction("Index", "Main")); }
public bool UpdateKullanici(Kullanici entity) { try { bool isSuccess; using (var repo = new KullaniciRepository()) { isSuccess = repo.Update(entity); } return(isSuccess); } catch (Exception ex) { throw new Exception("KullaniciBusiness:KullaniciRepository:Güncelleme Hatası", ex); } }
public bool KullaniciDelete(int KullaniciId) { try { bool isSuccess; using (var repo = new KullaniciRepository()) { isSuccess = repo.Delete(KullaniciId); } return(isSuccess); } catch (Exception ex) { throw new Exception("KullaniciBusiness:KullaniciRepository:Silme Hatası", ex); } }
public bool InsertKullanici(Kullanici entity) { try { bool isSuccess; using (var repo = new KullaniciRepository()) { isSuccess = repo.Insert(entity); } return(isSuccess); } catch (Exception ex) { throw new Exception("SOABusiness:KullaniciBusiness::InsertKullanici::Error occured.", ex); } }
public List <KullaniciDTO> Get() { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { var model = kullaniciRepo.Get(x => x.KullaniciBilgileri, x => x.KullaniciBilgileri.Il, x => x.KullaniciBilgileri.Ilce, x => x.Randevu, x => x.Rol, x => x.Favori).ToList(); return(kullaniciMapper.MapAll(model)); } catch { throw; } } }
public KullaniciDTO GetById(int id) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { var model = kullaniciRepo.GetById(x => x.kullaniciID == id, x => x.KullaniciBilgileri, x => x.KullaniciBilgileri.Il, x => x.KullaniciBilgileri.Ilce, x => x.Randevu, x => x.Rol, x => x.Favori); return(kullaniciMapper.Map(model)); } catch { throw; } } }
public ActionResult Login(Kullanici model) { using (KullaniciRepository repo = new KullaniciRepository()) { Kullanici user = repo.CheckUser(model); if (user != null) { Session["loginSU"] = user; return(RedirectToAction("Index")); } TempData["Message"] = new TempDataDictionary { { "class", "alert alert-danger" }, { "msg", "Hatalı kullanıcı Adı/Şifre" } }; return(RedirectToAction("Login")); } }
public Kullanici KullaniciAnahtarSec(string Anahtar) { try { Kullanici responseEntitiy = null; using (var repo = new KullaniciRepository()) { responseEntitiy = repo.KeySec(Anahtar); } return(responseEntitiy); } catch (Exception ex) { throw new Exception("KullaniciBusiness:KullaniciRepository:Key Seçme Hatası", ex); } }
public Kullanici KullaniciSecIsim(string kullaniciAdi) { try { Kullanici responseEntitiy = null; using (var repo = new KullaniciRepository()) { responseEntitiy = repo.KullaniciAdSec(kullaniciAdi); } return(responseEntitiy); } catch (Exception ex) { throw new Exception("KullaniciBusiness:KullaniciRepository:KullaniciAdi Seçme Hatası", ex); } }
public Kullanici KullaniciIdSec(int KullaniciId) { try { Kullanici responseEntitiy = null; using (var repo = new KullaniciRepository()) { responseEntitiy = repo.IdSec(KullaniciId); } return(responseEntitiy); } catch (Exception ex) { throw new Exception("KullaniciBusiness:KullaniciRepository:Seçme Hatası", ex); } }