菜鸟进入,高手请绕道!

+++++++++++++++++++++++++++++++++++++++

一、数据的显示

1新建HtmlPage2.html页面,引入相关文件。如下所示

   <script src="easyui/js/jquery-1.8.2.min.js"></script>
<script src="easyui/js/jquery.easyui.min.js"></script>
<link href="easyui/css/themes/default/easyui.css" rel="stylesheet" />
<link href="easyui/css/themes/icon.css" rel="stylesheet" /> 

2datagrid加载数据。代码如下所示

 $(function () {
$('#dg').datagrid({
url: 'HtmlPage2.ashx',//请求数据的URL 代码附后
columns: [[
{ field: 'User_Name', title: '用户名', width: , align: 'center' }, //User_Name为数据库表中的字段名称 下同
{ field: 'User_Pwd', title: '密码', width: , align: 'center' },
{ field: 'User_Sex', title: '性别', width: , align: 'center', formatter: function (value) { return value == ? "男" : "女"; } },
{ field: 'User_Code', title: '员工号', width: , align: 'center' },
{ field: 'CreateUserName', title: '创建者', width: , align: 'center' },
{ field: 'Email', title: '电子邮件', width: , align: 'center' },
{ field: 'ModifyUserName', title: '修改者', width: , align: 'center' },
]],
width: ,
rowStyler: function (index, row) { if (index % == ) { return 'background-color:#808080;'; } },
striped: true, pagination: true, rownumbers: true, singleSelect: true, pageNumber: , pageSize: , pageList: [, , , , , ], showFooter: true
});
}
<dody>
<table id="dg"></table> 
</body>
============================ HtmlPage2.ashx代码:
    using System.Data.SqlClient;
using System.Data;
using System.Text;
/// <summary>
/// HtmlPage2 的摘要说明
/// </summary>
public class HtmlPage2 : IHttpHandler
{ public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/html";int page = int.Parse(context.Request.Form["page"]);//页码
int rows = int.Parse(context.Request.Form["rows"]);//页容量
InitData(context,page,rows);
} private void InitData(HttpContext context,int pageindex,int pagesize)
{ int total;
string sql =string.Format("select * from (select *,ROW_NUMBER() over (order by user_id) as id from Base_UserInfo) as tmp where tmp.id between {0}+1 and {1}",(pageindex-)*pagesize,pagesize*pageindex);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
StringBuilder sb = new StringBuilder();
using (SqlConnection con = new SqlConnection("server=.;database=RM_DB;uid=sa;pwd=sa"))
{
con.Open();
SqlDataAdapter da = new SqlDataAdapter(sql, con);
da.Fill(ds);
dt = ds.Tables[];
SqlCommand cmd = new SqlCommand("select count(*) from Base_UserInfo", con);//总行数
total =(int) cmd.ExecuteScalar();
con.Close();
}
sb.Append("{\"total\":" + total);
sb.Append(",");
sb.Append("\"rows\":[");
//转化为Json格式
foreach (DataRow row in dt.Rows)
{
sb.Append("{");
foreach (DataColumn column in dt.Columns)
{
sb.Append("\"" + column.ColumnName + "\":\"" + row[column.ColumnName].ToString() + "\",");
}
sb.Remove(sb.Length - , );
sb.Append("},");
}
sb.Remove(sb.Length - , );
sb.Append("]}");
context.Response.Write(sb.ToString());
}
}

3.效果如图所示

二、查询。在body中添加如下代码。
 <div class="easyui-accordion" style="width: 1066px; height: auto;">
<div title="操作栏" data-options="" style="overflow: auto; padding: 10px;">
<ul class="easyui-tree">
<div style="margin: 10px 0;">
</div>
用户名:<input required="true" id="SearchUserName">&nbsp;
性别:<input required="true" id="SearchSex">&nbsp;
<a href="#" class="easyui-linkbutton" id="search">查询</a>&nbsp;&nbsp;
<a href="#" class="easyui-linkbutton" id="add">新增</a>&nbsp;&nbsp;
<a href="#" class="easyui-linkbutton" id="delete">删除</a>&nbsp;&nbsp;
<a href="#" class="easyui-linkbutton" id="edit">编辑</a>&nbsp;&nbsp;
</ul>
</div>
</div>

