diff --git a/App_Code/dbClass.cs b/App_Code/dbClass.cs index bf4e9c0..9d6489a 100644 --- a/App_Code/dbClass.cs +++ b/App_Code/dbClass.cs @@ -6,6 +6,58 @@ using System.Collections.Generic; using System.Linq; using System.Web; +[Table("babyRec")] +public class babyRec +{ + [JsonIgnore] + [Key] + public int babyRec_sn { get; set; } = 0; + public string babyRec_uid { get; set; } = ""; + public string babyData_uid { get; set; } = ""; + public string babyRec_key { get; set; } = ""; + public string line_uid { get; set; } = ""; + public double babyRec_height { get; set; } = 0; + public double babyRec_inpercent { get; set; } = 0; + public double babyRec_middleHeight { get; set; } = 0; + public DateTime babyRec_recdate { get; set; } = DateTime.Now; + public int babyRec_recYear { get; set; } = 0; + public int babyRec_recMonth { get; set; } = 0; + public int babyRec_recDay { get; set; } = 0; + + public int babyRec_months { get; set; } = 0; + public string babyRec_yearMonthStr { get; set; } = ""; + public DateTime babyRec_createdate { get; set; } = DateTime.Now; +} + +[Table("babyData")] +public class babyData +{ + [JsonIgnore] + [Key] + public int babyData_sn { get; set; } = 0; + public string babyData_uid { get; set; } = ""; + public string line_uid { get; set; } = ""; + public string babyData_name { get; set; } = ""; + public DateTime babyData_birthday { get; set; } = DateTime.Now; + public string babyData_sexual { get; set; } = ""; + public string babyData_bindedLine { get; set; } = ""; + public DateTime babyData_createdate { get; set; } = DateTime.Now; + public DateTime babyData_bindeddate { get; set; } = DateTime.Now; +} + +[Table("lineUser")] +public class lineUser +{ + [JsonIgnore] + [Key] + public int lineUser_sn { get; set; } = 0; + public string lineUser_uid { get; set; } = ""; + public string line_uid { get; set; } = ""; + public string line_displayName { get; set; } = ""; + public DateTime lineUser_createdate { get; set; } = DateTime.Now; + public DateTime lineUser_modifydate { get; set; } = DateTime.Now; +} + [Table("login")] public class login { @@ -26,4 +78,45 @@ public class token public string token_isremember { get; set; } = ""; public DateTime token_createdate { get; set; } = DateTime.Now; public DateTime token_expireddate { get; set; } = DateTime.Now; -} \ No newline at end of file +} + +[Table("temp_m")] +public class temp_m +{ + [JsonIgnore] + [Key] + public string temp_month { get; set; } = ""; + public double temp_3 { get; set; } = 0; + public double temp_15 { get; set; } = 0; + public double temp_25 { get; set; } = 0; + public double temp_50 { get; set; } = 0; + public double temp_75 { get; set; } = 0; + public double temp_85 { get; set; } = 0; + public double temp_97 { get; set; } = 0; +} + +[Table("lenHeiTable")] +public class lenHeiTable +{ + [JsonIgnore] + [Key] + public int lenHeiTable_sn { get; set; } = 0; + public string lenHeiTable_sexual { get; set; } = ""; + public int lenHeiTable_month { get; set; } = 0; + public double lenHeiTable_minVal { get; set; } = 0; + public double lenHeiTable_maxVal { get; set; } = 0; + public int lenHeiTable_percent { get; set; } = 0; +} + +[Table("ipTable")] +public class ipTable +{ + [JsonIgnore] + [Key] + public int ipTable_sn { get; set; } = 0; + public string ipTable_address { get; set; } = ""; + public DateTime ipTable_createdate { get; set; } = DateTime.Now; + public DateTime ipTable_modifydate { get; set; } = DateTime.Now; + public string ipTable_create_user_uid { get; set; } = ""; +} + diff --git a/App_Code/globalClass.cs b/App_Code/globalClass.cs index db06070..bade81e 100644 --- a/App_Code/globalClass.cs +++ b/App_Code/globalClass.cs @@ -15,9 +15,83 @@ using System.Drawing; using System.IO; using System.Data.SqlClient; using System.Configuration; +using Org.BouncyCastle.Asn1.X509; public static class globalClass { + public static string YearMonthDiff(DateTime self, DateTime target) { + int years, months, days; + // 因為只需取量,不決定誰大誰小,所以如果self < target時要交換將大的擺前面 + if (self < target) + { + DateTime tmp = target; + target = self; + self = tmp; + } + + // 將年轉換成月份以便用來計算 + months = 12 * (self.Year - target.Year) + (self.Month - target.Month); + + // 如果天數要相減的量不夠時要向月份借天數補滿該月再來相減 + if (self.Day < target.Day) + { + months--; + days = DateTime.DaysInMonth(target.Year, target.Month) - target.Day + self.Day; + } + else + { + days = self.Day - target.Day; + } + + // 天數計算完成後將月份轉成年 + years = months / 12; + months = months % 12; + + return years.ToString() + "歲" + months.ToString() + "月"; + } + + public static int MonthDiff(DateTime self, DateTime target) + { + int years, months, days; + // 因為只需取量,不決定誰大誰小,所以如果self < target時要交換將大的擺前面 + if (self < target) + { + DateTime tmp = target; + target = self; + self = tmp; + } + + // 將年轉換成月份以便用來計算 + months = 12 * (self.Year - target.Year) + (self.Month - target.Month); + + // 如果天數要相減的量不夠時要向月份借天數補滿該月再來相減 + if (self.Day < target.Day) + { + months--; + days = DateTime.DaysInMonth(target.Year, target.Month) - target.Day + self.Day; + } + else + { + days = self.Day - target.Day; + } + + return months; + } + + public static string GetIPAddress() + { + System.Web.HttpContext context = System.Web.HttpContext.Current; + string sIPAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; + if (string.IsNullOrEmpty(sIPAddress)) + { + return context.Request.ServerVariables["REMOTE_ADDR"]; + } + else + { + string[] ipArray = sIPAddress.Split(new Char[] { ',' }); + return ipArray[0]; + } + } public static string CreateRandomCode(int Number) { string allChar = "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"; diff --git a/BackEnd/Login.aspx b/BackEnd/Login.aspx new file mode 100644 index 0000000..84961c5 --- /dev/null +++ b/BackEnd/Login.aspx @@ -0,0 +1,100 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="abbott_2024_event.BackEnd.Login" %> + + + + +
+ + + + +