First Initial
This commit is contained in:
23
Models/rep_eva02/Irep_eva02Service.cs
Normal file
23
Models/rep_eva02/Irep_eva02Service.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public interface Irep_eva02Service
|
||||
{
|
||||
|
||||
rep_eva02WithSelectionViewModel GetWithSelection(Guid id);
|
||||
rep_eva02WithSelectionViewModel GetBlankItem();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
26
Models/rep_eva02/rep_eva02InputModel.cs
Normal file
26
Models/rep_eva02/rep_eva02InputModel.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_eva02InputModel
|
||||
{
|
||||
|
||||
public Guid? id { get; set; }
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
21
Models/rep_eva02/rep_eva02ReportRequestModel.cs
Normal file
21
Models/rep_eva02/rep_eva02ReportRequestModel.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_eva02ReportRequestModel : rep_eva02SearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
23
Models/rep_eva02/rep_eva02SearchModel.cs
Normal file
23
Models/rep_eva02/rep_eva02SearchModel.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_eva02SearchModel
|
||||
{
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
81
Models/rep_eva02/rep_eva02Service.cs
Normal file
81
Models/rep_eva02/rep_eva02Service.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Net;
|
||||
using TTSW.Configure;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Data;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_eva02Service : Irep_eva02Service
|
||||
{
|
||||
private IBaseRepository<eva_level_scoreEntity, Guid> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
|
||||
public rep_eva02Service(IBaseRepository<eva_level_scoreEntity, Guid> repository, IMyDatabase mydb, Iexternal_linkageService inext)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_level_scoreEntity GetEntity(rep_eva02InputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_level_scoreEntity>(model);
|
||||
}
|
||||
private List<eva_level_scoreEntity> GetEntityList(List<rep_eva02InputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_level_scoreEntity>>(models);
|
||||
}
|
||||
private rep_eva02ViewModel GetDto(eva_level_scoreEntity entity)
|
||||
{
|
||||
return Mapper.Map<rep_eva02ViewModel>(entity);
|
||||
}
|
||||
private List<rep_eva02ViewModel> GetDtoList(List<eva_level_scoreEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<rep_eva02ViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public rep_eva02WithSelectionViewModel GetWithSelection(Guid id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<rep_eva02WithSelectionViewModel>(entity);
|
||||
i.item_org_id = (from x in ext.GetDepartmentDataForReport() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public rep_eva02WithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new rep_eva02WithSelectionViewModel();
|
||||
i.item_org_id = (from x in ext.GetDepartmentDataForReport() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
25
Models/rep_eva02/rep_eva02ViewModel.cs
Normal file
25
Models/rep_eva02/rep_eva02ViewModel.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_eva02ViewModel : BaseViewModel2<Guid>
|
||||
{
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public string org_id_external_linkage_external_name { get; set; }
|
||||
public string round_id_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
14
Models/rep_eva02/rep_eva02WithSelectionViewModel.cs
Normal file
14
Models/rep_eva02/rep_eva02WithSelectionViewModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_eva02WithSelectionViewModel: rep_eva02ViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_org_id { get; set; }
|
||||
public List<external_linkageViewModel> item_round_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user