public bool Guncelle(muhtelif_baslikler model)
        {
            try
            {
                var gelenbaslik = _muhtelifBasliklar.Find(model.id);
                gelenbaslik.baslik_adi      = model.baslik_adi;
                gelenbaslik.para_birimi     = model.para_birimi;
                gelenbaslik.toplama_katilim = model.toplama_katilim;


                _muhtelifBasliklar.Update(gelenbaslik);
                if (_uow.SaveChanges() > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
 public ActionResult MuhtelifGuncelleIslem(muhtelif_baslikler model)
 {
     if (_muhtelifBasliklarService.Guncelle(model) == true)
     {
         return(Json(true, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json(false, JsonRequestBehavior.AllowGet));
     }
 }
예제 #3
0
        public ActionResult BaslikSil(muhtelif_baslikler model)
        {
            var silSonuc = _muhtelifBasliklarService.baslikSil(model);

            if (silSonuc == true)
            {
                return(Json(true, JsonRequestBehavior.AllowGet));
            }

            else
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
예제 #4
0
        public ActionResult KaydetIslem(muhtelif_baslikler model)
        {
            Random random = new Random();
            int    sayi   = random.Next(10, 99);

            model.baslik_kodu = model.baslik_adi.Substring(0, 1) + sayi;

            if (_muhtelifBasliklarService.Kaydet(model) == true)
            {
                return(Json(true, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
 public bool Kaydet(muhtelif_baslikler model)
 {
     try
     {
         _muhtelifBasliklar.Insert(model);
         if (_uow.SaveChanges() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
 public bool baslikSil(muhtelif_baslikler model)
 {
     try
     {
         using (var context = new MyArchContext())
         {
             if (context.Database.ExecuteSqlCommand("DELETE FROM muhtelif_baslikler where id = '" + model.id + "'") > 0)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }