コード例 #1
0
        public async Task <IActionResult> Index()
        {
            var model = new TemplateIndexModel();

            model.CallQuickTemplates = await _templatesService.GetAllCallQuickTemplatesForDepartmentAsync(DepartmentId);

            return(View(model));
        }
コード例 #2
0
ファイル: DispatchController.cs プロジェクト: Resgrid/Core
        public async Task <ActionResult <List <CallTemplateResult> > > GetCallTemplates()
        {
            List <CallTemplateResult> templatesJson = new List <CallTemplateResult>();
            var templates = await _templatesService.GetAllCallQuickTemplatesForDepartmentAsync(DepartmentId);

            foreach (var template in templates)
            {
                CallTemplateResult templateJson = new CallTemplateResult();
                templateJson.Id              = template.CallQuickTemplateId;
                templateJson.IsDisabled      = template.IsDisabled;
                templateJson.Name            = template.Name;
                templateJson.CallName        = template.CallName;
                templateJson.CallNature      = template.CallNature;
                templateJson.CallType        = template.CallType;
                templateJson.CallPriority    = template.CallPriority;
                templateJson.CreatedByUserId = template.CreatedByUserId;
                templateJson.CreatedOn       = template.CreatedOn;

                templatesJson.Add(templateJson);
            }

            return(Ok(templatesJson));
        }