Add new report
This commit is contained in:
@@ -60,7 +60,6 @@ namespace TodoAPI2.Models
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public rep_eva01WithSelectionViewModel GetBlankItem()
|
||||
@@ -69,7 +68,6 @@ namespace TodoAPI2.Models
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -82,4 +80,5 @@ namespace TodoAPI2.Models
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
Models/rep_summary_a01/Irep_summary_a01Service.cs
Normal file
22
Models/rep_summary_a01/Irep_summary_a01Service.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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_summary_a01Service
|
||||
{
|
||||
|
||||
rep_summary_a01WithSelectionViewModel GetWithSelection(Guid id);
|
||||
rep_summary_a01WithSelectionViewModel GetBlankItem();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
28
Models/rep_summary_a01/rep_summary_a01InputModel.cs
Normal file
28
Models/rep_summary_a01/rep_summary_a01InputModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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_summary_a01InputModel
|
||||
{
|
||||
|
||||
public Guid? id { get; set; }
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
21
Models/rep_summary_a01/rep_summary_a01ReportRequestModel.cs
Normal file
21
Models/rep_summary_a01/rep_summary_a01ReportRequestModel.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_summary_a01ReportRequestModel : rep_summary_a01SearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
27
Models/rep_summary_a01/rep_summary_a01SearchModel.cs
Normal file
27
Models/rep_summary_a01/rep_summary_a01SearchModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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_summary_a01SearchModel
|
||||
{
|
||||
|
||||
public Guid id { get; set; }
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
56
Models/rep_summary_a01/rep_summary_a01Service.cs
Normal file
56
Models/rep_summary_a01/rep_summary_a01Service.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
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_summary_a01Service : Irep_summary_a01Service
|
||||
{
|
||||
private IBaseRepository<eva_level_scoreEntity, Guid> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
|
||||
public rep_summary_a01Service(IBaseRepository<eva_level_scoreEntity, Guid> repository, IMyDatabase mydb, Iexternal_linkageService inext, Iexternal_employeeService inemp)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
public rep_summary_a01WithSelectionViewModel GetWithSelection(Guid id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<rep_summary_a01WithSelectionViewModel>(entity);
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
i.item_employee_id = (from x in emp.GetListByemployee_type(null, null) orderby x.fullname select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
public rep_summary_a01WithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new rep_summary_a01WithSelectionViewModel();
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
i.item_employee_id = (from x in emp.GetListByemployee_type(null, null) orderby x.fullname select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
Models/rep_summary_a01/rep_summary_a01ViewModel.cs
Normal file
28
Models/rep_summary_a01/rep_summary_a01ViewModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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_summary_a01ViewModel : BaseViewModel2<Guid>
|
||||
{
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
public string org_id_external_linkage_external_name { get; set; }
|
||||
public string round_id_external_linkage_external_name { get; set; }
|
||||
public string employee_id_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_summary_a01WithSelectionViewModel: rep_summary_a01ViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_org_id { get; set; }
|
||||
public List<external_linkageViewModel> item_round_id { get; set; }
|
||||
public List<external_employeeViewModel> item_employee_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user