上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: 1、以单个项目的结构搭建好三层结构2、建好模型层《使用代码生成器生成模型层》3、准备数据层,做增删改查 3.1、数据层一般有DBhelper 3.2、添加查询Students类《不担心名字冲突,因为我直接用命名空间来操作的 》,使用到Model,故导入using Model;4、做登录功能5、做显示学生列表功能6、做删除功能7、做修改功能注:《我们每做一个操作都是从数据层开始做》------------------------------------------------------------------------写三层的顺序:从下往上写,即:Model-》DAL-->BL... 阅读全文
posted @ 2013-06-13 16:09 Big.Eagle 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 模型层(ORM):数据库中每一个表都在模型层创建一个类,一般情况类的名称和数据表名相同,如果数据库中表名为复数型式,一般模型层类名为单数。表中的字段在类中建成属性。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace HotelManager.Models{ public class RoomType { int typeId; public int TypeId { get { retur... 阅读全文
posted @ 2013-06-13 16:07 Big.Eagle 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 业务逻辑层:业务逻辑层中的类名由业务决定,一般情况下也可以与数据访问层的类相对应,类名一般由表名+Manager命名。<业务逻辑层中的类以业务为主,不一定和表一一对应>using System;using System.Collections.Generic;using System.Linq;using System.Text;using HotelManager.Models;using HotelManager.DAL;namespace HotelManager.BLL{ public class RoomTypeManager { RoomTypeServi... 阅读全文
posted @ 2013-06-13 16:05 Big.Eagle 阅读(323) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;namespace HotelManager.DAL{ public class DBHelpSQL { static string connctionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnString"].... 阅读全文
posted @ 2013-06-13 15:20 Big.Eagle 阅读(195) 评论(0) 推荐(0) 编辑
摘要: CompareValidator控件 三种不同类型的验证任务1、执行数据类型检测 验证输入是否类型正确的值(ControlToValidate="需要验证的控件ID", Type="需要绑定的类型(字符串是string,整型是integer,等等)",Operator="DataTypeCheck"(进行数值类型比较))2、输入值和一固定值进行比较(ControlToValidate="需要验证的控件ID",Type="需要绑定的类型(字符串是string,整型是integer,等等)",Ope 阅读全文
posted @ 2013-06-11 23:25 Big.Eagle 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %> 2 3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4 5 <h 阅读全文
posted @ 2013-06-04 16:00 Big.Eagle 阅读(201) 评论(0) 推荐(0) 编辑
摘要: •HttpHandler是对请求的响应,可以输出普通的html内容,也可以输出图片、也可以输出一个文件(下载)<那么如何判断输出的文件类型?比如输出的是MP3还是.jpeg、png-->使用HTTP协议的contentType属性来判断>•输出一幅动态创建的图片(能看懂就可以)本例实现在已有图片的指定位置画一个字符串: 1 <%@ WebHandler Language="C#" Class="MakeImg" %> 2 3 using System; 4 using System.Web; 5 using System.D 阅读全文
posted @ 2013-05-28 18:44 Big.Eagle 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 一、浏览器端 1.表单元素使用 文件选择框<input type="file"/> 控件。 2.表单设置enctype二、服务器端 1.服务器接收客户端上传的文件使用Request.Files属性。 2.使用HttpPostedFile的SaveAs方法将图片保存在服务器。代码实现:模板文件ImageUpLoad.htm 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 阅读全文
posted @ 2013-05-28 17:11 Big.Eagle 阅读(302) 评论(0) 推荐(0) 编辑
摘要: •实现input的自增:点击按钮input中的值自动增加,代码见备注。点击刷新就一直是值不变,只有点击提交才会变,分析原理。用开发人员工具篡改文本框的值自增就从新的值开始了。 1 <%@ WebHandler Language="C#" Class="Handler3" %> 2 3 using System; 4 using System.Web; 5 6 public class Handler3 : IHttpHandler { 7 int a = 0; 8 public void ProcessRequest (HttpContext 阅读全文
posted @ 2013-05-27 23:15 Big.Eagle 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 入门1.html•<form action="入门1.ashx">• <input type="text" name="username" /><input type="submit" />•</form>新建一个【一般处理程序】入门1.ashx,ProcessRequest中写 •context.Response.ContentType = "text/html"; •string username = context.Request[" 阅读全文
posted @ 2013-05-27 21:12 Big.Eagle 阅读(226) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页