Esempio n. 1
0
        public async Task <PartialViewResult> CreateOrEditKiaRcordModal(int?id)
        {
            var output = new KeyResultAreaDto();

            if (id != null)
            {
                try
                {
                    output =
                        _staffPerformanceService.GetKeyResultArea(new GetKraInput {
                        KraId = id.Value
                    });
                }
                catch (Exception exception)
                {
                    //ignored
                }
            }
            var viewModel = new CreateOrEditKeyResultAreaModel(output, id == null || id == 0);

            ViewBag.AttributeId = new SelectList(_staffPerformanceService.GetKeyResultAreaAttributes().Items, "Id", "Name");
            ViewBag.Ratings     = new SelectList(new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10
            });
            return(PartialView(viewModel));
        }
 public CreateOrEditKeyResultAreaModel(KeyResultAreaDto input, bool isNew)
 {
     IsEditMode = !isNew;
     Kra        = input;
 }