diff --git a/ApiControllers/eva_create_evaluation_detail_firstdocControllers.cs b/ApiControllers/eva_create_evaluation_detail_firstdocControllers.cs new file mode 100644 index 0000000..3a30c2f --- /dev/null +++ b/ApiControllers/eva_create_evaluation_detail_firstdocControllers.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Logging; +using TTSW.Controllers; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; +using System.Data; +using Microsoft.Extensions.Configuration; +using System.IO; +using System.Net; + +namespace TodoAPI2.Controllers +{ + //[Authorize] + [Produces("application/json")] + [Route("api/eva_create_evaluation_detail_firstdoc")] + public class eva_create_evaluation_detail_firstdocController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ieva_create_evaluation_detail_firstdocService _repository; + private Iexternal_employeeService emp; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + /// + public eva_create_evaluation_detail_firstdocController(ILogger logger, + Ieva_create_evaluation_detail_firstdocService repository, IConfiguration configuration, + Iexternal_employeeService inemp) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + emp = inemp; + } + + /// + /// Get specific item by id + /// + /// + /// + /// Return Get specific item by id + /// Returns the item + /// Error Occurred + [HttpGet("{id}")] + [ProducesResponseType(typeof(eva_create_evaluation_detail_firstdocWithSelectionViewModel), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Get(int id) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var result = _repository.GetWithSelection(id); + + return Ok(result); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult Get.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [HttpGet("GetBlankItem")] + [ProducesResponseType(typeof(eva_create_evaluation_detail_firstdocWithSelectionViewModel), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetBlankItem() + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var result = _repository.GetBlankItem(); + + return Ok(result); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Get list items by create_evaluation_id + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetList(int? create_evaluation_id) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + + if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"])) + { + var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]); + var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid)); + return Ok(_repository.GetListBycreate_evaluation_id(create_evaluation_id, e.id)); + } + else + { + return Unauthorized(); + } + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetList.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Get list items by search + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("GetListBySearch")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetListBySearch(eva_create_evaluation_detail_firstdocSearchModel model) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + + if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"])) + { + var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]); + var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid)); + return Ok(_repository.GetListBySearch(model, e.id)); + } + else + { + return Unauthorized(); + } + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + } +} diff --git a/EF/_IBaseService2.cs b/EF/_IBaseService2.cs new file mode 100644 index 0000000..8678465 --- /dev/null +++ b/EF/_IBaseService2.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TTSW.EF +{ + public interface IBaseService2 + { + #region Query Functions + ViewModel Get(Key id); + #endregion + + #region Manipulation Functions + ViewModel Insert(InputModel model, bool is_force_save); + ViewModel Update(Key id, InputModel model, bool is_force_save); + ViewModel SetAsActive(Key id); + ViewModel SetAsInactive(Key id); + void Delete(Key id); + #endregion + } +} diff --git a/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_firstdoc.xlsx b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_firstdoc.xlsx new file mode 100644 index 0000000..304c55f Binary files /dev/null and b/EXCEL/eva_create_evaluation_detail@eva_create_evaluation_detail_firstdoc.xlsx differ diff --git a/Models/eva_create_evaluation_detail_firstdoc/Ieva_create_evaluation_detail_firstdocService.cs b/Models/eva_create_evaluation_detail_firstdoc/Ieva_create_evaluation_detail_firstdocService.cs new file mode 100644 index 0000000..55e010a --- /dev/null +++ b/Models/eva_create_evaluation_detail_firstdoc/Ieva_create_evaluation_detail_firstdocService.cs @@ -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 Ieva_create_evaluation_detail_firstdocService + { + List GetListBycreate_evaluation_id(int? create_evaluation_id, int? emp_id); + List GetListBySearch(eva_create_evaluation_detail_firstdocSearchModel model, int? emp_id); + + eva_create_evaluation_detail_firstdocWithSelectionViewModel GetWithSelection(int id); + eva_create_evaluation_detail_firstdocWithSelectionViewModel GetBlankItem(); + + } +} + diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocInputModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocInputModel.cs new file mode 100644 index 0000000..399259b --- /dev/null +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocInputModel.cs @@ -0,0 +1,48 @@ +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 eva_create_evaluation_detail_firstdocInputModel + { + + public int? id { get; set; } + + public string evaluation_round { get; set; } + + public string employee_code { get; set; } + + public string employee_fullname { get; set; } + + public string employee_position { get; set; } + + public string employee_position_type { get; set; } + + public string employee_position_level { get; set; } + + public string employee_org { get; set; } + + public string chief_fullname { get; set; } + + public string chief_position { get; set; } + + public int? create_evaluation_id { get; set; } + + public int? org_id { get; set; } + + public string search_employee_code { get; set; } + + public string search_employee_fullname { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocReportRequestModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocReportRequestModel.cs new file mode 100644 index 0000000..b18abd4 --- /dev/null +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocReportRequestModel.cs @@ -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 eva_create_evaluation_detail_firstdocReportRequestModel : eva_create_evaluation_detail_firstdocSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocSearchModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocSearchModel.cs new file mode 100644 index 0000000..d511f95 --- /dev/null +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocSearchModel.cs @@ -0,0 +1,29 @@ +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 eva_create_evaluation_detail_firstdocSearchModel + { + + public int id { get; set; } + + public int? create_evaluation_id { get; set; } + + public int? org_id { get; set; } + + public string search_employee_code { get; set; } + + public string search_employee_fullname { get; set; } + + } +} + diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs new file mode 100644 index 0000000..5d2c2eb --- /dev/null +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs @@ -0,0 +1,264 @@ +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 eva_create_evaluation_detail_firstdocService : Ieva_create_evaluation_detail_firstdocService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + private Iexternal_employeeService emp; + + public eva_create_evaluation_detail_firstdocService(IBaseRepository2 repository, IMyDatabase mydb, + Iexternal_linkageService inext, Iexternal_employeeService inemp) + { + _repository = repository; + db = mydb; + ext = inext; + emp = inemp; + } + + #region Private Functions + private eva_create_evaluation_detailEntity GetEntity(eva_create_evaluation_detail_firstdocInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_create_evaluation_detail_firstdocViewModel GetDto(eva_create_evaluation_detailEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public string GetWorkTimeText(DateTime? startDate, DateTime? endDate) + { + if (!endDate.HasValue || !startDate.HasValue) + return ""; + + int monthsApart = 12 * (startDate.Value.Year - endDate.Value.Year) + startDate.Value.Month - endDate.Value.Month; + if (Math.Abs(monthsApart) < 4) + { + return "ปฏิบัติงานไม่ครบ 4 เดือน"; + } + return ""; + } + + public eva_create_evaluation_detail_firstdocViewModel Get(int id) + { + var allemp = emp.GetListByemployee_type(null, null); + + var endDate = (from m_eva_create_evaluation_detail_agreement in _repository.Context.eva_create_evaluation_detail + + join fk_eva_create_evaluation10 in _repository.Context.eva_create_evaluation on m_eva_create_evaluation_detail_agreement.create_evaluation_id equals fk_eva_create_evaluation10.id + into eva_create_evaluationResult10 + from fk_eva_create_evaluationResult10 in eva_create_evaluationResult10.DefaultIfEmpty() + + join i in _repository.Context.eva_performance_plan_detail + on fk_eva_create_evaluationResult10.performance_plan_id equals i.performance_plan_id + + where m_eva_create_evaluation_detail_agreement.id == id + + select i.end_date).Max(); + + var data = ( + from m_eva_create_evaluation_detail_agreement in _repository.Context.eva_create_evaluation_detail + + join fk_external_employee in allemp on m_eva_create_evaluation_detail_agreement.employee_id equals fk_external_employee.id + into external_employeeResult + from fk_external_employee in external_employeeResult.DefaultIfEmpty() + + join fk_external_chief in allemp on m_eva_create_evaluation_detail_agreement.chief equals fk_external_chief.id + into external_chiefResult + from fk_external_chief in external_chiefResult.DefaultIfEmpty() + + join fk_eva_create_evaluation10 in _repository.Context.eva_create_evaluation on m_eva_create_evaluation_detail_agreement.create_evaluation_id equals fk_eva_create_evaluation10.id + into eva_create_evaluationResult10 + from fk_eva_create_evaluationResult10 in eva_create_evaluationResult10.DefaultIfEmpty() + + where m_eva_create_evaluation_detail_agreement.id == id + + orderby m_eva_create_evaluation_detail_agreement.created descending + select new eva_create_evaluation_detail_firstdocWithSelectionViewModel() + { + id = m_eva_create_evaluation_detail_agreement.id, + evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.display_text, + employee_code = fk_external_employee.employee_no, + employee_fullname = fk_external_employee.fullname, + employee_position = fk_external_employee.position_name, + employee_position_type = fk_external_employee.position_type_name, + employee_position_level = fk_external_employee.position_level_text, + employee_org = fk_external_employee.department_name, + chief_fullname = fk_external_chief.fullname, + chief_position = fk_external_chief.position_name, + create_evaluation_id = m_eva_create_evaluation_detail_agreement.create_evaluation_id, + org_id = fk_external_employee.department_id, + search_employee_code = fk_external_employee.employee_no, + search_employee_fullname = fk_external_employee.fullname, + status_self = m_eva_create_evaluation_detail_agreement.status_self, + status_chief = m_eva_create_evaluation_detail_agreement.status_chief, + status_supervisor = m_eva_create_evaluation_detail_agreement.status_supervisor, + + org_id_external_linkage_external_name = fk_external_employee.department_name, + + remark_hrm_work_record = fk_external_employee.remark_hrm_work_record + + GetWorkTimeText(fk_external_employee.packing_date, endDate), + + score1 = fk_eva_create_evaluationResult10.score1, + score2 = fk_eva_create_evaluationResult10.score2, + + isActive = m_eva_create_evaluation_detail_agreement.isActive, + Created = m_eva_create_evaluation_detail_agreement.created, + Updated = m_eva_create_evaluation_detail_agreement.updated + } + ).ToList(); + + return data[0]; + } + + public eva_create_evaluation_detailEntity GetEntity(int id) + { + var entity = _repository.Get(id); + + return entity; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + public eva_create_evaluation_detail_firstdocWithSelectionViewModel GetWithSelection(int id) + { + var entity = Get(id); + var i = Mapper.Map(entity); + i.item_org_id = ext.GetDepartmentData(); + + + return i; + } + public eva_create_evaluation_detail_firstdocWithSelectionViewModel GetBlankItem() + { + var i = new eva_create_evaluation_detail_firstdocWithSelectionViewModel(); + i.item_org_id = ext.GetDepartmentData(); + + + return i; + } + + public List GetListBycreate_evaluation_id(int? create_evaluation_id, int? emp_id) + { + var model = new eva_create_evaluation_detail_firstdocSearchModel(); + model.create_evaluation_id = create_evaluation_id; + return GetListBySearch(model, emp_id); + } + + public List GetListBySearch(eva_create_evaluation_detail_firstdocSearchModel model, int? emp_id) + { + var allemp = emp.GetListByemployee_type(null, null); + + var data = ( + from m_eva_create_evaluation_detail_agreement in _repository.Context.eva_create_evaluation_detail + + join fk_external_employee in allemp on m_eva_create_evaluation_detail_agreement.employee_id equals fk_external_employee.id + into external_employeeResult + from fk_external_employee in external_employeeResult.DefaultIfEmpty() + + join fk_external_chief in allemp on m_eva_create_evaluation_detail_agreement.chief equals fk_external_chief.id + into external_chiefResult + from fk_external_chief in external_chiefResult.DefaultIfEmpty() + + join fk_eva_create_evaluation10 in _repository.Context.eva_create_evaluation on m_eva_create_evaluation_detail_agreement.create_evaluation_id equals fk_eva_create_evaluation10.id + into eva_create_evaluationResult10 + from fk_eva_create_evaluationResult10 in eva_create_evaluationResult10.DefaultIfEmpty() + + join fk_plan in _repository.Context.eva_performance_plan on fk_eva_create_evaluationResult10.performance_plan_id equals fk_plan.id + into planResult + from fk_planResult in planResult.DefaultIfEmpty() + + where 1 == 1 + && (m_eva_create_evaluation_detail_agreement.create_evaluation_id == model.create_evaluation_id || !model.create_evaluation_id.HasValue) + && (fk_external_employee.department_id == model.org_id || !model.org_id.HasValue) + && (fk_external_employee.employee_no == model.search_employee_code || string.IsNullOrEmpty(model.search_employee_code)) + && (fk_external_employee.fullname.Contains(model.search_employee_fullname) || string.IsNullOrEmpty(model.search_employee_fullname)) + && m_eva_create_evaluation_detail_agreement.employee_id == emp_id + + orderby m_eva_create_evaluation_detail_agreement.created descending + select new eva_create_evaluation_detail_firstdocViewModel() + { + id = m_eva_create_evaluation_detail_agreement.id, + evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.theTime.ToString(), + employee_code = fk_external_employee.employee_no, + employee_fullname = fk_external_employee.fullname, + employee_position = fk_external_employee.position_name, + employee_position_type = fk_external_employee.employee_type_name, + employee_position_level = fk_external_employee.position_level_text, + employee_org = fk_external_employee.department_name, + chief_fullname = fk_external_chief.fullname, + chief_position = fk_external_chief.position_name, + create_evaluation_id = m_eva_create_evaluation_detail_agreement.create_evaluation_id, + org_id = fk_external_employee.department_id, + search_employee_code = fk_external_employee.employee_no, + search_employee_fullname = fk_external_employee.fullname, + status_self = m_eva_create_evaluation_detail_agreement.status_self, + status_chief = m_eva_create_evaluation_detail_agreement.status_chief, + status_supervisor = m_eva_create_evaluation_detail_agreement.status_supervisor, + + org_id_external_linkage_external_name = fk_external_employee.department_name, + + status_self_click_date = m_eva_create_evaluation_detail_agreement.status_self_click_date, + status_chief_click_date = m_eva_create_evaluation_detail_agreement.status_chief_click_date, + status_supervisor_click_date = m_eva_create_evaluation_detail_agreement.status_supervisor_click_date, + + plan_round_year = checkNull(fk_planResult.theTime) + "/" + checkNull(fk_planResult.fiscal_year), + + isActive = m_eva_create_evaluation_detail_agreement.isActive, + Created = m_eva_create_evaluation_detail_agreement.created, + Updated = m_eva_create_evaluation_detail_agreement.updated + } + ).ToList(); + + return data; + } + + private string checkNull(object i) + { + if (i != null) + { + return i.ToString(); + } + return ""; + } + + #endregion + + + + #endregion + } +} \ No newline at end of file diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocViewModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocViewModel.cs new file mode 100644 index 0000000..482b36f --- /dev/null +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocViewModel.cs @@ -0,0 +1,85 @@ +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 eva_create_evaluation_detail_firstdocViewModel : BaseViewModel2 + { + + public string evaluation_round { get; set; } + + public string employee_code { get; set; } + + public string employee_fullname { get; set; } + + public string employee_position { get; set; } + + public string employee_position_type { get; set; } + + public string employee_position_level { get; set; } + + public string employee_org { get; set; } + + public string chief_fullname { get; set; } + + public string chief_position { get; set; } + + public int? create_evaluation_id { get; set; } + + public int? org_id { get; set; } + + public string search_employee_code { get; set; } + + public string search_employee_fullname { get; set; } + + public string org_id_external_linkage_external_name { get; set; } + + public string status_self { get; set; } + + public string status_chief { get; set; } + + public string status_supervisor { get; set; } + + public string remark_hrm_work_record { get; set; } + + public string plan_round_year { get; set; } + + public DateTime? status_self_click_date { get; set; } + public DateTime? status_chief_click_date { get; set; } + public DateTime? status_supervisor_click_date { get; set; } + + public decimal? score1 { get; set; } + + public decimal? score2 { get; set; } + + public string txt_status_self { get { return getStatusText(status_self) + MyHelper.GetDateStringForReport(status_self_click_date); } } + public string txt_status_chief { get { return getStatusText(status_chief) + MyHelper.GetDateStringForReport(status_chief_click_date); } } + public string txt_status_supervisor { get { return getStatusText(status_supervisor) + MyHelper.GetDateStringForReport(status_supervisor_click_date); } } + + private string getStatusText(string s) + { + if (!string.IsNullOrEmpty(s)) + { + if (s == "Y") + { + return "ส่งแบบประเมินแล้ว
"; + } + else if (s == "N") + { + return "ตีกลับ
"; + } + } + return " "; + } + + } +} + diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocWithSelectionViewModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocWithSelectionViewModel.cs new file mode 100644 index 0000000..23a1ef0 --- /dev/null +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocWithSelectionViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class eva_create_evaluation_detail_firstdocWithSelectionViewModel: eva_create_evaluation_detail_firstdocViewModel + { + public List item_org_id { get; set; } + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index 3256f87..3910ba7 100644 --- a/Startup.cs +++ b/Startup.cs @@ -308,6 +308,8 @@ namespace Test01 services.AddScoped, BaseRepository2>(); services.AddScoped(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -559,6 +561,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/ViewControllers/eva_create_evaluation_detail_firstdocViewControllers.cs b/ViewControllers/eva_create_evaluation_detail_firstdocViewControllers.cs new file mode 100644 index 0000000..d273110 --- /dev/null +++ b/ViewControllers/eva_create_evaluation_detail_firstdocViewControllers.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using TodoAPI2.Models; +using STAFF_API.Models; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Configuration; +using TodoAPI2.Controllers; + +namespace TodoAPI2.Controllers +{ + public class eva_create_evaluation_detail_firstdocViewController : Controller + { + private ILogger _logger; + private Ieva_create_evaluation_detail_firstdocService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_create_evaluation_detail_firstdocViewController(ILogger logger, Ieva_create_evaluation_detail_firstdocService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + public IActionResult eva_create_evaluation_detail_firstdoc() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + public IActionResult eva_create_evaluation_detail_firstdoc_d() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } +} + + diff --git a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml index 8105070..c9adc30 100644 --- a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml +++ b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml @@ -5,6 +5,7 @@ Layout = "_LayoutDirect"; } +