Exemple #1
0
 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
             }));
         }
     }
 }
Exemple #2
0
 public bool Create(String name)
 {
     return(_service.Create(name));
 }
Exemple #3
0
 public async Task <Models.Label> Create(string idBoard, string name, string color, string Token)
 {
     return(await _labelService.Create(idBoard, name, color, Token));
 }
Exemple #4
0
        public BaseResponse <LabelOutputDto> Create([FromBody] LabelInputDto labelInputDto)
        {
            var userId = User.GetUserId();

            return(_labelService.Create(labelInputDto, userId));
        }