("select A.*, B.utm_source as rec_source, B.utm_medium as rec_medium, B.utm_campaign as rec_campaign, B.utm_content as rec_content, B.utm_term as rec_term from babyDataRecView A, babyRec B " + filiterString + " order by babyRec_recdate desc ").ToList();
HSSFWorkbook workbook = new HSSFWorkbook();
MemoryStream ms = new MemoryStream();
@@ -95,15 +95,20 @@ namespace abbott_2024_event.BackEnd.api
headerRow.CreateCell(7).SetCellValue("測驗時年齡");
headerRow.CreateCell(8).SetCellValue("寶寶身高");
headerRow.CreateCell(9).SetCellValue("寶寶成長百分比");
- headerRow.CreateCell(10).SetCellValue("utm_source");
- headerRow.CreateCell(11).SetCellValue("utm_medium");
- headerRow.CreateCell(12).SetCellValue("utm_campaign");
- headerRow.CreateCell(13).SetCellValue("utm_content");
- headerRow.CreateCell(14).SetCellValue("utm_term");
+ headerRow.CreateCell(10).SetCellValue("成為會員utm_source");
+ headerRow.CreateCell(11).SetCellValue("成為會員utm_medium");
+ headerRow.CreateCell(12).SetCellValue("成為會員utm_campaign");
+ headerRow.CreateCell(13).SetCellValue("成為會員utm_content");
+ headerRow.CreateCell(14).SetCellValue("成為會員utm_term");
+ headerRow.CreateCell(15).SetCellValue("寶寶紀錄utm_source");
+ headerRow.CreateCell(16).SetCellValue("寶寶紀錄utm_medium");
+ headerRow.CreateCell(17).SetCellValue("寶寶紀錄utm_campaign");
+ headerRow.CreateCell(18).SetCellValue("寶寶紀錄utm_content");
+ headerRow.CreateCell(19).SetCellValue("寶寶紀錄utm_term");
int pageNum = 1;
- foreach (babyDataRecView view in babyDataRecViews)
+ foreach (babyDataRecView2 view in babyDataRecViews)
{
string baby_gender = "";
@@ -179,11 +184,16 @@ namespace abbott_2024_event.BackEnd.api
excelRow.CreateCell(12).SetCellValue(view.utm_campaign);
excelRow.CreateCell(13).SetCellValue(view.utm_content);
excelRow.CreateCell(14).SetCellValue(view.utm_term);
+ excelRow.CreateCell(15).SetCellValue(view.rec_source);
+ excelRow.CreateCell(16).SetCellValue(view.rec_medium);
+ excelRow.CreateCell(17).SetCellValue(view.rec_campaign);
+ excelRow.CreateCell(18).SetCellValue(view.rec_content);
+ excelRow.CreateCell(19).SetCellValue(view.rec_term);
pageNum++;
}
- for (int j = 0; j <= 14; j++)
+ for (int j = 0; j <= 19; j++)
{
sheet.AutoSizeColumn(j);
sheet.SetColumnWidth(j, sheet.GetColumnWidth(j) * 17 / 10);
diff --git a/BackEnd/ip-management.aspx b/BackEnd/ip-management.aspx
index 5d4e57f..d30e712 100644
--- a/BackEnd/ip-management.aspx
+++ b/BackEnd/ip-management.aspx
@@ -29,6 +29,92 @@
});
+ $("#ctl00_ContentPlaceHolder1_clearAll").click(function () {
+ if (confirm("確定要刪除2025/3/31(含)以前的所有資料?")) {
+ if (confim("再次確定要刪除?")) {
+ var formData = {
+ type: 'all'
+ }
+
+ $.ajax({
+ url: "api/clearAllData.ashx",
+ type: "POST",
+ data: formData,
+ success: function (data, textStatus, jqXHR) {
+ if (data.ret == "yes") {
+ alert("刪除完成!");
+
+ } else {
+ alert(data.message);
+ }
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ alert('網路或伺服器發生錯誤或!');
+ }
+ });
+ }
+
+ }
+ });
+
+ $("#ctl00_ContentPlaceHolder1_clearData").click(function () {
+ if (confirm("確定要刪除2025/3/31(含)以前的所有寶寶資料(含紀錄)?")) {
+ if (confim("再次確定要刪除?")) {
+ var formData = {
+ type: 'babyData'
+ }
+
+ $.ajax({
+ url: "api/clearAllData.ashx",
+ type: "POST",
+ data: formData,
+ success: function (data, textStatus, jqXHR) {
+ if (data.ret == "yes") {
+ alert("刪除完成!");
+
+ } else {
+ alert(data.message);
+ }
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ alert('網路或伺服器發生錯誤或!');
+ }
+ });
+ }
+
+ }
+ });
+
+ $("#ctl00_ContentPlaceHolder1_clearRec").click(function () {
+ if (confirm("確定要刪除2025/3/31(含)以前的寶寶紀錄?")) {
+
+ if (confim("再次確定要刪除?")) {
+ var formData = {
+ type: 'babyRec'
+ }
+
+ $.ajax({
+ url: "api/clearAllData.ashx",
+ type: "POST",
+ data: formData,
+ success: function (data, textStatus, jqXHR) {
+ if (data.ret == "yes") {
+ alert("刪除完成!");
+
+ } else {
+ alert(data.message);
+ }
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ alert('網路或伺服器發生錯誤或!');
+ }
+ });
+ }
+
+
+ }
+ });
+
$("#saveBtn").click(function () {
var array = $("#ip_list").val().split("\n");
var iplist = JSON.stringify(array);
@@ -109,6 +195,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BackEnd/ip-management.aspx.cs b/BackEnd/ip-management.aspx.cs
index c448ab6..853b8d4 100644
--- a/BackEnd/ip-management.aspx.cs
+++ b/BackEnd/ip-management.aspx.cs
@@ -11,7 +11,40 @@ namespace abbott_2024_event.BackEnd
{
protected void Page_Load(object sender, EventArgs e)
{
+ string myIP = globalClass.GetIPAddress();
+ if (myIP == "::1")
+ {
+ myIP = "127.0.0.1";
+ }
+
+ Boolean isAllow = false;
+
+ if (myIP == "127.0.0.1")
+ {
+ isAllow = true;
+ }
+
+ string myIP_2 = myIP.Substring(0, myIP.LastIndexOf('.'));
+
+ if (myIP_2 == "60.251.161")
+ {
+ isAllow = true;
+ }
+
+ //isAllow = false;
+
+ if (isAllow == true)
+ {
+ clearAll.Visible = true;
+ clearData.Visible = true;
+ clearRec.Visible = true;
+ }
+ else {
+ clearAll.Visible = false;
+ clearData.Visible = false;
+ clearRec.Visible = false;
+ }
}
}
}
\ No newline at end of file
diff --git a/BackEnd/ip-management.aspx.designer.cs b/BackEnd/ip-management.aspx.designer.cs
index 32f2387..92d5481 100644
--- a/BackEnd/ip-management.aspx.designer.cs
+++ b/BackEnd/ip-management.aspx.designer.cs
@@ -13,5 +13,32 @@ namespace abbott_2024_event.BackEnd
public partial class ip_management
{
+
+ ///
+ /// clearAll 控制項。
+ ///
+ ///
+ /// 自動產生的欄位。
+ /// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlButton clearAll;
+
+ ///
+ /// clearData 控制項。
+ ///
+ ///
+ /// 自動產生的欄位。
+ /// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlButton clearData;
+
+ ///
+ /// clearRec 控制項。
+ ///
+ ///
+ /// 自動產生的欄位。
+ /// 若要修改,請將欄位宣告從設計工具檔案移到程式碼後置檔案。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlButton clearRec;
}
}
diff --git a/abbott_2024_event.csproj b/abbott_2024_event.csproj
index 480ad94..360897c 100644
--- a/abbott_2024_event.csproj
+++ b/abbott_2024_event.csproj
@@ -26451,6 +26451,7 @@
+
@@ -26469,6 +26470,9 @@
chgPassword.ashx
+
+ clearAllData.ashx
+
exportBabyRec.ashx
diff --git a/bin/abbott_2024_event.dll b/bin/abbott_2024_event.dll
index d66b286..7187a02 100644
Binary files a/bin/abbott_2024_event.dll and b/bin/abbott_2024_event.dll differ
diff --git a/bin/app.publish/BackEnd/api/clearAllData.ashx b/bin/app.publish/BackEnd/api/clearAllData.ashx
new file mode 100644
index 0000000..7e9ba3e
--- /dev/null
+++ b/bin/app.publish/BackEnd/api/clearAllData.ashx
@@ -0,0 +1 @@
+<%@ WebHandler Language="C#" CodeBehind="clearAllData.ashx.cs" Class="abbott_2024_event.BackEnd.api.clearAllData" %>
diff --git a/bin/app.publish/BackEnd/ip-management.aspx b/bin/app.publish/BackEnd/ip-management.aspx
index 5d4e57f..d30e712 100644
--- a/bin/app.publish/BackEnd/ip-management.aspx
+++ b/bin/app.publish/BackEnd/ip-management.aspx
@@ -29,6 +29,92 @@
});
+ $("#ctl00_ContentPlaceHolder1_clearAll").click(function () {
+ if (confirm("確定要刪除2025/3/31(含)以前的所有資料?")) {
+ if (confim("再次確定要刪除?")) {
+ var formData = {
+ type: 'all'
+ }
+
+ $.ajax({
+ url: "api/clearAllData.ashx",
+ type: "POST",
+ data: formData,
+ success: function (data, textStatus, jqXHR) {
+ if (data.ret == "yes") {
+ alert("刪除完成!");
+
+ } else {
+ alert(data.message);
+ }
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ alert('網路或伺服器發生錯誤或!');
+ }
+ });
+ }
+
+ }
+ });
+
+ $("#ctl00_ContentPlaceHolder1_clearData").click(function () {
+ if (confirm("確定要刪除2025/3/31(含)以前的所有寶寶資料(含紀錄)?")) {
+ if (confim("再次確定要刪除?")) {
+ var formData = {
+ type: 'babyData'
+ }
+
+ $.ajax({
+ url: "api/clearAllData.ashx",
+ type: "POST",
+ data: formData,
+ success: function (data, textStatus, jqXHR) {
+ if (data.ret == "yes") {
+ alert("刪除完成!");
+
+ } else {
+ alert(data.message);
+ }
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ alert('網路或伺服器發生錯誤或!');
+ }
+ });
+ }
+
+ }
+ });
+
+ $("#ctl00_ContentPlaceHolder1_clearRec").click(function () {
+ if (confirm("確定要刪除2025/3/31(含)以前的寶寶紀錄?")) {
+
+ if (confim("再次確定要刪除?")) {
+ var formData = {
+ type: 'babyRec'
+ }
+
+ $.ajax({
+ url: "api/clearAllData.ashx",
+ type: "POST",
+ data: formData,
+ success: function (data, textStatus, jqXHR) {
+ if (data.ret == "yes") {
+ alert("刪除完成!");
+
+ } else {
+ alert(data.message);
+ }
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ alert('網路或伺服器發生錯誤或!');
+ }
+ });
+ }
+
+
+ }
+ });
+
$("#saveBtn").click(function () {
var array = $("#ip_list").val().split("\n");
var iplist = JSON.stringify(array);
@@ -109,6 +195,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/app.publish/bin/abbott_2024_event.dll b/bin/app.publish/bin/abbott_2024_event.dll
index b95b1f7..7187a02 100644
Binary files a/bin/app.publish/bin/abbott_2024_event.dll and b/bin/app.publish/bin/abbott_2024_event.dll differ
diff --git a/webapi/babyData.ashx.cs b/webapi/babyData.ashx.cs
index b46a5c2..476aae9 100644
--- a/webapi/babyData.ashx.cs
+++ b/webapi/babyData.ashx.cs
@@ -245,7 +245,7 @@ namespace abbott_2024_event.webapi
conn.Execute("update babyRec set babyRec_newestRec = 'N' where babyData_uid = @babyData_uid", new { babyData_uid = babyData_uid });
- babyRec lastestBabyRec = conn.QueryFirstOrDefault("select * from babyRec where babyData_uid = @babyData_uid order by babyRec_months desc, babyRec_sn desc, babyRec_monthLastRec desc", new { babyData_uid = babyData_uid });
+ babyRec lastestBabyRec = conn.QueryFirstOrDefault("select * from babyRec where babyData_uid = @babyData_uid order by babyRec_createdate desc", new { babyData_uid = babyData_uid });
if(lastestBabyRec != null)
{