asp_增删查改(4)
来源:互联网 发布:2016中超网络直播权 编辑:程序博客网 时间:2024/05/24 11:14
Add.ashx:
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string title = context.Request["txttitle"];
string people=context.Request["txtPeople"];
try
{
BLL.HKSJ_Main mainServer = new BLL.HKSJ_Main();
Model.HKSJ_Main main = new Model.HKSJ_Main();
main.content = string.Empty;
main.Date = DateTime.Now;
main.picUrl = string.Empty;
main.people = people;
main.title = title;
main.type = string.Empty;
mainServer.Add(main);
context.Response.Write("OK");
}
catch(Exception ex)
{
context.Response.Write("后台变态了。。。。");
}
}
Delete.ashx:
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
int id = int.Parse(context.Request["id"]??"0");
try
{
BLL.HKSJ_Main mainServer = new BLL.HKSJ_Main();
mainServer.Delete(id);
context.Response.Write("ok");
}
catch (Exception ex)
{
context.Response.Write("删除失败");
}
}
Edit.ashx:
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
int id = int.Parse(context.Request["hidId"] ?? "0");
string title = context.Request["txtEditTitle"];
string people = context.Request["txtEditPeople"];
try
{
BLL.HKSJ_Main mainServer = new BLL.HKSJ_Main();
var editMain = mainServer.GetModel(id);
editMain.people = people;
editMain.title = title;
if (mainServer.Update(editMain))
{
context.Response.Write("OK");
}
else
{
context.Response.Write("修改失败");
}
}
catch (Exception ex)
{
context.Response.Write("异常");
}
}
- asp_增删查改(4)
- asp_异步增删查改(2)
- asp_异步增删查改(3)
- asp_异步列表的增删查改
- 数据库(增删查改)
- arraylist(增删改查)
- Hashmap(增删改查)
- 单链表(增删改查)
- ASP_一般处理程序_实现增删给查
- linq to sql 学习(4)增删改查实例
- SqlServer之基本增删改查(4)
- lucene4.4 索引的增删改查
- 4_数据库的增删改查
- Docker学习4 - 增删改查
- hbase 1.1.4增删查改demo
- 单链表的增删查改(转贴)
- SQL+语句(增删改查)
- oracle的CRUD(增删改查)
- linux基本命令之计划任务
- 《程序员的修炼:从优秀到卓越》目录及部分精彩内容
- DedeCms文章页加上百度、谷歌搜索功能
- asp_异步增删查改(3)
- java编程思想static之程序执行顺序
- asp_增删查改(4)
- More Effective C++议题【四】:避免无用的缺省构造函数
- 解决spring.handlers spring.schemas spring.tooling 被覆盖问题,而出现Spring 3.0: Unable to locate Spring Namespa
- Android 动画之ScaleAnimation应用详解
- ArcGIS Server for javascript构建自己的GraphicsLayer(一)
- linux命令(3)
- SSL证书与https简介
- Maven + Spring + SpringMVC + Spring JPA <2>
- hbase源码学习.Lease