使用C#.NET的ASP.NET [英] Asp.net with c# .net

查看:53
本文介绍了使用C#.NET的ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Asp.net中为丈夫和妻子开发了一个购物应用程序.在此应用程序中,第一个表单是登录"表单,如果丈夫或妻子第一次登录是指他/她创建购物清单名称.例如,丈夫登录是指他创建购物清单并添加一些商品.然后注销.

接下来,妻子登录意味着她查看了丈夫创建的购物清单并添加了一些项目,否则,妻子登录意味着她创建了购物清单并添加了一些项目.然后她注销了.接下来,丈夫登录意味着他查看了妻子创建的购物清单并添加了一些项目. .如何基于登录创建夫妻共同的购物清单名称?...提前感谢.

I develop one Shoping application for Husband and Wife in Asp.net. In this application,first form is Login form,if husband or wife first login means,he/she create the shopinglistname.Example,husband login means ,he create shopinglist and add some items.then he logout.

Next,wife login means,she view the husband created shopinglist and add some items otherwise wife login means ,she create shopinglist and add some items.then she logout.Next,husband login means,he view the wife created shopinglist and add some items..How to create the shoplistname common for both husband and wife with based on login?...advance thanks.

推荐答案

以及HId和WId,您可以保留一个数据库中的CoupleId列...将此CoupleId分配给丈夫用户记录和妻子用户记录.然后使用HId和WId进行登录,但对于购物清单,使用用户CoupleId ...:)
along with HId and WId, u can keep a column CoupleId in database...assign this CoupleId to husband user record and wife user record. Then use HId and WId for login, but for shopping list, user CoupleId... :)


我认为您必须为丈夫和妻子创建通用唯一ID

在登录表中
ID,密码,partnerId(对于丈夫,PartnerId是丈夫和妻子的共同唯一ID,与妻子相同).

还有
在shopinglist表中,使用PartnerId(foreign key),以便丈夫/妻子可以查看购物清单
I think you have to create Common unique Id for both Husband and wife
Ex
In Login table
Id, password, partnerId(for husband PartnerId is Husband&wife Common unique id and same for wife).

And
In shopinglist Table use PartnerId(foreign key ) so that Husband/Wife can view shopping list


您需要以正常的方式进行思考.
You need to think in a normalized fashion to do this.
ShoppingList
      ID
      ... your other fields

Person (Table for anyone, both husbands and wives)
      ID
      ... your other fields

ShoppingListPeople
      ShoppingListID (Foreign Key to ShoppingList)
      PersonID   (Foreign Key to Person)



如果您这样做,那么您已经实现了:
1)归一化数据
2)现在可以将任意数量的人分配到给定的购物清单



If you do this then you have achieved:
1) Normalized data
2) Now any number of people can be assigned to a given shopping list


这篇关于使用C#.NET的ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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