使用三层体系结构中的复选框列表,并将选定的值存储在数据库表中. [英] using checkboxlist in 3-tier architecture and selected values stored in database table..

查看:60
本文介绍了使用三层体系结构中的复选框列表,并将选定的值存储在数据库表中.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在三层体系结构中创建了一个应用程序..所以问题是我在ui设计页面中使用了一个复选框..so我们如何将已检查的项目发送到encodingpage(DAL,Bal)中以及如何将数据存储在数据库表..

i created one application in 3-tier architecture ..so the problem is i take one checkboxlist in ui design page..so how can we send checked items into codingpage(DAL,Bal) and how can we store data in the database table..

推荐答案

3层应用程序的整体思想是,在模型层中创建具有属性的类,然后将这些属性绑定以控制您的UI层.当用户更新任何属性时,模型层的工作就是通过您的数据访问层将更新保存到数据库中.因此,您的复选框应绑定到类中的布尔值属性.如果用户取消选中该复选框,则布尔值属性应设置为false.然后,当用户保存更改时,布尔值属性应由DAL保存到其相应​​的数据库列中.

希望这对您有帮助
The whole idea of a 3 tier application is that you create classes with properties in your model layer, and then you bind these properties to control on your UI Layer. When a user updates any property, it is the job of the Model Layer to then save the updates to the data base through your Data Access Layer. Therefore your checkbox should be bound to a boolean property in your class. If the user unchecks the checkbox, the boolean property should be set to false. Then when the user saves the changes, the boolean property should be saved to it''s corresponding database column by the DAL.

Hope this helps


您需要阅读什么是3-Tier体系结构.

看看这些,用示例进行解释:
C#中的3层体系结构 [ 3-层架构示例 [使用C#的ASP.NET中的3层体系结构 [
You need to read on what is 3-Tier architecture.

Have a look at these, explaination with samples:
3-tier architecture in C#[^]
3-Tier Architecture Examples[^]
3-Tier Architecture in ASP.NET with C#[^]


You need to pass on the selection from UI to DAL via BL(where you can make any change if you want to). In DAL, you will work the value with database.


这篇关于使用三层体系结构中的复选框列表,并将选定的值存储在数据库表中.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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