Esempio n. 1
0
        public void DeleteSkill()
        {
            var skillTodel  = skillRepository.GetSkillByDegree(Degree.Competent);
            var skillTodel1 = skillRepository.GetSkillById(2);

            Assert.That(skillTodel, !Is.Null);
            Assert.That(skillTodel1, !Is.Null);

            Assert.IsTrue(skillRepository.Delete(skillTodel), "Something go wrong");
            Assert.IsTrue(skillRepository.Delete(skillTodel1), "skillRepository.Delete(skillTodel1)");
            contextManager.BatchSave();
        }
Esempio n. 2
0
 public OutputBase DeleteSkill(DeleteSkillInput input)
 {
     _skillRepository.Delete(input.SkillId);
     return(new OutputBase {
         Message = "Skill Deleted", Success = true
     });
 }
Esempio n. 3
0
 public void Delete(Skill item)
 {
     if (item.SkillId != null)
     {
         _repository.Delete(Mapping.Mapped.Map <Domain.Entities.Skill>(item));
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Remove skill from table Skill
        /// </summary>
        /// <param name="skill"></param>
        /// <returns></returns>
        public int Delete(string skillName)
        {
            //Retrieves skill id from unique skill name
            var skillId = _iSkillRepository.GetIdBySkillName(skillName);

            return(_iSkillRepository.Delete(skillId));
        }
Esempio n. 5
0
        public void Delete(SkillViewModel model)
        {
            var item = _repository.FindById(model.Id);

            if (item != null)
            {
                _repository.Delete(item);
            }
        }
 public IActionResult Delete(string id)
 {
     if (id != null)
     {
         _repository.Delete(id);
         return(Ok());
     }
     return(BadRequest());
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Skill skill = _SkillsRepository.GetSkillByID(id);

            skill.ObjectState = ObjectState.Deleted;
            _SkillsRepository.Delete(skill);

            _SkillsRepository.Save();
            return(RedirectToAction("Index"));
        }
Esempio n. 8
0
        public ActionResult Delete(int id)
        {
            var apiResult = TryExecute(() =>
            {
                _skillRepository.Delete(id);
                _unitOfWork.Commit();
                return(true);
            }, "Skill deleted sucessfully");

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
Esempio n. 9
0
        public IActionResult SkillDelete(int skillid)
        {
            var entity = _skillRepository.GetById(skillid);

            if (entity != null)
            {
                _skillRepository.Delete(entity);
                return(RedirectToAction("skilllist"));
            }
            return(NotFound());
        }
Esempio n. 10
0
        public JsonResult DeleteSkill(int id)
        {
            Skill skill = _SkillsRepository.GetSkillByID(id);

            skill.ObjectState = ObjectState.Deleted;
            _SkillsRepository.Delete(skill);


            _SkillsRepository.Save();
            return(Json("Deleted record successfully", JsonRequestBehavior.AllowGet));
        }
Esempio n. 11
0
 public bool Delete(int?id)
 {
     if (_skillRepository.Get(id) == null)
     {
         MessageBox.Show("Sorry, your data is not found");
     }
     else
     {
         status = _skillRepository.Delete(id);
     }
     return(status);
 }
Esempio n. 12
0
        public async Task <ActionResult <Skill> > DeleteSkill(int id)
        {
            var skill = await _skillRepository.GetById(id);

            if (skill == null)
            {
                return(NotFound());
            }

            await _skillRepository.Delete(skill);

            return(skill);
        }
        public IActionResult DeleteSkill(int id)
        {
            var skill = _repository.GetById(id);

            if (skill == null)
            {
                return(NotFound());
            }

            _repository.Delete(skill);

            return(NoContent());
        }
        public IActionResult Delete(int id)
        {
            var skill = skillRepository.GetById(id);

            if (skill == null)
            {
                return(NotFound());
            }
            skillRepository.Delete(skill);
            unitofwork.commit();

            return(NoContent());
        }
        public void DeleteSkill(int id)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }
            Skill skill = _SkillsRepository.GetSkillByID(id);

            skill.ObjectState = ObjectState.Deleted;
            _SkillsRepository.Delete(skill);


            _SkillsRepository.Save();
        }
        public IActionResult Delete(int id)
        {
            var skill = _skillRepository.GetSkill(id);

            if (skill == null)
            {
                return(new NotFoundResult());
            }
            var skillId = skill.Id;

            _skillRepository.Delete(skill);
            _skillRepository.Commit();
            _workerService.RegisterTask("clean", skillId);
            return(NoContent());
        }
Esempio n. 17
0
        public async Task <IActionResult> Delete(int id)
        {
            _logger.LogDebug("Starting delete");

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var skill = _skillRepository.GetSingle(id);

            _skillRepository.Delete(skill);
            await _skillRepository.SaveChangesAsync();

            _logger.LogDebug("Finished delete");

            return(new NoContentResult());
        }
        public async Task <ActionResult> DeleteSkill(int id)
        {
            try
            {
                var skillToDelete = await _repository.GetSkillId(id);

                if (skillToDelete == null)
                {
                    return(NotFound($"Skill with Id = {id} not found"));
                }

                return(Ok(await _repository.Delete(id)));
            }
            catch (System.Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  "There were error in deleting the data from the database!"));
            }
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(RedirectToPage("/SkillNotFound"));
            }

            Skill = await _repository.GetSkillId(id.Value);

            if (Skill == null)
            {
                return(RedirectToPage("/SkillNotFound"));
            }
            Skill agent = await _repository.Delete(Skill.SkillId);

            if (agent == null)
            {
                return(RedirectToPage("/DatabaseError"));
            }
            return(RedirectToPage("Index"));
        }