效果图如下:

查询代码:

$("#search").click(function () {
$('#dg').datagrid({
url: '/HtmlPage3.ashx',//代码附后
loadMsg: '正在加载中',
columns: [[
{ field: 'User_Name', title: '用户名', width: },
{ field: 'User_Pwd', title: '密码', width: },
{ field: 'User_Sex', title: '性别', width: , align: 'right', formatter: function (value) { return value == ? "男" : "女"; } },
{ field: 'User_Code', title: '员工号', width: },
{ field: 'CreateUserName', title: '创建者', width: },
]], width: ,
queryParams: {
UserName: $("#SearchUserName").val(),
sex: $("#SearchSex").val(), //发送额外的参数
},
rowStyler: function (index, row) {
if (index % == ) {
return 'background-color:#6293BB;color:#fff;';
}
},
striped: true, pagination: true, rownumbers: true, singleSelect: true, pageNumber: , pageSize: , pageList: [, , , , , ], showFooter: true
}) })
============
HtmlPage3.ashx代码
using System.Data.SqlClient;
using System.Data;
using System.Text;
/// <summary>
/// HtmlPage2 的摘要说明
/// </summary>
public class HtmlPage2 : IHttpHandler
{ public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/html";int page = int.Parse(context.Request.Form["page"]);
int rows = int.Parse(context.Request.Form["rows"]);
ChaxunData(context,page,rows);
}
  private void ChaxunData(HttpContext context,int pageindex,int pagesize)
{
int total;
string sql = "select * from (select *,ROW_NUMBER() over (order by user_id) as id from Base_UserInfo) as tmp where 1=1 ";
string tsql = string.Empty;
string UserName = context.Request.Form["UserName"];
string sex = context.Request.Form["sex"];
if (!string.IsNullOrEmpty(UserName))
{
sql += string.Format(" and User_Name='{0}'", UserName) ;
tsql += string.Format(" and User_Name='{0}'", UserName);
}
if (!string.IsNullOrEmpty(sex))
{
int s = (sex == "男") ? : ;
sql += string.Format(" and User_Sex='{0}' ",s);
tsql += string.Format(" and User_Sex='{0}'", s);
}
sql += string.Format(" and tmp.id between {0}+1 and {1}", (pageindex - ) * pagesize, pagesize * pageindex);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
StringBuilder sb = new StringBuilder();
using (SqlConnection con = new SqlConnection("server=.;database=RM_DB;uid=sa;pwd=sa"))
{
con.Open();
SqlDataAdapter da = new SqlDataAdapter(sql, con);
da.Fill(ds);
dt = ds.Tables[];
SqlCommand cmd = new SqlCommand("select count(*) from Base_UserInfo where 1=1 "+tsql, con);
total = (int)cmd.ExecuteScalar();
con.Close();
}
sb.Append("{\"total\":" + total);
sb.Append(",");
sb.Append("\"rows\":[");
foreach (DataRow row in dt.Rows)
{
sb.Append("{");
foreach (DataColumn column in dt.Columns)
{
sb.Append("\"" + column.ColumnName + "\":\"" + row[column.ColumnName].ToString() + "\",");
}
sb.Remove(sb.Length - , );
sb.Append("},");
}
sb.Remove(sb.Length - , );
sb.Append("]}");
context.Response.Write(sb.ToString());
}
}
查询结果举例:支持查询结果的分页




三、新增、修改

  var isEdit=true;
