public virtual PartialViewResult CreateLabel(Label label) { if (_labelService.IsExistLabel(label.Name)) { return(PartialView(viewName: MVC.admin.Shared.Views._alert, model: new AlertViewModel { Alert = AlertOperation.SurveyOperation(StatusOperation.DuplicateName), Status = AlertMode.info })); } else { _labelService.Create(label); if (_unitOfWork.SaveAllChanges() > 0) { return(PartialView(viewName: MVC.admin.Shared.Views._alert, model: new AlertViewModel { Alert = AlertOperation.SurveyOperation(StatusOperation.SuccsessInsert), Status = AlertMode.success })); } else { return(PartialView(viewName: MVC.admin.Shared.Views._alert, model: new AlertViewModel { Alert = AlertOperation.SurveyOperation(StatusOperation.FailInsert), Status = AlertMode.warning })); } } }
public bool Create(String name) { return(_service.Create(name)); }
public async Task <Models.Label> Create(string idBoard, string name, string color, string Token) { return(await _labelService.Create(idBoard, name, color, Token)); }
public BaseResponse <LabelOutputDto> Create([FromBody] LabelInputDto labelInputDto) { var userId = User.GetUserId(); return(_labelService.Create(labelInputDto, userId)); }