Beispiel #1
0
        public Result <StudentResultDTO> CreateStudent(StudentAddModel model)
        {
            var check = studentDAL.Get(w => w.UserID == model.UserID && w.Class_ID == model.ClassID);

            if (check != null)
            {
                var checkuser = userDAL.Get(w => w.ID == model.UserID && w.UserType == Entity.Concrete.UserType.Student);
                if (checkuser == null)
                {
                    return(new Result <StudentResultDTO>(true, "boyle bir kullanici yok", null));
                }
                Student student = new Student()
                {
                    UserID   = model.UserID,
                    Class_ID = model.ClassID
                };

                studentDAL.Add(student);
                return(new Result <StudentResultDTO>(false, "isleminizi basari ile gerceklemistir", null));
            }
            else
            {
                return(new Result <StudentResultDTO>(true, "boyle bir kayit mevcuttur", null));
            }
        }
 public List <Student> Get()
 {
     return(db.Get());
 }
Beispiel #3
0
 public student GetByID(int ID)
 {
     return(studentDAL.Get(ID));
 }
Beispiel #4
0
 public Student GetById(int id)
 {
     return(_studentDAL.Get(a => a.StudentID == id));
 }