Esempio n. 1
0
        public IActionResult Index(ModelUser model)
        {
            tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       user            = new ModelUser();

            user.name    = tblKullanicilar.Isim;
            user.surname = tblKullanicilar.Soyisim;
            if (model.cat == 1)
            {
                tblKanun temp = new tblKanun();
                temp.Adi   = model.baslik;
                temp.Id    = _ItblKanunService.GetAll().ToList().Count + 1;
                temp.Url   = model.url;
                temp.aktif = 0;
                _ItblKanunService.Add(temp);
                model.isSuccessfull = true;
            }
            else if (model.cat == 2)
            {
                tblyonetmenlik temp = new tblyonetmenlik();
                temp.Adi   = model.baslik;
                temp.Id    = _ItblYonetmenlikService.GetAll().ToList().Count + 1;
                temp.Url   = model.url;
                temp.aktif = 0;
                _ItblYonetmenlikService.Add(temp);

                model.isSuccessfull = true;
            }
            else
            {
                user.isSuccessfull = false;
            }

            return(View(user));
        }
 public void Update(tblKanun entity)
 {
     _tblKanunDal.Update(entity);
 }
 public void Delete(tblKanun entity)
 {
     _tblKanunDal.Delete(entity);
 }
 public void Add(tblKanun entity)
 {
     _tblKanunDal.Insert(entity);
 }