public void UpdateIslemDurumu(IslemDurumuModel islemDurumu) { try { var islemDurumuEntity = _islemDurumuDal.GetEntity(islemDurumu.Id); islemDurumuEntity.Adi = islemDurumu.Adi; _islemDurumuDal.UpdateEntity(islemDurumuEntity); } catch (Exception exc) { throw exc; } }
public bool IslemDurumuExists(IslemDurumuModel islemDurumu) { try { if (islemDurumu.Id == 0) { return(_islemDurumuDal.EntityExists(e => e.Adi.ToLower() == islemDurumu.Adi.ToLower())); } return(_islemDurumuDal.EntityExists(e => e.Adi.ToLower() == islemDurumu.Adi.ToLower() && e.Id != islemDurumu.Id)); } catch (Exception exc) { throw exc; } }
public void AddIslemDurumu(IslemDurumuModel islemDurumu) { try { var islemDurumuEntity = new IslemDurumu { Adi = islemDurumu.Adi }; _islemDurumuDal.AddEntity(islemDurumuEntity); } catch (Exception exc) { throw exc; } }
public IActionResult Edit(IslemDurumuModel islemDurumu) { if (ModelState.IsValid) { if (!_islemDurumuService.IslemDurumuExists(islemDurumu)) { _islemDurumuService.UpdateIslemDurumu(islemDurumu); return(RedirectToAction("Index")); } ViewBag.Message = "Girilen işlem durumu mevcuttur."; } _controllerUtil.SetLiActive("IslemDurumu"); ViewBag.LiActives = _controllerUtil.LiActives; var model = new IslemDurumuEditViewModel { IslemDurumu = islemDurumu }; return(View(model)); }