diff --git a/Controllers/PlantGeneticConservationProject.Controller.cs b/Controllers/PlantGeneticConservationProject.Controller.cs index 3d35f57..87de772 100644 --- a/Controllers/PlantGeneticConservationProject.Controller.cs +++ b/Controllers/PlantGeneticConservationProject.Controller.cs @@ -30,22 +30,23 @@ namespace rmutr_report.Controllers { if (project != null) { - // var total = project.activity.Count; - // if (project.activity != null) - // { - // foreach (var v in project.activity) - // { - // if (v.activity != null) - // { - // //var total = project.activity.Select(r => r.count).Sum(t => t.Value); - // project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; - // } - // else - // { - // project.together_with = null; - // } - // } - // } + if (project.activity.Any()) + { + if (project.activity == null) + { + foreach (var detail in project.activity) + { + detail.activity = null; + } + } + } + else + { + project.activity.Add(new activity_data() + { + activity = "" + }); + } if (project.ninth != null) { foreach (var vv in project.ninth) @@ -112,7 +113,7 @@ namespace rmutr_report.Controllers if (project.seventeenth != null) { int t = 1; - int ti= 1; + //int ti= 1; foreach (var v in project.seventeenth) { string a = "กิจกรรมที่ " + t + " "; @@ -130,8 +131,8 @@ namespace rmutr_report.Controllers foreach (var vv in v.seventeenths) { string na = "ครั้งที่ "; - vv.the_time = na + ti; - ti++; + vv.the_time = na + vv.the_time; + //ti++; foreach (var detail in vv.seventeenths2) { string in1 = "พื้นที่ (ภายในมหาวิทยาลัย) "; @@ -159,7 +160,7 @@ namespace rmutr_report.Controllers if (project.eighteenth != null) { int t = 1; - int ti = 1; + //int ti = 1; foreach (var v in project.eighteenth) { string a = "กิจกรรมที่ " + t + " "; @@ -177,8 +178,8 @@ namespace rmutr_report.Controllers foreach (var vv in v.eighteenths) { string na = "ครั้งที่ "; - vv.the_time = na + ti; - ti++; + vv.the_time = na + vv.the_time; + //ti++; string na2 = " จำนวน "; vv.count_day = na2 + vv.count_day + " วัน"; if (project.count_day != null) diff --git a/Controllers/Summary.Controller.cs b/Controllers/Summary.Controller.cs index 8672d22..871933a 100644 --- a/Controllers/Summary.Controller.cs +++ b/Controllers/Summary.Controller.cs @@ -799,7 +799,7 @@ namespace rmutr_report.Controllers ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#"); string str = equipment3.amount; - string str2 = equipment3.amount + "\n" + equipment3.amount + "\n" + equipment3.amount; + string str2 = equipment3.amount + "\r" + equipment3.amount + "\n" + equipment3.amount; //string str3 = str2.Substring(0, 7); if (str.Length == 4) { diff --git a/Controllers/project_principle_rationale.Controller.cs b/Controllers/project_principle_rationale.Controller.cs index 1ba505b..ae211e7 100644 --- a/Controllers/project_principle_rationale.Controller.cs +++ b/Controllers/project_principle_rationale.Controller.cs @@ -29,6 +29,23 @@ namespace rmutr_report.Controllers { if (project != null) { + if (project.activity.Any()) + { + if (project.activity == null) + { + foreach (var detail in project.activity) + { + detail.activity = null; + } + } + } + else + { + project.activity.Add(new activity_data() + { + activity = "" + }); + } if (project.ninth != null) { foreach (var vv in project.ninth) @@ -85,7 +102,7 @@ namespace rmutr_report.Controllers if (project.seventeenth != null) { int t = 1; - int ti= 1; + //int ti= 1; foreach (var v in project.seventeenth) { string a = "กิจกรรมที่ " + t + " "; @@ -103,8 +120,8 @@ namespace rmutr_report.Controllers foreach (var vv in v.seventeenths) { string na = "ครั้งที่ "; - vv.the_time = na + ti; - ti++; + vv.the_time = na + vv.the_time; + //ti++; foreach (var detail in vv.seventeenths2) { string in1 = "พื้นที่ (ภายในมหาวิทยาลัย) "; @@ -132,7 +149,7 @@ namespace rmutr_report.Controllers if (project.eighteenth != null) { int t = 1; - int ti = 1; + //int ti = 1; foreach (var v in project.eighteenth) { string a = "กิจกรรมที่ " + t + " "; @@ -150,8 +167,8 @@ namespace rmutr_report.Controllers foreach (var vv in v.eighteenths) { string na = "ครั้งที่ "; - vv.the_time = na + ti; - ti++; + vv.the_time = na + vv.the_time; + //ti++; string na2 = " จำนวน "; vv.count_day = na2 + vv.count_day + " วัน"; if (project.count_day != null) diff --git a/Controllers/project_request_thailand.Controller.cs b/Controllers/project_request_thailand.Controller.cs index d52c2ec..b0d7b64 100644 --- a/Controllers/project_request_thailand.Controller.cs +++ b/Controllers/project_request_thailand.Controller.cs @@ -46,22 +46,24 @@ namespace rmutr_report.Controllers // } if (project != null) { - // var total = project.activity.Count; - // if (project.activity != null) - // { - // foreach (var v in project.activity) - // { - // if (v.activity != null) - // { - // //var total = project.activity.Select(r => r.count).Sum(t => t.Value); - // project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; - // } - // else - // { - // project.together_with = null; - // } - // } - // } + + if (project.activity.Any()) + { + if (project.activity == null) + { + foreach (var detail in project.activity) + { + detail.activity = null; + } + } + } + else + { + project.activity.Add(new activity_data() + { + activity = "" + }); + } if (project.ninth != null) { @@ -94,6 +96,7 @@ namespace rmutr_report.Controllers detail = "" }); } + } } @@ -130,7 +133,7 @@ namespace rmutr_report.Controllers if (project.seventeenth != null) { int t = 1; - int ti= 1; + //int ti= 1; foreach (var v in project.seventeenth) { string a = "กิจกรรมที่ " + t + " "; @@ -148,8 +151,8 @@ namespace rmutr_report.Controllers foreach (var vv in v.seventeenths) { string na = "ครั้งที่ "; - vv.the_time = na + ti; - ti++; + vv.the_time = na + vv.the_time; + //ti++; foreach (var detail in vv.seventeenths2) { string in1 = "พื้นที่ (ภายในมหาวิทยาลัย) "; @@ -177,7 +180,7 @@ namespace rmutr_report.Controllers if (project.eighteenth != null) { int t = 1; - int ti = 1; + //int ti = 1; foreach (var v in project.eighteenth) { string a = "กิจกรรมที่ " + t + " "; @@ -195,8 +198,8 @@ namespace rmutr_report.Controllers foreach (var vv in v.eighteenths) { string na = "ครั้งที่ "; - vv.the_time = na + ti; - ti++; + vv.the_time = na + vv.the_time; + //ti++; string na2 = " จำนวน "; vv.count_day = na2 + vv.count_day + " วัน"; if (project.count_day != null) diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 0ad0f9a..173e5ce 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.dll and b/bin/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.pdb b/bin/Debug/netcoreapp3.1/rmutr_report.pdb index ac703c8..4fd8eb4 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.pdb and b/bin/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 0ad0f9a..173e5ce 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.dll and b/obj/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.pdb b/obj/Debug/netcoreapp3.1/rmutr_report.pdb index ac703c8..4fd8eb4 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/rider.project.model.nuget.info b/obj/rider.project.model.nuget.info index e1bba0a..b6bed1f 100644 --- a/obj/rider.project.model.nuget.info +++ b/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17018549799613370 \ No newline at end of file +17019257662490421 \ No newline at end of file diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index 5a0f6c4..82c3151 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -17018574056737534 \ No newline at end of file +17019334991213918 \ No newline at end of file diff --git a/wwwroot/reports/project_request_thailands.frx b/wwwroot/reports/project_request_thailands.frx index 8abcb8b..d7c9ec2 100644 --- a/wwwroot/reports/project_request_thailands.frx +++ b/wwwroot/reports/project_request_thailands.frx @@ -1,5 +1,5 @@  - + @@ -404,7 +404,7 @@ - + @@ -479,7 +479,7 @@ - +