学籍信息管理系统完整代码
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
string no = Console.ReadLine().Trim();
for (int i = 0; i < lstStudent.Count; i++)
{
if (lstStudent.Count == 0)
{
Console.WriteLine("系统还未添加任何学生信息");
Console.WriteLine("删除成功");
break;
}
if (lstStudent[i].stuNo == no)
{
lstStudent.Remove(lstStudent[i]);
string no = Console.ReadLine().Trim();
for (int i = 0; i < lstStudent.Count; i++)
{
Console.WriteLine("添加成功");
break;
}
case ConsoleKey.D:
lstStudent[i] = item;
Consபைடு நூலகம்le.WriteLine("修改成功!");
break;
Console.Write("学号:");
stu.stuNo = Console.ReadLine().Trim();
Console.Write("姓名:");
{
if (lstStudent.Count == 0)
{
Console.WriteLine("系统还未添加任何学生信息");
}
else
{
Console.Write("请输入要删除的学生的学号:");
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("使用提示(按键-操作):A-添加 D-删除 C-修改 L-查看");
Console.ForegroundColor = ConsoleColor.Gray;
{
if (lstStudent.Count == 0)
Console.WriteLine("系统还未添加任何学生信息");
else
Console.Write("年龄:");
item.stuAge = short.Parse(Console.ReadLine().Trim());
}
}
break;
}
case ConsoleKey.L:
{
case ConsoleKey.A:
{
//Console.ForegroundColor = ConsoleColor.Red;
Student item = lstStudent[i];
if (item.stuNo == no)
{
Console.Write("年龄:");
stu.stuAge = short.Parse(Console.ReadLine().Trim());
lstStudent.Add(stu);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SGMS
{
class Program
{
static void Main(string[] args)
item.stuName = Console.ReadLine().Trim();
Console.Write("性别:");
item.stuSex = char.Parse(Console.ReadLine().Trim());
Console.Write("学号:");
item.stuNo = Console.ReadLine().Trim();
Console.Write("姓名:");
Console.WriteLine("请输入学生相关信息");
//Console.ForegroundColor = ConsoleColor.Gray;
Student stu = new Student();
}
break;
}
case ConsoleKey.C:
{
{
Console.WriteLine("学号\t姓名\t性别\t年龄");
{
List<Student> lstStudent = new List<Student>();
bool flag = true;
while (flag)
{
Console.WriteLine("------------------------------------------------");
Console.WriteLine("------------------------------------------------");
ConsoleKey ck = Console.ReadKey(true).Key;
switch (ck)
}
else
{
Console.Write("请输入要修改的学生的学号:");
}
if (i == lstStudent.Count - 1)
Console.WriteLine("抱歉!系统中没有这个学号");
if (i == lstStudent.Count - 1)
Console.WriteLine("抱歉!系统中没有这个学号");
}
stu.stuName = Console.ReadLine().Trim();
Console.Write("性别:");
stu.stuSex = char.Parse(Console.ReadLine().Trim());
for (int i = 0; i < lstStudent.Count; i++)
{
if (lstStudent.Count == 0)
{
Console.WriteLine("系统还未添加任何学生信息");
Console.WriteLine("删除成功");
break;
}
if (lstStudent[i].stuNo == no)
{
lstStudent.Remove(lstStudent[i]);
string no = Console.ReadLine().Trim();
for (int i = 0; i < lstStudent.Count; i++)
{
Console.WriteLine("添加成功");
break;
}
case ConsoleKey.D:
lstStudent[i] = item;
Consபைடு நூலகம்le.WriteLine("修改成功!");
break;
Console.Write("学号:");
stu.stuNo = Console.ReadLine().Trim();
Console.Write("姓名:");
{
if (lstStudent.Count == 0)
{
Console.WriteLine("系统还未添加任何学生信息");
}
else
{
Console.Write("请输入要删除的学生的学号:");
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("使用提示(按键-操作):A-添加 D-删除 C-修改 L-查看");
Console.ForegroundColor = ConsoleColor.Gray;
{
if (lstStudent.Count == 0)
Console.WriteLine("系统还未添加任何学生信息");
else
Console.Write("年龄:");
item.stuAge = short.Parse(Console.ReadLine().Trim());
}
}
break;
}
case ConsoleKey.L:
{
case ConsoleKey.A:
{
//Console.ForegroundColor = ConsoleColor.Red;
Student item = lstStudent[i];
if (item.stuNo == no)
{
Console.Write("年龄:");
stu.stuAge = short.Parse(Console.ReadLine().Trim());
lstStudent.Add(stu);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SGMS
{
class Program
{
static void Main(string[] args)
item.stuName = Console.ReadLine().Trim();
Console.Write("性别:");
item.stuSex = char.Parse(Console.ReadLine().Trim());
Console.Write("学号:");
item.stuNo = Console.ReadLine().Trim();
Console.Write("姓名:");
Console.WriteLine("请输入学生相关信息");
//Console.ForegroundColor = ConsoleColor.Gray;
Student stu = new Student();
}
break;
}
case ConsoleKey.C:
{
{
Console.WriteLine("学号\t姓名\t性别\t年龄");
{
List<Student> lstStudent = new List<Student>();
bool flag = true;
while (flag)
{
Console.WriteLine("------------------------------------------------");
Console.WriteLine("------------------------------------------------");
ConsoleKey ck = Console.ReadKey(true).Key;
switch (ck)
}
else
{
Console.Write("请输入要修改的学生的学号:");
}
if (i == lstStudent.Count - 1)
Console.WriteLine("抱歉!系统中没有这个学号");
if (i == lstStudent.Count - 1)
Console.WriteLine("抱歉!系统中没有这个学号");
}
stu.stuName = Console.ReadLine().Trim();
Console.Write("性别:");
stu.stuSex = char.Parse(Console.ReadLine().Trim());