public bool AddFee(int studentId, decimal fee) { try { var result = GetById(studentId).Data; result.Fee += fee; _studentDal.Update(result); } catch (Exception) { return(false); } return(true); }
public IActionResult Edit(Student student) { if (ModelState.IsValid) { _studentDal.Update(student); return(RedirectToAction(nameof(Index))); } ViewData["DepartmentId"] = new SelectList(_departmentDal.GetList(), "Id", "Name", student.DepartmentId); return(View(student)); }
public IResult Update(Student student) { try { _IStudentDal.Update(student); return(new SuccessResult(message: Contants.Messages.UpdateMessage)); } catch (Exception ex) { return(new ErrorResult(message: ex.Message)); } }
public void Update(StudentDto studentDto) { var student = new Student() { Id = studentDto.Id, Name = studentDto.Name, Surname = studentDto.Surname, }; _studentDal.Update(student); _studentDal.Save(); }
public IResult Update(Student student) { var result = _studentDal.Get(f => f.Id == student.Id); if (result != null) { result.Name = student.Name; result.StudentNumber = student.StudentNumber; result.Surname = student.Surname; result.Grades = student.Grades; _studentDal.Update(result); return(new SuccessDataResult <Student>(result)); } return(new ErrorResult(Messages.DoesntExist)); }
public void Update(Student entity) { if (Validation(entity)) { return; } if (_studentDal.Get(p => p.Id != entity.Id && p.Tc.Equals(entity.Tc)) != null) { Message.Error("Tc Kimlik numarası hatalı!\nBu tc kimlik numarası ile başka bir öğrenci kayıtlı."); return; } try { _studentDal.Update(entity); Message.Info("Öğrenci Güncellendi!"); } catch { Message.Error("Öğrenci Güncellenemedi!"); } }
public Student Update(Student entity) { return(_studentDal.Update(entity)); }
public void Update(Student student) { _studentDal.Update(student); }
public void Update(Student student) { ValidationTool.Validate(new StudentValidator(), student); _studentDal.Update(student); }
public async Task <Student> Update(Student student) { return(await _studentDal.Update(student)); }
public IResult Update(Student student) { _studentDal.Update(student); return(new SuccessResult(Messages.StudentUpdated)); }
public void Update(IStudentDal iStudentDal) { iStudentDal.Update(); }
public bool Update(Students entity) { return(studentDal.Update(entity)); }
public Student Update(Student student) { return(_studentDal.Update(student)); }