First Initial
This commit is contained in:
80
Models/rep_eva03/rep_eva03Service.cs
Normal file
80
Models/rep_eva03/rep_eva03Service.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
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_eva03Service : Irep_eva03Service
|
||||
{
|
||||
private IBaseRepository<eva_level_scoreEntity, Guid> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
|
||||
public rep_eva03Service(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_eva03InputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_level_scoreEntity>(model);
|
||||
}
|
||||
private List<eva_level_scoreEntity> GetEntityList(List<rep_eva03InputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_level_scoreEntity>>(models);
|
||||
}
|
||||
private rep_eva03ViewModel GetDto(eva_level_scoreEntity entity)
|
||||
{
|
||||
return Mapper.Map<rep_eva03ViewModel>(entity);
|
||||
}
|
||||
private List<rep_eva03ViewModel> GetDtoList(List<eva_level_scoreEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<rep_eva03ViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public rep_eva03WithSelectionViewModel GetWithSelection(Guid id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<rep_eva03WithSelectionViewModel>(entity);
|
||||
i.item_position_type_id = (from x in ext.Gethrm_position_types() select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public rep_eva03WithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new rep_eva03WithSelectionViewModel();
|
||||
i.item_position_type_id = (from x in ext.Gethrm_position_types() select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user