public IActionResult Index(UserViewModel model) { var returnModel = new ReturnModel(); if (!ModelState.IsValid) { returnModel.IsSuccess = false; returnModel.Message = "Formu Eksiksiz Doldurunuz"; return(Ok(returnModel)); } var confirmTc = IdentityControl.TcNo(model.InsuredUser.IdentityNo); if (!confirmTc) { returnModel.IsSuccess = false; returnModel.Message = "TC KİMLİK HATASI"; return(Ok(returnModel)); } var newInsured = new InsuredUser { FirstName = model.InsuredUser.FirstName, LastName = model.InsuredUser.LastName, PolicyNo = model.InsuredUser.PolicyNo, IdentityNo = model.InsuredUser.IdentityNo, CityId = model.InsuredUser.CityId, DistrictId = model.InsuredUser.DistrictId, RezervDate = model.InsuredUser.RezervDate, IsConfirm = false, CreatedBy = string.Format("{0} {1}", model.InsuredUser.FirstName, model.InsuredUser.LastName), CreatedDate = DateTime.Now, UpdatedBy = string.Format("{0} {1}", model.InsuredUser.FirstName, model.InsuredUser.LastName), UpdatedDate = DateTime.Now }; try { _insuredUserService.Add(newInsured); returnModel.IsSuccess = true; returnModel.Message = "Kayıt Başarılı"; } catch (Exception ex) { returnModel.Message = "Hata Oluştu" + ex.Message; } return(Ok(returnModel)); }
public void Update(InsuredUser insuredUser) { _repository.Update(insuredUser); }
public void Delete(InsuredUser insuredUser) { _repository.Delete(insuredUser); }
public void Add(InsuredUser insuredUser) { _repository.Add(insuredUser); }