ASP.NET和SQL关系数据库 [英] Asp.net and sql relational database

查看:68
本文介绍了ASP.NET和SQL关系数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我在asp.net的一个复杂项目中遇到了关系数据库的问题……
我有6个关系表,如下所示:

获奖者
WinnderId int未选中
UserId int未选中
用户名nvarchar(50)已检查
未选中

用户
UserId int未选中
名称nvarchar(50)未选中
LastName nvarchar(50)未选中
用户名nvarchar(30)未选中
电子邮件nv​​archar(80)未选中
密码nvarchar(30)未选中
移动nchar(15)未选中
地址nvarchar(200)未选中
PostalCode nchar(15)未选中
CreditValue十进制(18,0)已检查
未选中

投标
TicketId int未选中
TicketNumber int已检查
TicketAmount int Checked
TicktDate日期已检查
TicketType tinyint已检查
UserID int已检查
图片nvarchar(250)已检查
未选中

tenderUser
TenderUserId int未选中
TenderId int未选中
UserId int未选中
CreationDate日期时间未选中
未选中
招标
TenderId int未选中
名称nvarchar(50)未选中
价格int未经检查
Price_Tender int未选中
图片nvarchar(250)未选中
UserId int已检查
增加每次点击费用的小数位数(18,0)未选中
降低perclick十进制(18,0)已选中
时间time(7)未选中
未选中


每个登录用户都可以进行招标(投标表),首先每个用户都应具有证书进行招标(应购买机票,用户表与机票有关),因为每个用户都可以进行招标,所以我想保存与指定获奖者用户的获奖者有关的单独表(tenderUser)中的UserId和TenderId(招标用户的最后一个用户,用于特定的bidId将是该投标的获奖者(UserID),并将保存在获奖者表中)

现在,通过单击按钮中的用户以asp.net形式,应检查以上所有任务!我真的对如何实现这一目标没有任何想象力...
我将逐步介绍该过程:单击产品中的用户(投标表中的bidId)后
1-将检查User CreditValue(用户表)以确保其金额为
2-如果用户数量有限,则UserId和bidId(相同产品)将保存在bidUser表中
3-每个用户都可以一次又一次地进行投标,换句话说,一个UserId至少可以分别保存在投标用户中!例如,我们可以在招标用户表中设置:招标用户编号:alice,micheal,pitter,alice,…,但是我们不能拥有:Roberto,Elizabeth,pitter,pitter,micheal……一个用户可以先招标一次,然后再另一个用户没有招标
4-我们在datase中增加了perperclick和reduceperclick字段…通过单击产品中的User或招标,增加的perclick将添加到price_tender中,而减少的perclick将减少User的信用值
请有人帮助我,我对此很困惑!
如果有人想帮忙,我可以解释更多,谢谢...

Hi guys ! I had a trouble about relational database in a complex project of asp.net …
I have 6 relational table like shown below :

winners
WinnderId int Unchecked
UserId int Unchecked
UserName nvarchar(50) Checked
Unchecked

Users
UserId int Unchecked
Name nvarchar(50) Unchecked
LastName nvarchar(50) Unchecked
UserName nvarchar(30) Unchecked
Email nvarchar(80) Unchecked
Password nvarchar(30) Unchecked
Mobile nchar(15) Unchecked
Address nvarchar(200) Unchecked
PostalCode nchar(15) Unchecked
CreditValue decimal(18, 0) Checked
Unchecked

Tender
TicketId int Unchecked
TicketNumber int Checked
TicketAmount int Checked
TicktDate date Checked
TicketType tinyint Checked
UserID int Checked
image nvarchar(250) Checked
Unchecked

tenderUser
TenderUserId int Unchecked
TenderId int Unchecked
UserId int Unchecked
CreationDate datetime Unchecked
Unchecked
tender
TenderId int Unchecked
Name nvarchar(50) Unchecked
Price int Unchecked
Price_Tender int Unchecked
Image nvarchar(250) Unchecked
UserId int Checked
Increaseperclick decimal(18, 0) Unchecked
Decreaseperclick decimal(18, 0) Checked
Time time(7) Unchecked
Unchecked


every login User can make a tender(tender table) , first of all every user should have certificate to make tender (should buy a ticket, user table is in relation with ticket),as every user can make a tender, I want to save the UserId and TenderId in separate table (tenderUser) that is in relation with Winners to specify the winner User( the last User in tenderUser for a specific tenderId will be winner of the tender(UserID) and will save in winners table )

Now in asp.net form by clicking the user in a button all of task above should be checked !! I really don’t have any imagine about how to implement this …
I mention again the procedure step by step : after clicking the User in a product ( tenderId in tender table )
1-the User CreditValue(User table) will be checked to making the sure that has amount
2- if the User has the limited amount, the UserId and tenderId(same product) will be saved in tenderUser table
3-every User can make tender again and again , in other words a UserId could save in tenderUser separately at least ! for example we can have in tenderUser table : tenderUserId: alice , micheal, pitter,alice , … but we can’t have : Roberto, Elizabeth , pitter , pitter , micheal ,…  a user can make tender for one time before another User has not make any tender
4- we increaseperclick and decreaseperclick field in datase …by clicking the User in a product or tender the increaseperclick will add to price_tender and decreaseperclick decrease the creditvalu of User

please someone help me , I''m so confused about this !
I can explain more if anyone want''s to help , thanks ...

推荐答案

如果这不是家庭作业,那么您是否有报酬,谁设计了数据库,为什么他们与无法理解如何使用数据库的人一起工作?您是在要求我们为您做您的工作,但我们不这样做.与设计数据库的人联系.如果您不知道如何编写数据库代码,请告诉他们,看看他们是否愿意在学习时等待.
If this is not homework, if you''re being paid to do this, who designed the database, and why are they working with someone who can''t understand how to use it ? You''re asking us to do your job for you, and we don''t do that. Talk to the person who designed the database. If you have no clue how to write DB code, tell them that, and see if they are willing to wait while you learn.


这篇关于ASP.NET和SQL关系数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