diff --git a/201731024235/WinFromDianMing/DaoLayer/DaoLayer.csproj b/201731024235/WinFromDianMing/DaoLayer/DaoLayer.csproj new file mode 100644 index 0000000..49e5e78 --- /dev/null +++ b/201731024235/WinFromDianMing/DaoLayer/DaoLayer.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {829E28C4-F286-49AC-904C-6BED236D6339} + Library + Properties + DaoLayer + DaoLayer + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + {27cc8072-7612-4492-913d-2e03a6c37fd1} + DataBase + + + {23c35d64-584f-4aeb-b53b-d8ac0250bd0b} + Entity + + + + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/DaoLayer/Properties/AssemblyInfo.cs b/201731024235/WinFromDianMing/DaoLayer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e86a6e6 --- /dev/null +++ b/201731024235/WinFromDianMing/DaoLayer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("DaoLayer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DaoLayer")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("a90f3caf-b644-4fb3-b256-0eb2b6c58c92")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/201731024235/WinFromDianMing/DaoLayer/StudentDAO.cs b/201731024235/WinFromDianMing/DaoLayer/StudentDAO.cs new file mode 100644 index 0000000..e832662 --- /dev/null +++ b/201731024235/WinFromDianMing/DaoLayer/StudentDAO.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Entity; +using DataBase; + +namespace DaoLayer +{ + public class StudentDAO + { + public int getStudentRecordsNums() + { + List studengList = StudentDataset.getAll(); + return studengList.Count; + } + + public List getAllStudents() + { + List studengList = StudentDataset.getAll(); + return studengList; + } + + } +} diff --git a/201731024235/WinFromDianMing/DataBase/DataBase.csproj b/201731024235/WinFromDianMing/DataBase/DataBase.csproj new file mode 100644 index 0000000..e569915 --- /dev/null +++ b/201731024235/WinFromDianMing/DataBase/DataBase.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {27CC8072-7612-4492-913D-2E03A6C37FD1} + Library + Properties + DataBase + DataBase + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + {23c35d64-584f-4aeb-b53b-d8ac0250bd0b} + Entity + + + + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/DataBase/Properties/AssemblyInfo.cs b/201731024235/WinFromDianMing/DataBase/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3c55188 --- /dev/null +++ b/201731024235/WinFromDianMing/DataBase/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("DataBase")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DataBase")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("71f11392-70a3-4390-8f7a-61923dda8486")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/201731024235/WinFromDianMing/DataBase/StudentDataset.cs b/201731024235/WinFromDianMing/DataBase/StudentDataset.cs new file mode 100644 index 0000000..600f71e --- /dev/null +++ b/201731024235/WinFromDianMing/DataBase/StudentDataset.cs @@ -0,0 +1,234 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Entity; + +namespace DataBase +{ + public class StudentDataset + { + private static List studengList; + + + public static List getAll() + { + studengList = new List(); + + Student stu1 = new Student("001", "王川", "男"); + studengList.Add(stu1); + Student stu2 = new Student("002", "于丁", "男"); + studengList.Add(stu2); + + Student stu3 = new Student("003", "张莹", "女"); + studengList.Add(stu3); + Student stu4 = new Student("004", "李楠", "女"); + studengList.Add(stu4); + + Student stu5 = new Student("005", "陈欣", "女"); + studengList.Add(stu5); + Student stu6 = new Student("006", "马芸慧", "女"); + studengList.Add(stu6); + + Student stu7 = new Student("007", "汪小萍", "女"); + studengList.Add(stu7); + Student stu8 = new Student("008", "母丹", "女"); + studengList.Add(stu8); + + + Student stu9 = new Student("009", "许博", "女"); + studengList.Add(stu9); + Student stu10 = new Student("010", "芦文钰", "女"); + studengList.Add(stu10); + + Student stu11 = new Student("011", "马昊妍", "女"); + studengList.Add(stu11); + Student stu12 = new Student("012", "李宣晓", "女"); + studengList.Add(stu12); + + Student stu13 = new Student("013", "李清兰", "女"); + studengList.Add(stu13); + Student stu14 = new Student("014", "成湘", "女"); + studengList.Add(stu14); + + Student stu15 = new Student("015", "罗涵", "女"); + studengList.Add(stu15); + Student stu16 = new Student("016", "肖逸菲", "女"); + studengList.Add(stu16); + + Student stu17 = new Student("017", "冯士坤", "男"); + studengList.Add(stu17); + Student stu18 = new Student("018", "杨汶桐", "男"); + studengList.Add(stu18); + + Student stu19 = new Student("019", "张焱菁", "男"); + studengList.Add(stu19); + Student stu20 = new Student("020", "雷槟源", "男"); + studengList.Add(stu20); + + Student stu21 = new Student("021", "李志", "男"); + studengList.Add(stu21); + Student stu22 = new Student("022", "黄涛", "男"); + studengList.Add(stu22); + + Student stu23 = new Student("023", "宋杰", "男"); + studengList.Add(stu23); + Student stu24 = new Student("024", "赵俊安", "男"); + studengList.Add(stu24); + + + Student stu25 = new Student("025", "张新明", "男"); + studengList.Add(stu25); + Student stu26 = new Student("026", "张旭", "男"); + studengList.Add(stu26); + + Student stu27 = new Student("027", "王旭", "男"); + studengList.Add(stu27); + Student stu28 = new Student("028", "李朋珂", "男"); + studengList.Add(stu28); + + Student stu29 = new Student("029", "张微玖", "男"); + studengList.Add(stu29); + Student stu30 = new Student("030", "何明钦", "男"); + studengList.Add(stu30); + + Student stu31 = new Student("031", "姜玖林", "男"); + studengList.Add(stu31); + Student stu32 = new Student("032", "涂才森", "男"); + studengList.Add(stu32); + + + + Student stu33 = new Student("033", "陈林", "男"); + studengList.Add(stu33); + Student stu34 = new Student("034", "曾正男", "男"); + studengList.Add(stu34); + + Student stu35 = new Student("035", "江天宇", "男"); + studengList.Add(stu35); + Student stu36 = new Student("036", "魏恩博", "男"); + studengList.Add(stu36); + + Student stu37 = new Student("037", "邹扬锋", "男"); + studengList.Add(stu37); + Student stu38 = new Student("038", "曾琅", "男"); + studengList.Add(stu38); + + Student stu39 = new Student("039", "周成杰", "男"); + studengList.Add(stu39); + + Student stu40 = new Student("040", "马驰", "男"); + studengList.Add(stu40); + + Student stu41 = new Student("041", "宋树钱", "男"); + studengList.Add(stu41); + Student stu42 = new Student("042", "马驰", "男"); + studengList.Add(stu42); + Student stu43 = new Student("043", "任星辰", "男"); + studengList.Add(stu43); + + Student stu44 = new Student("044", "严一笑", "男"); + studengList.Add(stu44); + Student stu45 = new Student("101", "孙颖", "女"); + studengList.Add(stu45); + Student stu46 = new Student("102", "吴明益", "女"); + studengList.Add(stu46); + Student stu47 = new Student("103", "黄耀萱", "女"); + studengList.Add(stu47); + Student stu48 = new Student("104", "王静宜", "女"); + studengList.Add(stu48); + Student stu49 = new Student("105", "蔡玉蓝", "女"); + studengList.Add(stu49); + + Student stu50 = new Student("106", "姜仪", "女"); + studengList.Add(stu50); + + Student stu51 = new Student("107", "郑雪", "女"); + studengList.Add(stu51); + Student stu52 = new Student("108", "刘俊", "女"); + studengList.Add(stu52); + Student stu53 = new Student("109", "何玉姣", "女"); + studengList.Add(stu53); + Student stu54 = new Student("110", "匡小娟", "女"); + studengList.Add(stu54); + Student stu55 = new Student("111", "王春兰", "女"); + studengList.Add(stu55); + Student stu56 = new Student("112", "顾毓", "女"); + studengList.Add(stu56); + Student stu57 = new Student("113", "师志杰", "男"); + studengList.Add(stu57); + Student stu58 = new Student("114", "许佳文", "男"); + studengList.Add(stu58); + Student stu59 = new Student("115", "雷安勇", "男"); + studengList.Add(stu59); + + Student stu60 = new Student("116", "张伟", "男"); + studengList.Add(stu60); + + + Student stu61 = new Student("117", "袁志杰", "男"); + studengList.Add(stu61); + Student stu62 = new Student("118", "何全江", "男"); + studengList.Add(stu62); + Student stu63 = new Student("119", "舒鹏飞", "男"); + studengList.Add(stu63); + Student stu64 = new Student("120", "何辉", "男"); + studengList.Add(stu64); + Student stu65 = new Student("121", "李全喜", "男"); + studengList.Add(stu65); + Student stu66 = new Student("122", "谢凯宇", "男"); + studengList.Add(stu66); + Student stu67 = new Student("123", "黄本巍", "男"); + studengList.Add(stu67); + Student stu68 = new Student("124", "罗俊杰", "男"); + studengList.Add(stu68); + Student stu69 = new Student("125", "何宸锐", "男"); + studengList.Add(stu69); + Student stu70 = new Student("126", "付昶宇", "男"); + studengList.Add(stu70); + Student stu71 = new Student("127", "傅伟鑫", "男"); + studengList.Add(stu71); + + Student stu72 = new Student("128", "王云飞", "男"); + studengList.Add(stu72); + + Student stu73 = new Student("129", "李元港", "男"); + studengList.Add(stu73); + + Student stu74 = new Student("130", "赵荣泽", "男"); + studengList.Add(stu74); + + Student stu75 = new Student("131", "吴郑浩", "男"); + studengList.Add(stu75); + + Student stu76 = new Student("132", "何继武", "男"); + studengList.Add(stu76); + + Student stu77 = new Student("133", "郑博", "男"); + studengList.Add(stu77); + + Student stu78 = new Student("134", "王万成", "男"); + studengList.Add(stu78); + + Student stu79 = new Student("135", "陈杰", "男"); + studengList.Add(stu79); + + Student stu80 = new Student("136", "胡志伟", "男"); + studengList.Add(stu80); + + Student stu81 = new Student("137", "涂林", "男"); + studengList.Add(stu81); + Student stu82 = new Student("138", "孟诚成", "男"); + studengList.Add(stu82); + Student stu83 = new Student("139", "廖志丹", "男"); + studengList.Add(stu83); + Student stu84 = new Student("140", "杨也", "女"); + studengList.Add(stu84); + + + return studengList; + } + } +} diff --git a/201731024235/WinFromDianMing/EntityTests/EntityTests.csproj b/201731024235/WinFromDianMing/EntityTests/EntityTests.csproj new file mode 100644 index 0000000..e1c0f3a --- /dev/null +++ b/201731024235/WinFromDianMing/EntityTests/EntityTests.csproj @@ -0,0 +1,89 @@ + + + + Debug + AnyCPU + {4E6FEC85-735E-4A74-92E8-B90705C15F76} + Library + Properties + EntityTests + EntityTests + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B} + Entity + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/EntityTests/Properties/AssemblyInfo.cs b/201731024235/WinFromDianMing/EntityTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..beb632b --- /dev/null +++ b/201731024235/WinFromDianMing/EntityTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("EntityTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("EntityTests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +//将 ComVisible 设置为 false 将使此程序集中的类型 +//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("4e6fec85-735e-4a74-92e8-b90705c15f76")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/201731024235/WinFromDianMing/EntityTests/StudentTests.cs b/201731024235/WinFromDianMing/EntityTests/StudentTests.cs new file mode 100644 index 0000000..98580d4 --- /dev/null +++ b/201731024235/WinFromDianMing/EntityTests/StudentTests.cs @@ -0,0 +1,20 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Entity.Tests +{ + [TestClass()] + public class StudentTests + { + [TestMethod()] + public void StudentTest() + { + + } + } +} \ No newline at end of file diff --git a/201731024235/WinFromDianMing/RecorData/DianMingRecord.cs b/201731024235/WinFromDianMing/RecorData/DianMingRecord.cs new file mode 100644 index 0000000..2e725f4 --- /dev/null +++ b/201731024235/WinFromDianMing/RecorData/DianMingRecord.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RecordData +{ + public class DianMingRecord + { + + } +} diff --git a/201731024235/WinFromDianMing/RecorData/Properties/AssemblyInfo.cs b/201731024235/WinFromDianMing/RecorData/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..109d5e3 --- /dev/null +++ b/201731024235/WinFromDianMing/RecorData/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("RecorData")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RecorData")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("4c75062e-8312-4795-99d4-0feaed4854b6")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/201731024235/WinFromDianMing/RecorData/RecordData.csproj b/201731024235/WinFromDianMing/RecorData/RecordData.csproj new file mode 100644 index 0000000..2aa4915 --- /dev/null +++ b/201731024235/WinFromDianMing/RecorData/RecordData.csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + {56491460-D725-4F40-A1DD-30F03773B5A8} + Library + Properties + RecordData + RecorData + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/RecorData/ShowRecordData.resx b/201731024235/WinFromDianMing/RecorData/ShowRecordData.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/201731024235/WinFromDianMing/RecorData/ShowRecordData.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/Student/Entity.csproj b/201731024235/WinFromDianMing/Student/Entity.csproj new file mode 100644 index 0000000..1536554 --- /dev/null +++ b/201731024235/WinFromDianMing/Student/Entity.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B} + Library + Properties + Entity + Entity + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/Student/Properties/AssemblyInfo.cs b/201731024235/WinFromDianMing/Student/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..db5b306 --- /dev/null +++ b/201731024235/WinFromDianMing/Student/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Student")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Student")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("20ccc54d-39a5-4227-b0cd-ffedf5894b79")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/201731024235/WinFromDianMing/Student/Student.cs b/201731024235/WinFromDianMing/Student/Student.cs new file mode 100644 index 0000000..fa2b7ef --- /dev/null +++ b/201731024235/WinFromDianMing/Student/Student.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Entity +{ + public class Student + { + private String id; + + public String Id + { + get { return id; } + set { id = value; } + } + + private String name; + + public String Name + { + get { return name; } + set { name = value; } + } + + private String sex; + + public String Sex + { + get { return sex; } + set { sex = value; } + } + + public Student() + { + + } + public Student(String id, String name, String sex) + { + this.id = id; + this.name = name; + this.sex = sex; + } + } +} diff --git a/201731024235/WinFromDianMing/UnitTestDianMing/Properties/AssemblyInfo.cs b/201731024235/WinFromDianMing/UnitTestDianMing/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d9f20de --- /dev/null +++ b/201731024235/WinFromDianMing/UnitTestDianMing/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下特性集 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("UnitTestDianMing")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UnitTestDianMing")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 请将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("bf2774f0-836a-4010-a208-e1d9acf2852a")] + +// 程序集的版本信息由以下四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/201731024235/WinFromDianMing/UnitTestDianMing/UnitTest1.cs b/201731024235/WinFromDianMing/UnitTestDianMing/UnitTest1.cs new file mode 100644 index 0000000..85fc9a3 --- /dev/null +++ b/201731024235/WinFromDianMing/UnitTestDianMing/UnitTest1.cs @@ -0,0 +1,17 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using WinFromDianMing; + +namespace UnitTestDianMing +{ + [TestClass] + public class UnitTestFormStudet + { + [TestMethod] + public void TestFormStudet() + { + FormStudet Test = new FormStudet(); + Test.Show(); + } + } +} diff --git a/201731024235/WinFromDianMing/UnitTestDianMing/UnitTestDianMing.csproj b/201731024235/WinFromDianMing/UnitTestDianMing/UnitTestDianMing.csproj new file mode 100644 index 0000000..4dd7e76 --- /dev/null +++ b/201731024235/WinFromDianMing/UnitTestDianMing/UnitTestDianMing.csproj @@ -0,0 +1,90 @@ + + + + Debug + AnyCPU + {FB28D548-674B-439D-ADBC-1FD7D517F453} + Library + Properties + UnitTestDianMing + UnitTestDianMing + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + {34a07153-e243-4f4a-a255-4ab435d038ef} + WinFromDianMing + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/WinFromDianMing.sln b/201731024235/WinFromDianMing/WinFromDianMing.sln new file mode 100644 index 0000000..3ec35c0 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing.sln @@ -0,0 +1,52 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFromDianMing", "WinFromDianMing\WinFromDianMing.csproj", "{34A07153-E243-4F4A-A255-4AB435D038EF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entity", "Student\Entity.csproj", "{23C35D64-584F-4AEB-B53B-D8AC0250BD0B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataBase", "DataBase\DataBase.csproj", "{27CC8072-7612-4492-913D-2E03A6C37FD1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DaoLayer", "DaoLayer\DaoLayer.csproj", "{829E28C4-F286-49AC-904C-6BED236D6339}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecordData", "RecorData\RecordData.csproj", "{56491460-D725-4F40-A1DD-30F03773B5A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityTests", "EntityTests\EntityTests.csproj", "{4E6FEC85-735E-4A74-92E8-B90705C15F76}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {34A07153-E243-4F4A-A255-4AB435D038EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34A07153-E243-4F4A-A255-4AB435D038EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34A07153-E243-4F4A-A255-4AB435D038EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34A07153-E243-4F4A-A255-4AB435D038EF}.Release|Any CPU.Build.0 = Release|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Release|Any CPU.Build.0 = Release|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Release|Any CPU.Build.0 = Release|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Debug|Any CPU.Build.0 = Debug|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Release|Any CPU.ActiveCfg = Release|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Release|Any CPU.Build.0 = Release|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Release|Any CPU.Build.0 = Release|Any CPU + {4E6FEC85-735E-4A74-92E8-B90705C15F76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E6FEC85-735E-4A74-92E8-B90705C15F76}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E6FEC85-735E-4A74-92E8-B90705C15F76}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E6FEC85-735E-4A74-92E8-B90705C15F76}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/201731024235/WinFromDianMing/WinFromDianMing/App.config b/201731024235/WinFromDianMing/WinFromDianMing/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.Designer.cs b/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.Designer.cs new file mode 100644 index 0000000..d1d9a6f --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.Designer.cs @@ -0,0 +1,278 @@ +namespace WinFromDianMing +{ + partial class FormStudet + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.dataGVList = new System.Windows.Forms.DataGridView(); + this.StudentNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.StudengName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.StuSex = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.pnlProgress = new System.Windows.Forms.Panel(); + this.progressName = new System.Windows.Forms.ProgressBar(); + this.panel4 = new System.Windows.Forms.Panel(); + this.btnStop = new System.Windows.Forms.Button(); + this.btnStart = new System.Windows.Forms.Button(); + this.btnRecord = new System.Windows.Forms.Button(); + this.btnLoadStu = new System.Windows.Forms.Button(); + this.panel5 = new System.Windows.Forms.Panel(); + this.timerCountStu = new System.Windows.Forms.Timer(this.components); + this.lblName = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGVList)).BeginInit(); + this.pnlProgress.SuspendLayout(); + this.panel4.SuspendLayout(); + this.panel5.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(594, 30); + this.panel1.TabIndex = 0; + // + // label1 + // + this.label1.AccessibleRole = System.Windows.Forms.AccessibleRole.None; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(22, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(67, 15); + this.label1.TabIndex = 0; + this.label1.Text = "学生列表"; + // + // panel2 + // + this.panel2.Controls.Add(this.dataGVList); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(0, 30); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(594, 222); + this.panel2.TabIndex = 1; + // + // dataGVList + // + this.dataGVList.AllowUserToAddRows = false; + this.dataGVList.AllowUserToDeleteRows = false; + this.dataGVList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGVList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.StudentNum, + this.StudengName, + this.StuSex}); + this.dataGVList.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGVList.Location = new System.Drawing.Point(0, 0); + this.dataGVList.Name = "dataGVList"; + this.dataGVList.ReadOnly = true; + this.dataGVList.RowTemplate.Height = 27; + this.dataGVList.Size = new System.Drawing.Size(594, 222); + this.dataGVList.TabIndex = 0; + // + // StudentNum + // + this.StudentNum.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + this.StudentNum.DataPropertyName = "stuID"; + this.StudentNum.HeaderText = "学号"; + this.StudentNum.Name = "StudentNum"; + this.StudentNum.ReadOnly = true; + this.StudentNum.Width = 66; + // + // StudengName + // + this.StudengName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.StudengName.DataPropertyName = "stuName"; + this.StudengName.HeaderText = "姓名"; + this.StudengName.Name = "StudengName"; + this.StudengName.ReadOnly = true; + // + // StuSex + // + this.StuSex.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.StuSex.DataPropertyName = "stuSex"; + this.StuSex.HeaderText = "性别"; + this.StuSex.Name = "StuSex"; + this.StuSex.ReadOnly = true; + // + // pnlProgress + // + this.pnlProgress.Controls.Add(this.progressName); + this.pnlProgress.Dock = System.Windows.Forms.DockStyle.Top; + this.pnlProgress.Location = new System.Drawing.Point(0, 252); + this.pnlProgress.Name = "pnlProgress"; + this.pnlProgress.Size = new System.Drawing.Size(594, 30); + this.pnlProgress.TabIndex = 2; + // + // progressName + // + this.progressName.Dock = System.Windows.Forms.DockStyle.Fill; + this.progressName.Location = new System.Drawing.Point(0, 0); + this.progressName.Name = "progressName"; + this.progressName.Size = new System.Drawing.Size(594, 30); + this.progressName.TabIndex = 0; + // + // panel4 + // + this.panel4.Controls.Add(this.btnStop); + this.panel4.Controls.Add(this.btnStart); + this.panel4.Controls.Add(this.btnRecord); + this.panel4.Controls.Add(this.btnLoadStu); + this.panel4.Dock = System.Windows.Forms.DockStyle.Right; + this.panel4.Location = new System.Drawing.Point(357, 282); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(237, 83); + this.panel4.TabIndex = 3; + // + // btnStop + // + this.btnStop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnStop.Location = new System.Drawing.Point(83, 44); + this.btnStop.Name = "btnStop"; + this.btnStop.Size = new System.Drawing.Size(78, 32); + this.btnStop.TabIndex = 3; + this.btnStop.Text = "停止点名"; + this.btnStop.UseVisualStyleBackColor = false; + this.btnStop.MouseCaptureChanged += new System.EventHandler(this.btnStop_Click); + // + // btnStart + // + this.btnStart.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnStart.Location = new System.Drawing.Point(83, 6); + this.btnStart.Name = "btnStart"; + this.btnStart.Size = new System.Drawing.Size(78, 32); + this.btnStart.TabIndex = 2; + this.btnStart.Text = "开始点名"; + this.btnStart.UseVisualStyleBackColor = false; + this.btnStart.Click += new System.EventHandler(this.btnStart_Click); + // + // btnRecord + // + this.btnRecord.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnRecord.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnRecord.Location = new System.Drawing.Point(174, 6); + this.btnRecord.Name = "btnRecord"; + this.btnRecord.Size = new System.Drawing.Size(46, 70); + this.btnRecord.TabIndex = 1; + this.btnRecord.Text = "点名记录"; + this.btnRecord.UseVisualStyleBackColor = false; + this.btnRecord.Click += new System.EventHandler(this.btnRecord_Click); + // + // btnLoadStu + // + this.btnLoadStu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnLoadStu.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnLoadStu.Location = new System.Drawing.Point(21, 6); + this.btnLoadStu.Name = "btnLoadStu"; + this.btnLoadStu.Size = new System.Drawing.Size(46, 70); + this.btnLoadStu.TabIndex = 0; + this.btnLoadStu.Text = "加载学生"; + this.btnLoadStu.UseVisualStyleBackColor = false; + this.btnLoadStu.Click += new System.EventHandler(this.btnLoadStu_Click); + // + // panel5 + // + this.panel5.BackColor = System.Drawing.Color.Aqua; + this.panel5.Controls.Add(this.lblName); + this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel5.Location = new System.Drawing.Point(0, 282); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(357, 83); + this.panel5.TabIndex = 4; + // + // timerCountStu + // + this.timerCountStu.Tick += new System.EventHandler(this.timerCountStu_Tick); + // + // lblName + // + this.lblName.AutoSize = true; + this.lblName.Font = new System.Drawing.Font("宋体", 22.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.lblName.Location = new System.Drawing.Point(99, 22); + this.lblName.Name = "lblName"; + this.lblName.Size = new System.Drawing.Size(0, 38); + this.lblName.TabIndex = 0; + // + // FormStudet + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(594, 365); + this.Controls.Add(this.panel5); + this.Controls.Add(this.panel4); + this.Controls.Add(this.pnlProgress); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MinimumSize = new System.Drawing.Size(612, 412); + this.Name = "FormStudet"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "结对点名系统"; + this.Load += new System.EventHandler(this.FrmStudent_Load); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGVList)).EndInit(); + this.pnlProgress.ResumeLayout(false); + this.panel4.ResumeLayout(false); + this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.DataGridView dataGVList; + private System.Windows.Forms.Panel pnlProgress; + private System.Windows.Forms.ProgressBar progressName; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Button btnRecord; + private System.Windows.Forms.Button btnLoadStu; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.Timer timerCountStu; + private System.Windows.Forms.Button btnStop; + private System.Windows.Forms.Button btnStart; + private System.Windows.Forms.DataGridViewTextBoxColumn StudentNum; + private System.Windows.Forms.DataGridViewTextBoxColumn StudengName; + private System.Windows.Forms.DataGridViewTextBoxColumn StuSex; + private System.Windows.Forms.Label lblName; + } +} \ No newline at end of file diff --git a/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.cs b/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.cs new file mode 100644 index 0000000..dcf5934 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +using DaoLayer; +using Entity; +using System.Threading; +using RecordData; + +namespace WinFromDianMing +{ + public partial class FormStudet : Form + { + List stuList; + public FormStudet() + { + InitializeComponent(); + } + void iniControl() + { + btnStart.Visible = false; + btnStop.Visible = false; + btnRecord.Visible = false; + btnLoadStu.Enabled = true; + } + + void setControlVisible() + { + btnStart.Visible = true; + btnStop.Visible = true; + btnRecord.Visible = true; + btnLoadStu.Visible = false; + } + + private void btnLoadStu_Click(object sender, EventArgs e) + { + + //获取学生数据源 + StudentDAO stuDao = new StudentDAO(); + stuList = stuDao.getAllStudents(); + + //进度条设置 + int stuCounts = stuList.Count;//及时学生人数 + progressName.Maximum = stuCounts; + + + //构造数据源 + DataTable dt = new DataTable(); + dt.Columns.Add("stuID", Type.GetType("System.String")); + dt.Columns.Add("stuName", Type.GetType("System.String")); + dt.Columns.Add("stuSex", Type.GetType("System.String")); + + //数据加载以进度条方式展现 + foreach (Student stu in stuList) + { + dt.Rows.Add(stu.Id, stu.Name, stu.Sex); + progressName.Value += 1;//一个学生,进度条加1; + Thread.Sleep(50); + } + + dataGVList.DataSource = dt; + + setControlVisible(); + + } + + + private void FrmStudent_Load(object sender, EventArgs e) + { + iniControl(); + } + + private void timerCountStu_Tick(object sender, EventArgs e) + { + Random ra = new Random(); + int i = ra.Next(stuList.Count); + lblName.Text = stuList[i].Name; + } + + private void btnStart_Click(object sender, EventArgs e) + { + timerCountStu.Start(); + } + + private void btnStop_Click(object sender, EventArgs e) + { + timerCountStu.Stop(); + } + + private void btnRecord_Click(object sender, EventArgs e) + { + + } + + } +} diff --git a/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.resx b/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.resx new file mode 100644 index 0000000..7ce11fa --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/FormStudet.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + 17, 17 + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/WinFromDianMing/Program.cs b/201731024235/WinFromDianMing/WinFromDianMing/Program.cs new file mode 100644 index 0000000..10ae298 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WinFromDianMing +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormStudet()); + } + } +} diff --git a/201731024235/WinFromDianMing/WinFromDianMing/Properties/AssemblyInfo.cs b/201731024235/WinFromDianMing/WinFromDianMing/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e080187 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("WinFromDianMing")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WinFromDianMing")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("5a4bf504-28eb-46de-a20c-02dd81c4f2e5")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/201731024235/WinFromDianMing/WinFromDianMing/Properties/Resources.Designer.cs b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Resources.Designer.cs new file mode 100644 index 0000000..487570d --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace WinFromDianMing.Properties +{ + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// 返回此类使用的、缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinFromDianMing.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, + /// 方法是使用此强类型资源类。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/201731024235/WinFromDianMing/WinFromDianMing/Properties/Resources.resx b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/201731024235/WinFromDianMing/WinFromDianMing/Properties/Settings.Designer.cs b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Settings.Designer.cs new file mode 100644 index 0000000..aeb8c89 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WinFromDianMing.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/201731024235/WinFromDianMing/WinFromDianMing/Properties/Settings.settings b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/201731024235/WinFromDianMing/WinFromDianMing/WinFromDianMing.csproj b/201731024235/WinFromDianMing/WinFromDianMing/WinFromDianMing.csproj new file mode 100644 index 0000000..464c609 --- /dev/null +++ b/201731024235/WinFromDianMing/WinFromDianMing/WinFromDianMing.csproj @@ -0,0 +1,102 @@ + + + + + Debug + AnyCPU + {34A07153-E243-4F4A-A255-4AB435D038EF} + WinExe + Properties + WinFromDianMing + WinFromDianMing + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + Form + + + FormStudet.cs + + + + + FormStudet.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {829e28c4-f286-49ac-904c-6bed236d6339} + DaoLayer + + + {56491460-d725-4f40-a1dd-30f03773b5a8} + RecordData + + + {23c35d64-584f-4aeb-b53b-d8ac0250bd0b} + Entity + + + + + \ No newline at end of file diff --git a/WinFromDianMing/DaoLayer/DaoLayer.csproj b/WinFromDianMing/DaoLayer/DaoLayer.csproj new file mode 100644 index 0000000..49e5e78 --- /dev/null +++ b/WinFromDianMing/DaoLayer/DaoLayer.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {829E28C4-F286-49AC-904C-6BED236D6339} + Library + Properties + DaoLayer + DaoLayer + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + {27cc8072-7612-4492-913d-2e03a6c37fd1} + DataBase + + + {23c35d64-584f-4aeb-b53b-d8ac0250bd0b} + Entity + + + + + \ No newline at end of file diff --git a/WinFromDianMing/DaoLayer/Properties/AssemblyInfo.cs b/WinFromDianMing/DaoLayer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e86a6e6 --- /dev/null +++ b/WinFromDianMing/DaoLayer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("DaoLayer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DaoLayer")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("a90f3caf-b644-4fb3-b256-0eb2b6c58c92")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinFromDianMing/DaoLayer/StudentDAO.cs b/WinFromDianMing/DaoLayer/StudentDAO.cs new file mode 100644 index 0000000..e832662 --- /dev/null +++ b/WinFromDianMing/DaoLayer/StudentDAO.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Entity; +using DataBase; + +namespace DaoLayer +{ + public class StudentDAO + { + public int getStudentRecordsNums() + { + List studengList = StudentDataset.getAll(); + return studengList.Count; + } + + public List getAllStudents() + { + List studengList = StudentDataset.getAll(); + return studengList; + } + + } +} diff --git a/WinFromDianMing/DataBase/DataBase.csproj b/WinFromDianMing/DataBase/DataBase.csproj new file mode 100644 index 0000000..e569915 --- /dev/null +++ b/WinFromDianMing/DataBase/DataBase.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {27CC8072-7612-4492-913D-2E03A6C37FD1} + Library + Properties + DataBase + DataBase + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + {23c35d64-584f-4aeb-b53b-d8ac0250bd0b} + Entity + + + + + \ No newline at end of file diff --git a/WinFromDianMing/DataBase/Properties/AssemblyInfo.cs b/WinFromDianMing/DataBase/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3c55188 --- /dev/null +++ b/WinFromDianMing/DataBase/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("DataBase")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DataBase")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("71f11392-70a3-4390-8f7a-61923dda8486")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinFromDianMing/DataBase/StudentDataset.cs b/WinFromDianMing/DataBase/StudentDataset.cs new file mode 100644 index 0000000..600f71e --- /dev/null +++ b/WinFromDianMing/DataBase/StudentDataset.cs @@ -0,0 +1,234 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Entity; + +namespace DataBase +{ + public class StudentDataset + { + private static List studengList; + + + public static List getAll() + { + studengList = new List(); + + Student stu1 = new Student("001", "王川", "男"); + studengList.Add(stu1); + Student stu2 = new Student("002", "于丁", "男"); + studengList.Add(stu2); + + Student stu3 = new Student("003", "张莹", "女"); + studengList.Add(stu3); + Student stu4 = new Student("004", "李楠", "女"); + studengList.Add(stu4); + + Student stu5 = new Student("005", "陈欣", "女"); + studengList.Add(stu5); + Student stu6 = new Student("006", "马芸慧", "女"); + studengList.Add(stu6); + + Student stu7 = new Student("007", "汪小萍", "女"); + studengList.Add(stu7); + Student stu8 = new Student("008", "母丹", "女"); + studengList.Add(stu8); + + + Student stu9 = new Student("009", "许博", "女"); + studengList.Add(stu9); + Student stu10 = new Student("010", "芦文钰", "女"); + studengList.Add(stu10); + + Student stu11 = new Student("011", "马昊妍", "女"); + studengList.Add(stu11); + Student stu12 = new Student("012", "李宣晓", "女"); + studengList.Add(stu12); + + Student stu13 = new Student("013", "李清兰", "女"); + studengList.Add(stu13); + Student stu14 = new Student("014", "成湘", "女"); + studengList.Add(stu14); + + Student stu15 = new Student("015", "罗涵", "女"); + studengList.Add(stu15); + Student stu16 = new Student("016", "肖逸菲", "女"); + studengList.Add(stu16); + + Student stu17 = new Student("017", "冯士坤", "男"); + studengList.Add(stu17); + Student stu18 = new Student("018", "杨汶桐", "男"); + studengList.Add(stu18); + + Student stu19 = new Student("019", "张焱菁", "男"); + studengList.Add(stu19); + Student stu20 = new Student("020", "雷槟源", "男"); + studengList.Add(stu20); + + Student stu21 = new Student("021", "李志", "男"); + studengList.Add(stu21); + Student stu22 = new Student("022", "黄涛", "男"); + studengList.Add(stu22); + + Student stu23 = new Student("023", "宋杰", "男"); + studengList.Add(stu23); + Student stu24 = new Student("024", "赵俊安", "男"); + studengList.Add(stu24); + + + Student stu25 = new Student("025", "张新明", "男"); + studengList.Add(stu25); + Student stu26 = new Student("026", "张旭", "男"); + studengList.Add(stu26); + + Student stu27 = new Student("027", "王旭", "男"); + studengList.Add(stu27); + Student stu28 = new Student("028", "李朋珂", "男"); + studengList.Add(stu28); + + Student stu29 = new Student("029", "张微玖", "男"); + studengList.Add(stu29); + Student stu30 = new Student("030", "何明钦", "男"); + studengList.Add(stu30); + + Student stu31 = new Student("031", "姜玖林", "男"); + studengList.Add(stu31); + Student stu32 = new Student("032", "涂才森", "男"); + studengList.Add(stu32); + + + + Student stu33 = new Student("033", "陈林", "男"); + studengList.Add(stu33); + Student stu34 = new Student("034", "曾正男", "男"); + studengList.Add(stu34); + + Student stu35 = new Student("035", "江天宇", "男"); + studengList.Add(stu35); + Student stu36 = new Student("036", "魏恩博", "男"); + studengList.Add(stu36); + + Student stu37 = new Student("037", "邹扬锋", "男"); + studengList.Add(stu37); + Student stu38 = new Student("038", "曾琅", "男"); + studengList.Add(stu38); + + Student stu39 = new Student("039", "周成杰", "男"); + studengList.Add(stu39); + + Student stu40 = new Student("040", "马驰", "男"); + studengList.Add(stu40); + + Student stu41 = new Student("041", "宋树钱", "男"); + studengList.Add(stu41); + Student stu42 = new Student("042", "马驰", "男"); + studengList.Add(stu42); + Student stu43 = new Student("043", "任星辰", "男"); + studengList.Add(stu43); + + Student stu44 = new Student("044", "严一笑", "男"); + studengList.Add(stu44); + Student stu45 = new Student("101", "孙颖", "女"); + studengList.Add(stu45); + Student stu46 = new Student("102", "吴明益", "女"); + studengList.Add(stu46); + Student stu47 = new Student("103", "黄耀萱", "女"); + studengList.Add(stu47); + Student stu48 = new Student("104", "王静宜", "女"); + studengList.Add(stu48); + Student stu49 = new Student("105", "蔡玉蓝", "女"); + studengList.Add(stu49); + + Student stu50 = new Student("106", "姜仪", "女"); + studengList.Add(stu50); + + Student stu51 = new Student("107", "郑雪", "女"); + studengList.Add(stu51); + Student stu52 = new Student("108", "刘俊", "女"); + studengList.Add(stu52); + Student stu53 = new Student("109", "何玉姣", "女"); + studengList.Add(stu53); + Student stu54 = new Student("110", "匡小娟", "女"); + studengList.Add(stu54); + Student stu55 = new Student("111", "王春兰", "女"); + studengList.Add(stu55); + Student stu56 = new Student("112", "顾毓", "女"); + studengList.Add(stu56); + Student stu57 = new Student("113", "师志杰", "男"); + studengList.Add(stu57); + Student stu58 = new Student("114", "许佳文", "男"); + studengList.Add(stu58); + Student stu59 = new Student("115", "雷安勇", "男"); + studengList.Add(stu59); + + Student stu60 = new Student("116", "张伟", "男"); + studengList.Add(stu60); + + + Student stu61 = new Student("117", "袁志杰", "男"); + studengList.Add(stu61); + Student stu62 = new Student("118", "何全江", "男"); + studengList.Add(stu62); + Student stu63 = new Student("119", "舒鹏飞", "男"); + studengList.Add(stu63); + Student stu64 = new Student("120", "何辉", "男"); + studengList.Add(stu64); + Student stu65 = new Student("121", "李全喜", "男"); + studengList.Add(stu65); + Student stu66 = new Student("122", "谢凯宇", "男"); + studengList.Add(stu66); + Student stu67 = new Student("123", "黄本巍", "男"); + studengList.Add(stu67); + Student stu68 = new Student("124", "罗俊杰", "男"); + studengList.Add(stu68); + Student stu69 = new Student("125", "何宸锐", "男"); + studengList.Add(stu69); + Student stu70 = new Student("126", "付昶宇", "男"); + studengList.Add(stu70); + Student stu71 = new Student("127", "傅伟鑫", "男"); + studengList.Add(stu71); + + Student stu72 = new Student("128", "王云飞", "男"); + studengList.Add(stu72); + + Student stu73 = new Student("129", "李元港", "男"); + studengList.Add(stu73); + + Student stu74 = new Student("130", "赵荣泽", "男"); + studengList.Add(stu74); + + Student stu75 = new Student("131", "吴郑浩", "男"); + studengList.Add(stu75); + + Student stu76 = new Student("132", "何继武", "男"); + studengList.Add(stu76); + + Student stu77 = new Student("133", "郑博", "男"); + studengList.Add(stu77); + + Student stu78 = new Student("134", "王万成", "男"); + studengList.Add(stu78); + + Student stu79 = new Student("135", "陈杰", "男"); + studengList.Add(stu79); + + Student stu80 = new Student("136", "胡志伟", "男"); + studengList.Add(stu80); + + Student stu81 = new Student("137", "涂林", "男"); + studengList.Add(stu81); + Student stu82 = new Student("138", "孟诚成", "男"); + studengList.Add(stu82); + Student stu83 = new Student("139", "廖志丹", "男"); + studengList.Add(stu83); + Student stu84 = new Student("140", "杨也", "女"); + studengList.Add(stu84); + + + return studengList; + } + } +} diff --git a/WinFromDianMing/RecorData/DianMingRecord.cs b/WinFromDianMing/RecorData/DianMingRecord.cs new file mode 100644 index 0000000..609887b --- /dev/null +++ b/WinFromDianMing/RecorData/DianMingRecord.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RecordData +{ + public class DianMingRecord + { + public string[] recordData = new string[100]; + int i = 0; + + public void DMrecord(string stuName) + { + recordData[i] = stuName; + i++; + } + + public string ShowRecord() + { + string data = null; + for(int j = 0 ;j <= i; j++) + { + data += recordData[j]; + data += "\r"; + } + return data; + } + } +} diff --git a/WinFromDianMing/RecorData/Properties/AssemblyInfo.cs b/WinFromDianMing/RecorData/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..109d5e3 --- /dev/null +++ b/WinFromDianMing/RecorData/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("RecorData")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RecorData")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("4c75062e-8312-4795-99d4-0feaed4854b6")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinFromDianMing/RecorData/RecordData.csproj b/WinFromDianMing/RecorData/RecordData.csproj new file mode 100644 index 0000000..2aa4915 --- /dev/null +++ b/WinFromDianMing/RecorData/RecordData.csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + {56491460-D725-4F40-A1DD-30F03773B5A8} + Library + Properties + RecordData + RecorData + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WinFromDianMing/RecorData/ShowRecordData.resx b/WinFromDianMing/RecorData/ShowRecordData.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/WinFromDianMing/RecorData/ShowRecordData.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinFromDianMing/Student/Entity.csproj b/WinFromDianMing/Student/Entity.csproj new file mode 100644 index 0000000..1536554 --- /dev/null +++ b/WinFromDianMing/Student/Entity.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B} + Library + Properties + Entity + Entity + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WinFromDianMing/Student/Properties/AssemblyInfo.cs b/WinFromDianMing/Student/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..db5b306 --- /dev/null +++ b/WinFromDianMing/Student/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Student")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Student")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("20ccc54d-39a5-4227-b0cd-ffedf5894b79")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinFromDianMing/Student/Student.cs b/WinFromDianMing/Student/Student.cs new file mode 100644 index 0000000..fa2b7ef --- /dev/null +++ b/WinFromDianMing/Student/Student.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Entity +{ + public class Student + { + private String id; + + public String Id + { + get { return id; } + set { id = value; } + } + + private String name; + + public String Name + { + get { return name; } + set { name = value; } + } + + private String sex; + + public String Sex + { + get { return sex; } + set { sex = value; } + } + + public Student() + { + + } + public Student(String id, String name, String sex) + { + this.id = id; + this.name = name; + this.sex = sex; + } + } +} diff --git a/WinFromDianMing/UnitTestDianMing/Properties/AssemblyInfo.cs b/WinFromDianMing/UnitTestDianMing/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d9f20de --- /dev/null +++ b/WinFromDianMing/UnitTestDianMing/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下特性集 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("UnitTestDianMing")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UnitTestDianMing")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 请将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("bf2774f0-836a-4010-a208-e1d9acf2852a")] + +// 程序集的版本信息由以下四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinFromDianMing/UnitTestDianMing/UnitTest1.cs b/WinFromDianMing/UnitTestDianMing/UnitTest1.cs new file mode 100644 index 0000000..85fc9a3 --- /dev/null +++ b/WinFromDianMing/UnitTestDianMing/UnitTest1.cs @@ -0,0 +1,17 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using WinFromDianMing; + +namespace UnitTestDianMing +{ + [TestClass] + public class UnitTestFormStudet + { + [TestMethod] + public void TestFormStudet() + { + FormStudet Test = new FormStudet(); + Test.Show(); + } + } +} diff --git a/WinFromDianMing/UnitTestDianMing/UnitTestDianMing.csproj b/WinFromDianMing/UnitTestDianMing/UnitTestDianMing.csproj new file mode 100644 index 0000000..4dd7e76 --- /dev/null +++ b/WinFromDianMing/UnitTestDianMing/UnitTestDianMing.csproj @@ -0,0 +1,90 @@ + + + + Debug + AnyCPU + {FB28D548-674B-439D-ADBC-1FD7D517F453} + Library + Properties + UnitTestDianMing + UnitTestDianMing + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + {34a07153-e243-4f4a-a255-4ab435d038ef} + WinFromDianMing + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/WinFromDianMing/WinFromDianMing.sln b/WinFromDianMing/WinFromDianMing.sln new file mode 100644 index 0000000..1993fb4 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing.sln @@ -0,0 +1,52 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFromDianMing", "WinFromDianMing\WinFromDianMing.csproj", "{34A07153-E243-4F4A-A255-4AB435D038EF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entity", "Student\Entity.csproj", "{23C35D64-584F-4AEB-B53B-D8AC0250BD0B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataBase", "DataBase\DataBase.csproj", "{27CC8072-7612-4492-913D-2E03A6C37FD1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DaoLayer", "DaoLayer\DaoLayer.csproj", "{829E28C4-F286-49AC-904C-6BED236D6339}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecordData", "RecorData\RecordData.csproj", "{56491460-D725-4F40-A1DD-30F03773B5A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestDianMing", "UnitTestDianMing\UnitTestDianMing.csproj", "{FB28D548-674B-439D-ADBC-1FD7D517F453}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {34A07153-E243-4F4A-A255-4AB435D038EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34A07153-E243-4F4A-A255-4AB435D038EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34A07153-E243-4F4A-A255-4AB435D038EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34A07153-E243-4F4A-A255-4AB435D038EF}.Release|Any CPU.Build.0 = Release|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23C35D64-584F-4AEB-B53B-D8AC0250BD0B}.Release|Any CPU.Build.0 = Release|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27CC8072-7612-4492-913D-2E03A6C37FD1}.Release|Any CPU.Build.0 = Release|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Debug|Any CPU.Build.0 = Debug|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Release|Any CPU.ActiveCfg = Release|Any CPU + {829E28C4-F286-49AC-904C-6BED236D6339}.Release|Any CPU.Build.0 = Release|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56491460-D725-4F40-A1DD-30F03773B5A8}.Release|Any CPU.Build.0 = Release|Any CPU + {FB28D548-674B-439D-ADBC-1FD7D517F453}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB28D548-674B-439D-ADBC-1FD7D517F453}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB28D548-674B-439D-ADBC-1FD7D517F453}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB28D548-674B-439D-ADBC-1FD7D517F453}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/WinFromDianMing/WinFromDianMing/App.config b/WinFromDianMing/WinFromDianMing/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WinFromDianMing/WinFromDianMing/FormStudet.Designer.cs b/WinFromDianMing/WinFromDianMing/FormStudet.Designer.cs new file mode 100644 index 0000000..d1d9a6f --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/FormStudet.Designer.cs @@ -0,0 +1,278 @@ +namespace WinFromDianMing +{ + partial class FormStudet + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.dataGVList = new System.Windows.Forms.DataGridView(); + this.StudentNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.StudengName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.StuSex = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.pnlProgress = new System.Windows.Forms.Panel(); + this.progressName = new System.Windows.Forms.ProgressBar(); + this.panel4 = new System.Windows.Forms.Panel(); + this.btnStop = new System.Windows.Forms.Button(); + this.btnStart = new System.Windows.Forms.Button(); + this.btnRecord = new System.Windows.Forms.Button(); + this.btnLoadStu = new System.Windows.Forms.Button(); + this.panel5 = new System.Windows.Forms.Panel(); + this.timerCountStu = new System.Windows.Forms.Timer(this.components); + this.lblName = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGVList)).BeginInit(); + this.pnlProgress.SuspendLayout(); + this.panel4.SuspendLayout(); + this.panel5.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(594, 30); + this.panel1.TabIndex = 0; + // + // label1 + // + this.label1.AccessibleRole = System.Windows.Forms.AccessibleRole.None; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(22, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(67, 15); + this.label1.TabIndex = 0; + this.label1.Text = "学生列表"; + // + // panel2 + // + this.panel2.Controls.Add(this.dataGVList); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(0, 30); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(594, 222); + this.panel2.TabIndex = 1; + // + // dataGVList + // + this.dataGVList.AllowUserToAddRows = false; + this.dataGVList.AllowUserToDeleteRows = false; + this.dataGVList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGVList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.StudentNum, + this.StudengName, + this.StuSex}); + this.dataGVList.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGVList.Location = new System.Drawing.Point(0, 0); + this.dataGVList.Name = "dataGVList"; + this.dataGVList.ReadOnly = true; + this.dataGVList.RowTemplate.Height = 27; + this.dataGVList.Size = new System.Drawing.Size(594, 222); + this.dataGVList.TabIndex = 0; + // + // StudentNum + // + this.StudentNum.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + this.StudentNum.DataPropertyName = "stuID"; + this.StudentNum.HeaderText = "学号"; + this.StudentNum.Name = "StudentNum"; + this.StudentNum.ReadOnly = true; + this.StudentNum.Width = 66; + // + // StudengName + // + this.StudengName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.StudengName.DataPropertyName = "stuName"; + this.StudengName.HeaderText = "姓名"; + this.StudengName.Name = "StudengName"; + this.StudengName.ReadOnly = true; + // + // StuSex + // + this.StuSex.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.StuSex.DataPropertyName = "stuSex"; + this.StuSex.HeaderText = "性别"; + this.StuSex.Name = "StuSex"; + this.StuSex.ReadOnly = true; + // + // pnlProgress + // + this.pnlProgress.Controls.Add(this.progressName); + this.pnlProgress.Dock = System.Windows.Forms.DockStyle.Top; + this.pnlProgress.Location = new System.Drawing.Point(0, 252); + this.pnlProgress.Name = "pnlProgress"; + this.pnlProgress.Size = new System.Drawing.Size(594, 30); + this.pnlProgress.TabIndex = 2; + // + // progressName + // + this.progressName.Dock = System.Windows.Forms.DockStyle.Fill; + this.progressName.Location = new System.Drawing.Point(0, 0); + this.progressName.Name = "progressName"; + this.progressName.Size = new System.Drawing.Size(594, 30); + this.progressName.TabIndex = 0; + // + // panel4 + // + this.panel4.Controls.Add(this.btnStop); + this.panel4.Controls.Add(this.btnStart); + this.panel4.Controls.Add(this.btnRecord); + this.panel4.Controls.Add(this.btnLoadStu); + this.panel4.Dock = System.Windows.Forms.DockStyle.Right; + this.panel4.Location = new System.Drawing.Point(357, 282); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(237, 83); + this.panel4.TabIndex = 3; + // + // btnStop + // + this.btnStop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnStop.Location = new System.Drawing.Point(83, 44); + this.btnStop.Name = "btnStop"; + this.btnStop.Size = new System.Drawing.Size(78, 32); + this.btnStop.TabIndex = 3; + this.btnStop.Text = "停止点名"; + this.btnStop.UseVisualStyleBackColor = false; + this.btnStop.MouseCaptureChanged += new System.EventHandler(this.btnStop_Click); + // + // btnStart + // + this.btnStart.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnStart.Location = new System.Drawing.Point(83, 6); + this.btnStart.Name = "btnStart"; + this.btnStart.Size = new System.Drawing.Size(78, 32); + this.btnStart.TabIndex = 2; + this.btnStart.Text = "开始点名"; + this.btnStart.UseVisualStyleBackColor = false; + this.btnStart.Click += new System.EventHandler(this.btnStart_Click); + // + // btnRecord + // + this.btnRecord.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnRecord.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnRecord.Location = new System.Drawing.Point(174, 6); + this.btnRecord.Name = "btnRecord"; + this.btnRecord.Size = new System.Drawing.Size(46, 70); + this.btnRecord.TabIndex = 1; + this.btnRecord.Text = "点名记录"; + this.btnRecord.UseVisualStyleBackColor = false; + this.btnRecord.Click += new System.EventHandler(this.btnRecord_Click); + // + // btnLoadStu + // + this.btnLoadStu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.btnLoadStu.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnLoadStu.Location = new System.Drawing.Point(21, 6); + this.btnLoadStu.Name = "btnLoadStu"; + this.btnLoadStu.Size = new System.Drawing.Size(46, 70); + this.btnLoadStu.TabIndex = 0; + this.btnLoadStu.Text = "加载学生"; + this.btnLoadStu.UseVisualStyleBackColor = false; + this.btnLoadStu.Click += new System.EventHandler(this.btnLoadStu_Click); + // + // panel5 + // + this.panel5.BackColor = System.Drawing.Color.Aqua; + this.panel5.Controls.Add(this.lblName); + this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel5.Location = new System.Drawing.Point(0, 282); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(357, 83); + this.panel5.TabIndex = 4; + // + // timerCountStu + // + this.timerCountStu.Tick += new System.EventHandler(this.timerCountStu_Tick); + // + // lblName + // + this.lblName.AutoSize = true; + this.lblName.Font = new System.Drawing.Font("宋体", 22.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.lblName.Location = new System.Drawing.Point(99, 22); + this.lblName.Name = "lblName"; + this.lblName.Size = new System.Drawing.Size(0, 38); + this.lblName.TabIndex = 0; + // + // FormStudet + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(594, 365); + this.Controls.Add(this.panel5); + this.Controls.Add(this.panel4); + this.Controls.Add(this.pnlProgress); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MinimumSize = new System.Drawing.Size(612, 412); + this.Name = "FormStudet"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "结对点名系统"; + this.Load += new System.EventHandler(this.FrmStudent_Load); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGVList)).EndInit(); + this.pnlProgress.ResumeLayout(false); + this.panel4.ResumeLayout(false); + this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.DataGridView dataGVList; + private System.Windows.Forms.Panel pnlProgress; + private System.Windows.Forms.ProgressBar progressName; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Button btnRecord; + private System.Windows.Forms.Button btnLoadStu; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.Timer timerCountStu; + private System.Windows.Forms.Button btnStop; + private System.Windows.Forms.Button btnStart; + private System.Windows.Forms.DataGridViewTextBoxColumn StudentNum; + private System.Windows.Forms.DataGridViewTextBoxColumn StudengName; + private System.Windows.Forms.DataGridViewTextBoxColumn StuSex; + private System.Windows.Forms.Label lblName; + } +} \ No newline at end of file diff --git a/WinFromDianMing/WinFromDianMing/FormStudet.cs b/WinFromDianMing/WinFromDianMing/FormStudet.cs new file mode 100644 index 0000000..df45c64 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/FormStudet.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +using DaoLayer; +using Entity; +using System.Threading; +using RecordData; + +namespace WinFromDianMing +{ + public partial class FormStudet : Form + { + List stuList; + public FormStudet() + { + InitializeComponent(); + } + void iniControl() + { + btnStart.Visible = false; + btnStop.Visible = false; + btnRecord.Visible = false; + btnLoadStu.Enabled = true; + } + + void setControlVisible() + { + btnStart.Visible = true; + btnStop.Visible = true; + btnRecord.Visible = true; + btnLoadStu.Visible = false; + } + + private void btnLoadStu_Click(object sender, EventArgs e) + { + + //获取学生数据源 + StudentDAO stuDao = new StudentDAO(); + stuList = stuDao.getAllStudents(); + + //进度条设置 + int stuCounts = stuList.Count;//及时学生人数 + progressName.Maximum = stuCounts; + + + //构造数据源 + DataTable dt = new DataTable(); + dt.Columns.Add("stuID", Type.GetType("System.String")); + dt.Columns.Add("stuName", Type.GetType("System.String")); + dt.Columns.Add("stuSex", Type.GetType("System.String")); + + //数据加载以进度条方式展现 + foreach (Student stu in stuList) + { + dt.Rows.Add(stu.Id, stu.Name, stu.Sex); + progressName.Value += 1;//一个学生,进度条加1; + Thread.Sleep(50); + } + + dataGVList.DataSource = dt; + + setControlVisible(); + + } + + DianMingRecord DianMiandata = new DianMingRecord();//一个记录对象 + + private void FrmStudent_Load(object sender, EventArgs e) + { + iniControl(); + } + + private void timerCountStu_Tick(object sender, EventArgs e) + { + Random ra = new Random(); + int i = ra.Next(stuList.Count); + lblName.Text = stuList[i].Name; + } + + private void btnStart_Click(object sender, EventArgs e) + { + timerCountStu.Start(); + btnRecord.Enabled = true; + } + + private void btnStop_Click(object sender, EventArgs e) + { + timerCountStu.Stop(); + DianMiandata.DMrecord(lblName.Text); + } + + private void btnRecord_Click(object sender, EventArgs e) + { + string data = DianMiandata.ShowRecord(); + ShowRecordData SData = new ShowRecordData(data); + btnRecord.Enabled = false; + DialogResult dr = SData.ShowDialog(); + if (dr == DialogResult.OK) + { ClearData(); SData.Show(); } + } + + public void ClearData() + { + for (int L = 0; L < DianMiandata.recordData.Length; L++) + DianMiandata.recordData[L] = null; + } + } +} diff --git a/WinFromDianMing/WinFromDianMing/FormStudet.resx b/WinFromDianMing/WinFromDianMing/FormStudet.resx new file mode 100644 index 0000000..7ce11fa --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/FormStudet.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + 17, 17 + + \ No newline at end of file diff --git a/WinFromDianMing/WinFromDianMing/Program.cs b/WinFromDianMing/WinFromDianMing/Program.cs new file mode 100644 index 0000000..10ae298 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WinFromDianMing +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormStudet()); + } + } +} diff --git a/WinFromDianMing/WinFromDianMing/Properties/AssemblyInfo.cs b/WinFromDianMing/WinFromDianMing/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e080187 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("WinFromDianMing")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WinFromDianMing")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("5a4bf504-28eb-46de-a20c-02dd81c4f2e5")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinFromDianMing/WinFromDianMing/Properties/Resources.Designer.cs b/WinFromDianMing/WinFromDianMing/Properties/Resources.Designer.cs new file mode 100644 index 0000000..487570d --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace WinFromDianMing.Properties +{ + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// 返回此类使用的、缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinFromDianMing.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, + /// 方法是使用此强类型资源类。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/WinFromDianMing/WinFromDianMing/Properties/Resources.resx b/WinFromDianMing/WinFromDianMing/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinFromDianMing/WinFromDianMing/Properties/Settings.Designer.cs b/WinFromDianMing/WinFromDianMing/Properties/Settings.Designer.cs new file mode 100644 index 0000000..aeb8c89 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WinFromDianMing.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/WinFromDianMing/WinFromDianMing/Properties/Settings.settings b/WinFromDianMing/WinFromDianMing/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/WinFromDianMing/WinFromDianMing/ShowRecordData.Designer.cs b/WinFromDianMing/WinFromDianMing/ShowRecordData.Designer.cs new file mode 100644 index 0000000..9dfe2f3 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/ShowRecordData.Designer.cs @@ -0,0 +1,78 @@ +namespace WinFromDianMing +{ + partial class ShowRecordData + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lblRCdata = new System.Windows.Forms.Label(); + this.btnClear = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lblRCdata + // + this.lblRCdata.AutoSize = true; + this.lblRCdata.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblRCdata.Location = new System.Drawing.Point(32, 15); + this.lblRCdata.Name = "lblRCdata"; + this.lblRCdata.Size = new System.Drawing.Size(0, 20); + this.lblRCdata.TabIndex = 0; + // + // btnClear + // + this.btnClear.Location = new System.Drawing.Point(27, 336); + this.btnClear.Name = "btnClear"; + this.btnClear.Size = new System.Drawing.Size(96, 27); + this.btnClear.TabIndex = 1; + this.btnClear.Text = "清除记录"; + this.btnClear.UseVisualStyleBackColor = true; + this.btnClear.Click += new System.EventHandler(this.btnClear_Click); + // + // ShowRecordData + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(152, 375); + this.Controls.Add(this.btnClear); + this.Controls.Add(this.lblRCdata); + this.Location = new System.Drawing.Point(988, 242); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ShowRecordData"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "点名记录"; + this.Load += new System.EventHandler(this.ShowRecordData_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lblRCdata; + private System.Windows.Forms.Button btnClear; + } +} \ No newline at end of file diff --git a/WinFromDianMing/WinFromDianMing/ShowRecordData.cs b/WinFromDianMing/WinFromDianMing/ShowRecordData.cs new file mode 100644 index 0000000..e5b6507 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/ShowRecordData.cs @@ -0,0 +1,37 @@ +using RecordData; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WinFromDianMing +{ + public partial class ShowRecordData : Form + { + string data = null; + public ShowRecordData(string data) + { + InitializeComponent(); + this.data = data; + } + + private void ShowRecordData_Load(object sender, EventArgs e) + { + lblRCdata.Text = data; + } + + private void btnClear_Click(object sender, EventArgs e) + { + data = null; + lblRCdata.Text = data; + DialogResult = DialogResult.OK; + btnClear.Enabled = false; + } + + } +} diff --git a/WinFromDianMing/WinFromDianMing/ShowRecordData.resx b/WinFromDianMing/WinFromDianMing/ShowRecordData.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/ShowRecordData.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinFromDianMing/WinFromDianMing/WinFromDianMing.csproj b/WinFromDianMing/WinFromDianMing/WinFromDianMing.csproj new file mode 100644 index 0000000..a7ea996 --- /dev/null +++ b/WinFromDianMing/WinFromDianMing/WinFromDianMing.csproj @@ -0,0 +1,111 @@ + + + + + Debug + AnyCPU + {34A07153-E243-4F4A-A255-4AB435D038EF} + WinExe + Properties + WinFromDianMing + WinFromDianMing + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + Form + + + FormStudet.cs + + + + + Form + + + ShowRecordData.cs + + + FormStudet.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + ShowRecordData.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {829e28c4-f286-49ac-904c-6bed236d6339} + DaoLayer + + + {56491460-d725-4f40-a1dd-30f03773b5a8} + RecordData + + + {23c35d64-584f-4aeb-b53b-d8ac0250bd0b} + Entity + + + + + \ No newline at end of file