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

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