diff --git a/Controllers/ApiController.cs b/Controllers/ApiController.cs index 6920cdb..e1456fc 100644 --- a/Controllers/ApiController.cs +++ b/Controllers/ApiController.cs @@ -56,7 +56,25 @@ namespace Journeys_WantHome.Controllers this._httpContextAccessor = httpContextAccessor; } - + [Route("mediaSpecList")] + public ActionResult MediaSpecList(IFormCollection obj) { + mediaSpecListResult ret = new mediaSpecListResult(); + authToken token = new authToken(this._httpContextAccessor); + if (token.user_isLogin == false) + { + HttpContext.Response.Cookies.Delete("token_key"); + + return Content(JsonConvert.SerializeObject(ret), "application/json;charset=utf-8"); + } + + string optionItem_uid = obj["optionItem_uid"].ToString(); + + ret.mediaSpecList = conn.Query("select * from mediaItem where mediaItem_ishide = 'N' and optionItem_uid = @optionItem_uid order by mediaItem_order", new { optionItem_uid = optionItem_uid }).ToList(); + + ret.ret = "yes"; + + return Content(JsonConvert.SerializeObject(ret), "application/json;charset=utf-8"); + } [Route("updateTags")] public ActionResult UpdateTags(IFormCollection obj) { @@ -346,10 +364,23 @@ namespace Journeys_WantHome.Controllers return Content(JsonConvert.SerializeObject(ret), "application/json;charset=utf-8"); } - List projects = conn.Query("select * from project order by project_modifydate desc ").ToList(); + string project_year = obj["year"].ToString(); + string project_month = obj["month"].ToString(); + + if (project_year == "") + { + List projects = conn.Query("select * from project order by project_modifydate desc ").ToList(); + ret.projectList = projects; + } + else { + List projects = conn.Query("select * from project where project_year = @project_year and project_month = @project_month order by project_modifydate desc ", new { project_year = project_year, project_month = project_month }).ToList(); + ret.projectList = projects; + } + + ret.ret = "yes"; - ret.projectList = projects; + return Content(JsonConvert.SerializeObject(ret), "application/json;charset=utf-8"); } @@ -913,7 +944,13 @@ namespace Journeys_WantHome.Controllers } - + public class mediaSpecListResult { + public string ret { get; set; } = "no"; + public string err_code { get; set; } = "0000"; + public string message { get; set; } = ""; + + public List mediaSpecList = new List(); + } public class updatTagResult { public string ret { get; set; } = "no"; diff --git a/Models/DbTableClass.cs b/Models/DbTableClass.cs index 857413e..f45181a 100644 --- a/Models/DbTableClass.cs +++ b/Models/DbTableClass.cs @@ -8,6 +8,71 @@ using Newtonsoft.Json.Linq; public class DbTableClass { + [Table("kolProjectPrice")] + public class kolProjectPrice + { + [JsonIgnore] + [Key] + public int kolProjectPrice_sn { get; set; } + public string kolProjectPrice_uid { get; set; } = ""; + public string optionItem_uid { get; set; } = ""; + public string mediaItem_uid { get; set; } = ""; + public string kolProjectPrice_other { get; set; } = ""; + public string kolProjectPrice_num { get; set; } = ""; + public int kolProjectPrice_cost { get; set; } = 0; + public string kolProjectPrice_date { get; set; } = ""; + public DateTime kolProjectPrice_createdate { get; set; } = DateTime.Now; + public DateTime kolProjectPrice_modifydate { get; set; } = DateTime.Now; + } + + + + [Table("kolProjectLink")] + public class kolProjectLink + { + [JsonIgnore] + [Key] + public int kolProjectLink_sn { get; set; } + public string kolProjectLink_uid { get; set; } = ""; + public string kolProject_uid { get; set; } = ""; + public string kolProjectLink_url { get; set; } = ""; + public string kolProjectLink_text { get; set; } = ""; + public DateTime kolProjectLink_createdate { get; set; } = DateTime.Now; + } + + [Table("kolProjectImage")] + public class kolProjectImage + { + [JsonIgnore] + [Key] + public int kolProjectImage_sn { get; set; } + public string kolProjectImage_uid { get; set; } = ""; + public string kolProject_uid { get; set; } = ""; + public string kolProjectImage_photo { get; set; } = ""; + public DateTime kolProjectImage_createdate { get; set; } = DateTime.Now; + } + + [Table("kolProject")] + public class kolProject + { + [JsonIgnore] + [Key] + public int kolProject_sn { get; set; } + public string kolProject_uid { get; set; } = ""; + public string kol_uid { get; set; } = ""; + public string project_uid { get; set; } = ""; + public string kolProject_isExec { get; set; } = "N"; + public string kolProject_noExecReason { get; set; } = ""; + public string kolProject_quility { get; set; } = ""; + public string kolProject_memo { get; set; } = ""; + public string user_uid { get; set; } = ""; + public string user_name { get; set; } = ""; + public DateTime kolProject_createdate { get; set; } = DateTime.Now; + public DateTime kolProject_modifydate { get; set; } = DateTime.Now; + } + + + [Table("mediaItem")] public class mediaItem { diff --git a/Views/Home/KolList.cshtml b/Views/Home/KolList.cshtml index 284cead..645b609 100644 --- a/Views/Home/KolList.cshtml +++ b/Views/Home/KolList.cshtml @@ -285,6 +285,333 @@ + + + + + + + + + + +
+ +
+ +
+