12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using Microsoft.AspNetCore.Components;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.Json;
- using System.Threading.Tasks;
- using wispro.sp.entity;
- using wispro.sp.web.Services;
- namespace wispro.sp.web.Models
- {
- public class CreateAppealModel
- {
- public PerformanceItem Item { get; set; }
- public AppealType AppealType { get; set; }
- private List<InputField> inputFields;
- public List<InputFieldValue> inputFieldValues { get; set; }
- public AppealRecord AppealRecord { get; set; }
-
- public CreateAppealModel() { }
-
-
- public async Task Init(AppealTypeService _atService,PerformanceItem item,AppealType appealType)
- {
- Item = item;
- AppealType = appealType;
- AppealRecord = new AppealRecord();
- AppealRecord.TypeId = appealType.Id;
- AppealRecord.ItemId = item.Id;
- AppealRecord.State = 0;
- if (AppealType != null)
- {
- inputFieldValues = new List<InputFieldValue>();
- Console.WriteLine($"CreateAppealModel:{JsonSerializer.Serialize(AppealType)}");
- if(_atService == null)
- {
- Console.WriteLine($"CreateAppealModel:_atService = null");
- }
- inputFields =await _atService.GetInputFields(AppealType.Id, 0);
- foreach (var field in inputFields)
- {
- var fValue = new InputFieldValue();
- fValue.InputField = field;
- fValue.InputFieldId = field.Id;
- inputFieldValues.Add(fValue);
- }
- }
-
- }
- }
- }
|