Skip to content

Commit b5604b0

Browse files
author
SmartLinli
committed
update
1 parent 23d8e56 commit b5604b0

13 files changed

+15
-22
lines changed

QuickDemo/6.Table_GridView/Table_GridView.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.28307.779
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Table_GridView", "6.Table_GridView\Table_GridView.csproj", "{C1BC64FE-70A5-4633-AA14-B2A05A227977}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Table_GridView", "Table_GridView\Table_GridView.csproj", "{C1BC64FE-70A5-4633-AA14-B2A05A227977}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution

QuickDemo/6.Table_GridView/6.Table_GridView/Program.cs renamed to QuickDemo/6.Table_GridView/Table_GridView/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void Main()
1616
{
1717
Application.EnableVisualStyles();
1818
Application.SetCompatibleTextRenderingDefault(false);
19-
Application.Run(new CourseSelection());
19+
Application.Run(new frm_CourseSelection());
2020
}
2121
}
2222
}

QuickDemo/6.Table_GridView/6.Table_GridView/Table_GridView.csproj renamed to QuickDemo/6.Table_GridView/Table_GridView/Table_GridView.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,16 @@
157157
<Reference Include="System.Xml" />
158158
</ItemGroup>
159159
<ItemGroup>
160-
<Compile Include="CourseSelection.cs">
160+
<Compile Include="frm_CourseSelection.cs">
161161
<SubType>Form</SubType>
162162
</Compile>
163-
<Compile Include="CourseSelection.Designer.cs">
164-
<DependentUpon>CourseSelection.cs</DependentUpon>
163+
<Compile Include="frm_CourseSelection.Designer.cs">
164+
<DependentUpon>frm_CourseSelection.cs</DependentUpon>
165165
</Compile>
166166
<Compile Include="Program.cs" />
167167
<Compile Include="Properties\AssemblyInfo.cs" />
168-
<EmbeddedResource Include="CourseSelection.resx">
169-
<DependentUpon>CourseSelection.cs</DependentUpon>
168+
<EmbeddedResource Include="frm_CourseSelection.resx">
169+
<DependentUpon>frm_CourseSelection.cs</DependentUpon>
170170
</EmbeddedResource>
171171
<EmbeddedResource Include="Properties\Resources.resx">
172172
<Generator>ResXFileCodeGenerator</Generator>

QuickDemo/6.Table_GridView/6.Table_GridView/CourseSelection.Designer.cs renamed to QuickDemo/6.Table_GridView/Table_GridView/frm_CourseSelection.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

QuickDemo/6.Table_GridView/6.Table_GridView/CourseSelection.cs renamed to QuickDemo/6.Table_GridView/Table_GridView/frm_CourseSelection.cs

+7-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace GridView
77
/// <summary>
88
/// 选课窗体;
99
/// </summary>
10-
public partial class CourseSelection : Form
10+
public partial class frm_CourseSelection : Form
1111
{
1212
/// <summary>
1313
/// 当前学号;
@@ -16,7 +16,7 @@ public partial class CourseSelection : Form
1616
/// <summary>
1717
/// 构造函数;
1818
/// </summary>
19-
public CourseSelection()
19+
public frm_CourseSelection()
2020
{
2121
InitializeComponent();
2222
this.LoadCourses();
@@ -28,21 +28,14 @@ private void LoadCourses()
2828
{
2929
SqlHelper sqlHelper = new SqlHelper();
3030
string commantText =
31-
$@"SELECT C.*,'已选' AS Status
32-
FROM tb_Course AS C JOIN tb_StudentScore AS SS ON C.Number=SS.CourseNumber
33-
WHERE SS.StudentNumber='{StudentNumber}'
34-
UNION
35-
SELECT C.*,'未选'
36-
FROM tb_Course AS C
37-
WHERE C.Number NOT IN
38-
(SELECT SS.CourseNumber
39-
FROM tb_StudentScore AS SS
40-
WHERE SS.StudentNumber='{StudentNumber}');";
31+
$@"SELECT C.*,IIF(SS.StudentNumber IS NULL,'未选','已选') AS Status
32+
FROM tb_Course AS C LEFT JOIN tb_StudentScore AS SS ON C.Number=SS.CourseNumber
33+
AND SS.StudentNumber='{StudentNumber}';";
4134
sqlHelper.QuickFill(commantText, this.dgv_AllCourses);
4235
commantText =
4336
$@"SELECT C.*,IIF(SS.Score IS NULL,'可退选','不可退') AS Status
44-
FROM tb_StudentScore AS SS JOIN tb_Course AS C ON SS.CourseNumber=C.Number
45-
WHERE SS.StudentNumber='{StudentNumber}';";
37+
FROM tb_StudentScore AS SS JOIN tb_Course AS C ON SS.CourseNumber=C.Number
38+
WHERE SS.StudentNumber='{StudentNumber}';";
4639
sqlHelper.QuickFill(commantText, this.dgv_SelectedCourses);
4740
}
4841
/// <summary>

0 commit comments

Comments
 (0)