Esempio n. 20
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                _logger.LogInfo($"Skill Delete attempted - id: {id}");
                if (string.IsNullOrWhiteSpace(id.ToString()))
                {
                    _logger.LogWarn($"Skill Delete failed: no  id was provided.");
                    return(BadRequest());
                }
                var isExists = await _skillRepository.IsExists(id);

                if (!isExists)
                {
                    _logger.LogWarn($"Skill Update failed: no Skill with id: {id} was found.");
                    return(NotFound());
                }
                if (!ModelState.IsValid)
                {
                    _logger.LogWarn($"Skill Data was Invalid.");
                    return(BadRequest(ModelState));
                }
                var skill = await _skillRepository.FindById(id);

                var isSuccess = await _skillRepository.Delete(skill);

                if (!isSuccess)
                {
                    return(InternalError($"Delete Skill Operation failed."));
                }

                _logger.LogWarn($"Skill with id: {id} successfully deleted.");
                return(NoContent());
            }
            catch (Exception e)
            {
                return(InternalError($"{e.Message} - {e.InnerException}"));
            }
        }
Esempio n. 21
0
        public IActionResult DeleteSkill([FromQuery] int skillId)
        {
            var lang          = Request.Headers["language"].ToString();
            var errorMessages = new List <string>();

            try
            {
                var skill = _skillRepository.FindById(skillId);
                if (skill == null)
                {
                    return(NotFound());
                }

                var deletedSkill = _skillRepository.Delete(skillId);

                return(Ok(new { deletedSkillId = deletedSkill.Id, categoryId = skill.CategoryId }));
            }
            catch
            {
                errorMessages.Add(_translator.GetTranslation("ERROR", lang));
                return(BadRequest(new { errors = errorMessages }));
            }
        }
 public bool DeleteSkill(int?Id)
 {
     return(_iSkillRepository.Delete(Id));
 }
Esempio n. 23
0
 public void Delete(string id)
 {
     _repository.Delete(id);
 }
Esempio n. 24
0
 // DELETE api/<controller>/5
 public void Delete(string id)
 {
     _skillRepository.Delete(Guid.Parse(id));
 }
Esempio n. 25
0
 public void Delete(int id) => _skillRepository.Delete(id);
Esempio n. 26
0
 public IActionResult Delete(int id)
 {
     _skillRepository.Delete(id);
     return(NoContent());
 }
Esempio n. 27
0
 public void Delete(Guid entityId)
 {
     repository.Delete(entityId);
 }
Esempio n. 28
0
 public void Delete(Int32 id)
 {
     repository.Delete(repository.GetById(id));
 }
Esempio n. 29
0
 public IActionResult Delete(Guid ProyectoId)
 {
     repository.Delete(ProyectoId);
     return(Ok(true));
 }
Esempio n. 30
0
 public IActionResult Delete(string id)
 {
     _repository.Delete(id);
     return(Ok());
 }