欢迎来到unity学习、unity培训、unity企业培训教育专区,这里有很多U3D资源、U3D培训视频U3D教程、U3D常见问题、U3D项目源码,我们致力于打造业内unity3d培训、学习第一品牌。
之前就已经做过的游戏商城,今天龙哥又带着我们做了一次,这次讲的很细,步骤很清晰~
哦对~首先复习几条SQL语句
//添加一列
alter table 表名 add 列名 int null
//更改列中属性
alter table 表名 alter column 列名 数据类型
//删除一列
alter table 表名 drop column 列名
//添加主键约束
alter table stu add constraint pk_stu primary key(id)
//添加唯一键约束
alter table stu add constraint uk_stu unique(name)
//添加默认键约束
alter table stu add constraint dk_stu default('男') for sex
//添加检查约束
alter table stu add constraint ck_stu check(age>=15 and age<=40)
//外键
- public void AdminLogin()
- {
- Console.WriteLine("请输入姓名");
- string name=Console.ReadLine();
- Console.WriteLine("请输入密码");
- string password = Console.ReadLine();
- bool a = new Admins().Login(name, password);
- if (a==true)
- {
- Console.WriteLine("登录成功");
- Admin();
- }
- else
- {
- Console.WriteLine("登录失败,请重新登录");
- AdminLogin();
- }
- }
- public void Admin()
- {
- Console.WriteLine("1.装备的操作");
- Console.WriteLine("2.用户的操作");
- Console.WriteLine("3.购物车的操作");
- Console.WriteLine("4.修改密码");
- for (; ; )
- {
- string s = Console.ReadLine();
- switch (s)
- {
- case"1":
- AEquips();
- break;
- case "2":
- AUsers();
- break;
- case "3":
- Atrolley();
- break;
- case "4":
- AChangePassword();
- break;
- default:
- Console.WriteLine("输入不正确,请重新输入!");
- break;
- }
- }
- }
- public void Users()
- {
- string i = Console.ReadLine();
- switch (i)
- {
- case "1":
- Console.WriteLine("用户注册");
- UsersRegister();
- break;
- case "2":
- Console.WriteLine("用户登录");
- UsersLogin();
- break;
- default:
- break;
- }
- }
- public void UsersRegister()
- {
- Console.WriteLine("请输入姓名");
- string name = Console.ReadLine();
- Console.WriteLine("请输入密码");
- string password = Console.ReadLine();
- int b = new Users().Register(name,password);
- if (b!=0)
- {
- Console.WriteLine("注册成功");
- Userss();
- }
- else
- {
- Console.WriteLine("注册失败,请重新注册!");
- UsersRegister();
- }
- }
- public void UsersLogin()
- {
- Console.WriteLine("请输入姓名");
- string name = Console.ReadLine();
- Console.WriteLine("请输入密码");
- string password = Console.ReadLine();
- bool a = new Users().Login(name, password);
- if (a == true)
- {
- Console.WriteLine("登录成功");
- }
- else
- {
- Console.WriteLine("登录失败");
- }
- }


