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);
 }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 4
0
        public void Update(StudentDto studentDto)
        {
            var student = new Student()
            {
                Id      = studentDto.Id,
                Name    = studentDto.Name,
                Surname = studentDto.Surname,
            };

            _studentDal.Update(student);
            _studentDal.Save();
        }
Ejemplo n.º 5
0
        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!");
            }
        }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 10
0
 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));
 }
Ejemplo n.º 12
0
 public void Update(IStudentDal iStudentDal)
 {
     iStudentDal.Update();
 }
 public bool Update(Students entity)
 {
     return(studentDal.Update(entity));
 }
Ejemplo n.º 14
0
 public Student Update(Student student)
 {
     return(_studentDal.Update(student));
 }