//初始化操作窗体
$('#CommonWin').window({
width: ,
height: ,
modal: true,
minimizable: false,
maximizable: false,
draggable: false,
resizable: false,
collapsible: false,
title: '用户操作',
left: ,
top:
}).window("close");
------点击新增事件------
$("#add").click(function () {
isEdit = false;
$('#CommonWin').window("open");
})
-------修改--------
$("#edit").click(function () {
isEdit = true;
var $selectRow = $("#dg").datagrid("getSelected");
if ($selectRow) {
$.get("/operator.ashx?type=edit&User_ID=" + $selectRow.User_ID,
function (js) {
alert(js.data.User_Name);
$("#userid").val(js.data.User_ID);
$("#username").val(js.data.User_Name);
$("#userpwd").val(js.data.User_Pwd);
$("#usersex").val(js.data.User_Sex==?"男":"女");
$('#CommonWin').window("open");
});
}
else {
$.messager.alert('提示', '请选择要操作的行!', 'info');
}
})
------保存----
function Save() {
if (isEdit) {
SaveEdit();
}
else {
SaveAdd();
}
}
----------------------
function SaveAdd() {
var form = $("#from1").serialize();
form += "&type=add";
$.post(
"/operator.ashx",//代码附后
form,
function (js) {
$('#CommonWin').window("close");
$("#dg").datagrid("reload");
})
}
function SaveEdit() {
var form = $("#from1").serialize();
form += "&type=update";
$.post(
"/operator.ashx",
form,
function (js) {
$('#CommonWin').window("close");
$("#dg").datagrid("reload");
})
}
---------------------
--------body-----------
<div id="CommonWin">
<form id="from1" >
<table border="" cellspacing="" cellpadding="" width="100%">
<tr>
<td><input type="hidden" name="userid" id="userid" /></td>
</tr>
<tr>
<td>用户名:<input type="text" name="username" id="username"></td>
</tr>
<tr>
<td>密 码:<input type="text" name="userpwd" id="userpwd"></td>
</tr>
<tr>
<td>性 别:<input type="text" name="usersex" id="usersex"></td>
</tr>
<tr><td><input type="submit" value="保存" onclick="Save()"/></td></tr>
</table>
</form>
</div>

operator.ashx代码:

   using System.Data.SqlClient;
using System.Data;
/// <summary>
/// _operator 的摘要说明
/// </summary>
public class _operator : IHttpHandler
{
/// <summary>
/// 当前上下文对象
/// </summary>
public HttpRequest Request
{ get
{
return HttpContext.Current.Request;
}
}
private HttpResponse Response
{
get { return HttpContext.Current.Response; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/html";
string type=Request.Params["type"];
switch (type)
{
case "add": Add(); break;
case "delete": Delete(); break;
case "edit": Edit(); break;
case "update": Update(); break;
} }
/// <summary>
/// 得到编辑的数据
/// </summary>
private void Edit()
{
string userid = Request.QueryString["User_ID"];
string sql = string.Format("select * from Base_UserInfo where User_ID='{0}'", userid);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
using (SqlConnection con = new SqlConnection("server=.;database=RM_DB;uid=sa;pwd=sa"))
{
SqlDataAdapter da = new SqlDataAdapter(sql, con);
da.Fill(ds);
dt = ds.Tables[];
}
MessageShow(, "ww", dt);
}
/// <summary>
/// 添加
/// </summary>
private void Add()
{
string username = Request.Form["username"];
string userpwd = Request.Form["userpwd"];
string usersex = Request.Form["usersex"];
int i = (usersex == "男") ? :( usersex == "女" )? : ;
string uid = Guid.NewGuid().ToString();
string sql = string.Format("insert Base_UserInfo(User_ID,User_Name,User_Pwd,User_Sex)values('{0}','{1}','{2}',{3})", uid, username, userpwd,i);
using (SqlConnection con = new SqlConnection("server=.;database=RM_DB;uid=sa;pwd=sa"))
{
con.Open();
SqlCommand cmd = new SqlCommand(sql, con);
cmd.ExecuteNonQuery();
con.Close();
MessageShow(, "新增成功", null);
}
}
/// <summary>
/// 删除操作
/// </summary>
private void Delete()
{
string User_ID = Request.QueryString["User_ID"];//删除的主键
string sql="delete Base_UserInfo where User_ID=@User_ID";
using(SqlConnection con=new SqlConnection("server=.;database=RM_DB;uid=sa;pwd=sa"))
{
con.Open();
SqlCommand cmd = new SqlCommand(sql,con);
SqlParameter p = new SqlParameter("@User_ID", User_ID);
cmd.Parameters.Add(p);
cmd.ExecuteNonQuery();
con.Close();
MessageShow(, "删除成功", null);
}
} /// <summary>
/// 更新
/// </summary>
private void Update()
{
//todo();
}
/// <summary>
/// 统一返回浏览器消息
/// </summary>
/// <param name="s">状态</param>
/// <param name="m">消息提示</param>
/// <param name="d">数据</param>
public void MessageShow(int s, string m, object d)
{
MessageInfo min = new MessageInfo(s,m,d);
System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
string ToJson = js.Serialize(min);
Response.Write(ToJson);
}
public bool IsReusable
{
get
{
return false;
}
}
}

四 删除:

前端代码 后台代码见上

