Esempio n. 1
0
        public async Task <bool> AddClassRoom(ClassRoomParameter classRoomParameter)
        {
            var classRoom = Mapper.Map <ClassRoomParameter, ClassRoom>(classRoomParameter);

            UnitOfWork.Repo.Add(classRoom);
            return(await UnitOfWork.SaveChanges() > 0);
        }
Esempio n. 2
0
        public async Task <IActionResult> Create(ClassRoomParameter parameter)
        {
            if (ModelState.IsValid)
            {
                var isAdded = await _classRoomBusiness.AddClassRoom(parameter);

                if (isAdded)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(View(parameter));
        }
        public async Task <IActionResult> AddClassRoom(ClassRoomParameter parameter)
        {
            if (ModelState.IsValid)
            {
                var isAdded = await _classRoomBusiness.AddClassRoom(parameter);

                if (isAdded)
                {
                    return(Ok("Saved Successfully"));
                }
            }

            return(BadRequest(ModelState));
        }