First Initial

This commit is contained in:
Nakorn Rientrakrunchai
2020-02-20 15:02:39 +07:00
commit 8b98125e49
3048 changed files with 760804 additions and 0 deletions

View 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_eva03Service
{
rep_eva03WithSelectionViewModel GetWithSelection(Guid id);
rep_eva03WithSelectionViewModel GetBlankItem();
}
}

View File

@@ -0,0 +1,24 @@
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_eva03InputModel
{
public Guid? id { get; set; }
public int? position_type_id { get; set; }
public string active_mode { get; set; }
}
}

View 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_eva03ReportRequestModel : rep_eva03SearchModel
{
public string filetype { get; set; }
public string contentType { get { return MyHelper.GetContentType(filetype); } }
}
}

View 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_eva03SearchModel
{
public int? position_type_id { get; set; }
}
}

View 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
}
}

View File

@@ -0,0 +1,22 @@
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_eva03ViewModel : BaseViewModel2<Guid>
{
public int? position_type_id { get; set; }
public string position_type_id_external_linkage_external_name { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TodoAPI2.Models
{
public class rep_eva03WithSelectionViewModel: rep_eva03ViewModel
{
public List<external_linkageViewModel> item_position_type_id { get; set; }
}
}