private Task <string> GetTypeBtn(ButtonAccessDto btn) { if (btn.TypeBtn == TypeBtn.Success) { return(Task.FromResult("success")); } if (btn.TypeBtn == TypeBtn.Danger) { return(Task.FromResult("danger")); } return(Task.FromResult("normal")); }
private Task <string> GetStyleMode(ButtonAccessDto btn) { if (btn.StylingMode == StylingMode.Contained) { return(Task.FromResult("contained")); } if (btn.StylingMode == StylingMode.Outlined) { return(Task.FromResult("outlined")); } return(Task.FromResult("contained")); }
private Task <string> GetLocation(ButtonAccessDto btn) { if (btn.Location == Location.After) { return(Task.FromResult("after")); } if (btn.Location == Location.Center) { return(Task.FromResult("center")); } if (btn.Location == Location.Before) { return(Task.FromResult("before")); } return(Task.FromResult("after")); }
/// <summary> /// Добавление или редактирование кнопки /// </summary> /// <param name="fieldDto">Модель для сохранения поля</param> /// <returns>Результат выполнения</returns> public async Task <ResultCrmDb> AddOrEditButtonAsync(ButtonAccessDto fieldDto) { return(await AddOrEditModel(fieldDto, _reportDbContext.ButtonForm)); }
public async Task <IActionResult> SaveButtonByForm([FromBody] ButtonAccessDto model) { return(Tools.CreateResult(true, "", await _reportManager.AddOrEditButtonAsync(model))); }