示例#1
0
 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"));
 }
示例#2
0
 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"));
 }
示例#3
0
 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));
 }
示例#5
0
 public async Task <IActionResult> SaveButtonByForm([FromBody] ButtonAccessDto model)
 {
     return(Tools.CreateResult(true, "", await _reportManager.AddOrEditButtonAsync(model)));
 }