   //删除
$("#delete").click(function () {
var $selectRow = $("#dg").datagrid("getSelected");
if ($selectRow) {
$.messager.confirm('确认对话框', '您确定要删除么?', function (r) {
if (r) {
$.get("/operator.ashx?type=delete&User_ID=" + $selectRow.User_ID,
function (js) { $("#dg").datagrid("reload"); });
}
});
}
else {
$.messager.alert('提示', '请选择要操作的行!', 'info');
}
});

注:数据库代码

USE [RM_DB]

CREATE TABLE [dbo].[Base_UserInfo](
[User_ID] [dbo].[Name(50)] NOT NULL,
[User_Code] [dbo].[Name(50)] NULL,
[User_Account] [dbo].[Name(50)] NULL,
[User_Pwd] [dbo].[Name(50)] NULL,
[User_Name] [dbo].[Name(50)] NULL,
[User_Sex] [dbo].[ID] NULL,
[Title] [dbo].[Name(50)] NULL,
[Email] [dbo].[Name(20)] NULL,
[Theme] [dbo].[Name(50)] NULL,
[Question] [dbo].[Name(50)] NULL,
[AnswerQuestion] [dbo].[Name(50)] NULL,
[DeleteMark] [dbo].[ID] NULL,
[CreateDate] [Date] NULL,
[CreateUserId] [dbo].[Name(50)] NULL,
[CreateUserName] [dbo].[Name(50)] NULL,
[ModifyDate] [Date] NULL,
[ModifyUserId] [dbo].[Name(50)] NULL,
[ModifyUserName] [dbo].[Name(50)] NULL,
[User_Remark] [dbo].[Name(Max)] NULL,
CONSTRAINT [PK_BASE_USERINFO] PRIMARY KEY NONCLUSTERED
(
[User_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'User_ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'User_Code'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户账户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'User_Account'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'User_Pwd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'User_Name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性别 1:男、0:女' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'User_Sex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'职称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'电子邮件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'Email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统样式选择' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'Theme'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码提示问题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'Question'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码提示答案' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'AnswerQuestion'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除标记 1:正常,2:锁定,0:删除' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'DeleteMark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'CreateDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'CreateUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'ModifyDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'ModifyUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'ModifyUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo', @level2type=N'COLUMN',@level2name=N'User_Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户帐户表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_UserInfo'
GO
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'4f6531ac-ae1b-40a3-8b3b-546e7f767c77', NULL, NULL, N'qwe', N'林', 1, NULL, NULL, NULL, NULL, NULL, 1, CAST(0x0000A355013CE2E9 AS DateTime), NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'e987cb03-b62f-4c34-b899-15ffa0ee58e7', NULL, NULL, N'', N'', 1, NULL, NULL, NULL, NULL, NULL, 1, CAST(0x0000A355013F70E8 AS DateTime), NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'094f85f8-bc53-4247-979c-09da591d51b0', N'', N'minmin', N'4A7D1ED414474E4033AC29CCB8653D9B', N'敏敏', 1, N'', N'', NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B10157D004 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'')
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'10476848-5b91-411a-a35e-c24a205e7365', N'', N'hz', N'4A7D1ED414474E4033AC29CCB8653D9B', N'华仔', 1, N'', N'', NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B10157D964 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'')
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'4158bc01-004b-4677-8b86-0e3e4c483f6e', N'', N'ln', N'4A7D1ED414474E4033AC29CCB8653D9B', N'李娜', 1, N'', N'', NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B101580268 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'')
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'4baa8438-930f-4b02-8fc1-d67bd43d2fb0', N'', N'lw', N'4A7D1ED414474E4033AC29CCB8653D9B', N'刘伟', 1, N'', N'', NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B600B31B2B AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'dd')
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'4ef78175-afc9-48e4-9b85-13f1e9a86a79', N'', N'zm', N'4A7D1ED414474E4033AC29CCB8653D9B', N'张敏', 1, N'', N'', NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B101581654 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'')
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'74f86691-537a-4c5c-a7e8-6f68bbe95788', N'', N'xe', N'4A7D1ED414474E4033AC29CCB8653D9B', N'雪儿', 1, N'', N'', NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B101583148 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'')
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'7510d804-cb83-41bb-94a7-1d35211d7814', N'', N'xe', N'4A7D1ED414474E4033AC29CCB8653D9B', N'瓶子', 1, N'', N'', NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B101583BD4 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'')
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'75e1f7a2-74ab-4d21-af74-a601f30f02ee', N'', N'wf', N'4A7D1ED414474E4033AC29CCB8653D9B', N'王芳', 1, NULL, NULL, NULL, NULL, NULL, 1, CAST(0x0000A19400C4E4B0 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', NULL, NULL, NULL, NULL)
INSERT [dbo].[Base_UserInfo] ([User_ID], [User_Code], [User_Account], [User_Pwd], [User_Name], [User_Sex], [Title], [Email], [Theme], [Question], [AnswerQuestion], [DeleteMark], [CreateDate], [CreateUserId], [CreateUserName], [ModifyDate], [ModifyUserId], [ModifyUserName], [User_Remark]) VALUES (N'0ede986c-5a68-4e74-9198-3c1e5015e0d2', N'', N'test', N'4A7D1ED414474E4033AC29CCB8653D9B', N'测试员', 1, N'软件工程师', N'', NULL, NULL, NULL, 1, CAST(0x0000A1B10150A158 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', CAST(0x0000A1B801030761 AS DateTime), N'48f3889c-af8d-401f-ada2-c383031af92d', N'管理员(system)', N'')
/****** Object: Default [DF_Base_UserInfo_DeleteMark] Script Date: 06/25/2014 20:38:18 ******/
ALTER TABLE [dbo].[Base_UserInfo] ADD CONSTRAINT [DF_Base_UserInfo_DeleteMark] DEFAULT ((1)) FOR [DeleteMark]
GO
/****** Object: Default [DF_Base_UserInfo_CreateDate] Script Date: 06/25/2014 20:38:18 ******/
ALTER TABLE [dbo].[Base_UserInfo] ADD CONSTRAINT [DF_Base_UserInfo_CreateDate] DEFAULT (getdate()) FOR [CreateDate]
GO

EasyUI中datagrid实现显示、增加、 删除、 修改、 查询操作(后台代码C#)的更多相关文章

  1. [JavaWeb基础] 004.用JSP + SERVLET 进行简单的增加删除修改

    上一次的文章,我们讲解了如何用JAVA访问MySql数据库,对数据进行增加删除修改查询.那么这次我们把具体的页面的数据库操作结合在一起,进行一次简单的学生信息操作案例. 首先我们创建一个专门用于学生管 ...

  2. [Easyui - Grid]为easyui的datagrid、treegrid增加表头菜单,用于显示或隐藏列

    为easyui的datagrid.treegrid增加表头菜单,用于显示或隐藏列 /** * @author 孙宇 * * @requires jQuery,EasyUI * * 为datagrid. ...

  3. easyUI中datagrid展示对象下属性以及显示多个子属性(Day_37)

    easyUI中datagrid展示对象下属性以及显示多个子属性 显示对象单个属性值 添加formatter属性 <th field="decidedzone" width=& ...

  4. EasyUI中datagrid的基本用法

    EasyUI中datagrid是最常用的一个控件了,现在整理一下datagrid的基本语法,先展示下页面效果吧,如下图

  5. 给Jquery easyui 的datagrid 每行增加操作链接(转)

    http://www.thinkphp.cn/code/207.html 通过formatter方法给Jquery easyui 的datagrid 每行增加操作链接我们都知道Jquery的EasyU ...

  6. Nodejs之MEAN栈开发(九)---- 用户评论的增加/删除/修改

    由于工作中做实时通信的项目,需要用到Nodejs做通讯转接功能,刚开始接触,很多都不懂,于是我和同事就准备去学习nodejs,结合nodejs之MEAN栈实战书籍<Getting.MEAN.wi ...

  7. EasyUI 中 DataGrid 控件 列 如何绑定对象中的属性

    EasyUI 中 DataGrid 控件 是我们经常用到的控件之一, 但是 DataGrid 控件 在绑定显示列时却不支持对象属性绑定. 模型如下: public class Manager impl ...

  8. EasyUI中datagrid双击事件

    EasyUI中datagrid双击事件 在jsp文件底部增加代码: <script type="text/javascript"> //数据表双击事件 $('#tabl ...

  9. AutoCad 二次开发 .net 之层表的增加 删除 修改图层颜色 遍历 设置当前层

    AutoCad 二次开发 .net 之层表的增加 删除 修改图层颜色 遍历 设置当前层 AutoCad 二次开发 .net 之层表的增加 删除 修改图层颜色 遍历 设置当前层我理解的图层的作用大概是把 ...

随机推荐

  1. android手机上安装apk时出现解析包错误的一个解决办法

    今天下午在学习安卓开发时,学习开发文档中的gridview时,在模拟器上调试程序一切正常,如下图所示: 但当将bin目录下的HelloGridView.apk拷贝到M8安卓系统后进行安装时,出现了“解 ...

  2. 前端js模板库 JinkoTemplate

    有时候需要使用ajax来异步生成html,最土的方法就是用js的‘+’连接html代码,生成繁琐.一旦需要修改,对于少量的html代码到没啥问题,要是比较复杂的样式时,就真坑爹了,眼花缭乱有木有?Ji ...

  3. Moss 几个编程技巧

    1.提升权限执行的代码 SPSecurity.RunWithElevatedPrivileges(delegate() { // 需要提升权限执行的代码 }); 应用场景:当前用户可能没有权限执行的操 ...

  4. vue+webpack一些知识

    使用mac的用户需要获取权限才可以使用npm install指令 设置node目录的权限指令 sudo chmod -R 777 /usr/local/lib/node_modules/ 大家都知道国 ...

  5. #import和#include的区别 关键字@class的作用

    一.#import和#include的区别当我们在代码中使用两次#include的时候会报错:因为#include相当于拷贝头文件中的声明内容,所以会报重复定义的错误但是使用两次#import的话,不 ...

  6. CSS3中新增的内容

    (整理中······) 一.选择器 新增的伪类 1.p:first-of-type   选择属于其父元素的首个 <p> 元素的每个 <p> 元素. 2.p:last-of-ty ...

  7. 剑指offer第五题

    输入一个链表,从尾到头打印链表每个节点的值.  但是 根据往常的经验 如果if里面有return了 就不要写else了  import java.util.ArrayList; import java ...

  8. 进程间通信机制IPC

    进程通信是指进程之间的信息交换.PV操作是低级通信方式,例如信号量,主要是进程间以及同一进程内不同线程之间的同步手段.髙级通信方式是指以较高的效率传输大量数据的通信方式.高级通信方法主要有以下三个类. ...

  9. OpenCV学习(1)OpenCV简介

    简介 OpenCV的全称是:Open Source Computer Vision Library,OpenCV是一个开源的跨平台的计算机视觉库,可以运行在Linux.Windows和Mac OS操作 ...

  10. C#正则提取HTML中img的url值

    /// <summary> /// 取得HTML中所有图片的 URL. /// </summary> /// <param name="sHtmlText&qu ...