Example #1
0
 public bool BlokGuncelle(EBlokDTO model)
 {
     try
     {
         var gelenBlok = _blokRepository.Find(model.id);
         AutoMapper.Mapper.DynamicMap(model, gelenBlok);
         _blokRepository.Update(gelenBlok);
         if (_uow.SaveChanges() != 0)
         {
             using (var context = new MyArchContext())
             {
                 if (context.Database.ExecuteSqlCommand("update bagimsiz_bolumler set blok_adi='" + model.blok_adi + "' where blok_id = '" + model.id + "'") > 0)
                 {
                     return(true);
                 }
                 else
                 {
                     return(false);
                 }
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception msg)
     {
         throw msg;
     }
 }
Example #2
0
 public BlokService(UnitofWork uow)
 {
     _uow                     = uow;
     _blokRepository          = _uow.GetRepository <blok>();
     _bagimsizBolumRepository = _uow.GetRepository <bagimsiz_bolumler>();
     _blokDTO                 = new EBlokDTO();
 }
        public ActionResult BlokDaireleri(int id)
        {
            EBlokDTO daireSayisi = _blokService.BlokDaireleri(id);

            if (daireSayisi.daire_sayisi != null)
            {
                return(Json(daireSayisi.daire_sayisi, JsonRequestBehavior.AllowGet));
            }

            else
            {
                return(Json(true, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult BlokGuncelle(EBlokDTO model)
        {
            bool durum = _blokService.BlokGuncelle(model);

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

            else
            {
                return(Json(true, JsonRequestBehavior.AllowGet));
            }
        }