Exemplo n.º 1
0
        public void Add(Student student)
        {
            int lastId = LastIdentity(GetAll());

            student.Identity = lastId;
            LastId           = lastId;
            studentDal.Add(student);
        }
Exemplo n.º 2
0
 public IResult Add(Student student)
 {
     try
     {
         _IStudentDal.Add(student);
         return(new SuccessResult(message: Contants.Messages.AddMessage));
     }
     catch (Exception ex)
     {
         return(new ErrorResult(message: ex.Message));
     }
 }
Exemplo n.º 3
0
        public void Add(StudentDto studentDto)
        {
            //  ValidationAspect.FluentValidate(new StudentValidatior(), studentDto);
            var student = new Student()
            {
                Name    = studentDto.Name,
                Surname = studentDto.Surname,
            };

            _studentDal.Add(student);
            _studentDal.Save();
        }
        public void Add(Student entity)
        {
            if (Validation(entity))
            {
                return;
            }

            if (_studentDal.Get(p => p.Tc.Equals(entity.Tc)) != null)
            {
                return;
            }

            try
            {
                _studentDal.Add(entity);
                Message.Info("Öğrenci Eklendi!");
            }
            catch
            {
                Message.Error("Öğrenci Eklenemedi!");
            }
        }
Exemplo n.º 5
0
        public IResult Add(Student student)
        {
            var entity = new Student()
            {
                Name          = student.Name,
                Surname       = student.Surname,
                StudentNumber = student.StudentNumber,
                Grades        = student.Grades
            };

            _studentDal.Add(entity);
            return(new SuccessResult());
        }
 public IResult Add(Student student)
 {
     student.Fee     = 0;
     student.FeePaid = 0;
     try
     {
         _studentDal.Add(student);
     }
     catch (Exception)
     {
         return(new Result(false, "Student cannot be added"));
     }
     return(new Result(true, "Student added"));
 }
Exemplo n.º 7
0
        public IActionResult Create(Student student)
        {
            var file = Request.Form.Files[0];

            student.PhotoPath = UploadPhoto(file);

            if (ModelState.IsValid)
            {
                _studentDal.Add(student);

                _redisDatabase.KeyDelete("studentList");

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DepartmentId"] = new SelectList(_departmentDal.GetList(), "Id", "Name", student.DepartmentId);
            return(View(student));
        }
Exemplo n.º 8
0
 public Student Add(Student entity)
 {
     return(_studentDal.Add(entity));
 }
 public void Add(Student student)
 {
     _studentDal.Add(student);
 }
 public void Add(Student student)
 {
     ValidationTool.Validate(new StudentValidator(), student);
     _studentDal.Add(student);
 }
 public IResult Add(Student student)
 {
     _studentDal.Add(student);
     return(new SuccessResult(Messages.StudentAdded));
 }
Exemplo n.º 12
0
 public void Add(IStudentDal iStudentDal)
 {
     iStudentDal.Add();
 }
Exemplo n.º 13
0
 public Student AddStudent(Student student)
 {
     return(_studentdal.Add(student));
 }
Exemplo n.º 14
0
 public Student Add(Student student)
 {
     return(_studentDal.Add(student));
 }