<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title> <script src="../../../Scripts/jquery.js" type="text/javascript" language="javascript"></script> <script src="../../../Scripts/jquery.foe.common.js" type="text/javascript"></script> <script src="../../../Scripts/jquery.foe.utils.js" type="text/javascript"></script> <script type="text/javascript" language="javascript">
function openpage(GroupID) {
OpenPage('Sys_UserGroupPermissionEmployeeInfo.aspx?GroupID=' + GroupID + '', '人员管理', '','');
}
function openwin(groupID) {
OpenPage('Sys_UserGroupPermissionInfo.aspx?GroupID=' + groupID + '', '权限管理', '', '');
}
</script> </head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="scriptManager" runat="server">
</telerik:RadScriptManager>
<table class="TableStyle">
<tr>
<th>
用户组名称:
</th>
<td>
<asp:TextBox ID="txtGroupName" runat="server" CssClass="Input">
</asp:TextBox>
</td>
<th>
用户组编码:
</th>
<td>
<asp:TextBox ID="txtGroupCode" runat="server" CssClass="Input"></asp:TextBox>
</td>
</tr>
</table>
<telerik:RadToolBar ID="toolBar" runat="server" Width="100%" OnButtonClick="toolBar_ButtonClick"
Height="22px">
<Items>
<telerik:RadToolBarButton Text="查询" ImageUrl="../../../Common/images/ToolBarIcons/search.png">
</telerik:RadToolBarButton>
</Items>
</telerik:RadToolBar>
<telerik:RadGrid AlternatingItemStyle-CssClass="AlterLine" ID="dgGroups" runat="server"
AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" PagerStyle-AlwaysVisible="true"
AllowCustomPaging="true" PagerStyle-Mode="NextPrevAndNumeric" OnNeedDataSource="dgGroups_NeedDataSource"
PageSize="">
<MasterTableView DataKeyNames="GroupID" ClientDataKeyNames="GroupID">
<Columns>
<telerik:GridBoundColumn HeaderText="用户组名称" DataField="GroupName">
<HeaderStyle Width="200px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="用户组编码" DataField="GroupCode">
<HeaderStyle Width="200px" />
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn>
<HeaderTemplate>
人员
</HeaderTemplate>
<ItemTemplate>
<a href="#" onclick='openpage(<%#Eval("GroupID") %>)'>点击查看</a>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn>
<HeaderTemplate>
权限
</HeaderTemplate>
<ItemTemplate>
<a href="#" onclick='openwin(<%#Eval("GroupID") %>)'>点击查看</a>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView> </telerik:RadGrid>
<asp:HiddenField ID="hfGroupID" runat="server" />
</form>
</body>
</html>
  private Org_UserGroupBLL bll = new Org_UserGroupBLL();

         protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["groupName"] = string.Empty;
ViewState["groupCode"] = string.Empty;
} SetPager(this.dgGroups);
} protected void toolBar_ButtonClick(object sender, RadToolBarEventArgs e)
{
this.dgGroups.CurrentPageIndex = ;
ViewState["groupName"] = this.txtGroupName.Text;
ViewState["groupCode"] = this.txtGroupCode.Text;
this.dgGroups.Rebind();
} protected void dgGroups_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
int count = ;
this.dgGroups.DataSource = bll.GetGroups(this.dgGroups.CurrentPageIndex * this.dgGroups.PageSize, this.dgGroups.PageSize, ref count, (string)ViewState["groupName"], (string)ViewState["groupCode"]);
this.dgGroups.VirtualItemCount = count;
this.hfGroupID.Value = string.Empty;
}

后台代码

 <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title> <script src="../../../Scripts/jquery.js" type="text/javascript"></script> </head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadGrid AlternatingItemStyle-CssClass="AlterLine" ID="dgRoleUsers" runat="server"
AutoGenerateColumns="false" PageSize="" OnNeedDataSource="dgRoleUsers_NeedDataSource"
AllowPaging="true" AllowMultiRowSelection="true" AllowCustomPaging="true" PagerStyle-AlwaysVisible="true"
PagerStyle-Mode="NextPrevAndNumeric" Width="100%">
<MasterTableView ClientDataKeyNames="RelationID" DataKeyNames="RelationID">
<Columns>
<telerik:GridTemplateColumn HeaderText="部门" ItemStyle-Width="450px">
<ItemTemplate>
<%# GetDeparementFullName(Convert.ToInt32(Eval("UserID"))) %>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="姓名" DataField="UserName">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>
<asp:HiddenField ID="hfRoleID" runat="server" />
</form>
</body>
</html>

列表-前台页面

  private Org_Relation_UserToGroupBLL bll = new Org_Relation_UserToGroupBLL();

         protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.hfRoleID.Value = Convert.ToInt32(Request.QueryString["GroupID"]).ToString();
} int UserDepID = ;
if (CurrentUser.Project != null)
{
UserDepID = CurrentUser.Project.DepID;
}
else if (CurrentUser.SubCompany != null)
{
UserDepID = CurrentUser.SubCompany.DepID;
}
else
{
UserDepID = ;
} SetPager(this.dgRoleUsers);
}
protected void dgRoleUsers_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
Foe.Common.HelperClass.Pagination pa = new Foe.Common.HelperClass.Pagination();
pa.PageSize = this.dgRoleUsers.PageSize;
pa.PageIndex = dgRoleUsers.CurrentPageIndex + ; Foe.Model.Organization.Org_Relation_UserToGroup model = new Foe.Model.Organization.Org_Relation_UserToGroup();
model.GroupID = Convert.ToInt32(this.hfRoleID.Value); int UserDepID = ; if (CurrentUser.Project != null)
{
UserDepID = CurrentUser.Project.DepID;
}
else if (CurrentUser.SubCompany != null)
{
UserDepID = CurrentUser.SubCompany.DepID;
}
this.dgRoleUsers.DataSource = bll.GetListByPage(model, pa, UserDepID);
this.dgRoleUsers.VirtualItemCount = pa.TotalRecord;
} /// <summary>
/// 初始化用户部门全路径
/// </summary>
public string GetDeparementFullName(int userID)
{
Foe.BLL.Organization.Org Organizationll = new Foe.BLL.Organization.Org(); return Organizationll.GetFullPathByEmpID(userID); }

列表-后台代码

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title> <script src="../../../Scripts/jquery.js" type="text/javascript"></script> <script src="../../../Scripts/jquery.foe.common.js" type="text/javascript"></script> <script src="../../../Scripts/jquery.foe.utils.js" type="text/javascript"></script> <script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#btnSave').click(function() {
var GroupId = $("#hidGroupId").val();
var check = $("input[type='checkbox']");
check.each(function() {
if ($(this).is(':checked')) {
var flowid = $(this).next('input:hidden[id*=hidID]').val();
if (flowid != "" && flowid != "undefined") {
SaveFlowInfo(GroupId, flowid);
}
else
{ return false; }
}
});
alert('保存成功');
opener.location.reload();
window.close();
});
}); function SaveFlowInfo(GroupId, flowid) {
$.ajax({
type: "post",
url: "Sys_UserGroupPermissionSaveFlowInfo.ashx?GroupId=" + escape(GroupId) + "&&FixedFlowID=" + escape(flowid),
dataType: "json",
contentType: "application/x-www-form-urlencoded; charset=utf-8",
success: function(data) {
if (data != null) {
return true; }
else {
return false;
}
}, error: function(XMLHttpRequest, textStatus, errorThrown) { return false; } }); } </script> </head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<div>
<telerik:RadGrid AlternatingItemStyle-CssClass="AlterLine" ID="dgManage" runat="server"
AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" PagerStyle-AlwaysVisible="true"
AllowMultiRowSelection="true" AllowCustomPaging="true" PagerStyle-Mode="NextPrevAndNumeric"
OnNeedDataSource="dgManage_NeedDataSource" PageSize="">
<MasterTableView DataKeyNames="FixedFlowID,FixedFlowTypeFullName" ClientDataKeyNames="FixedFlowID,FixedFlowTypeFullName">
<Columns>
<%--<telerik:GridClientSelectColumn UniqueName="FixedFlowID" />
--%>
<telerik:GridTemplateColumn HeaderText="选择" ItemStyle-Width="50px" HeaderStyle-Width="50px">
<ItemTemplate>
<input type="checkbox" id="ckhItem" runat="server" />
<asp:HiddenField ID="hidID" runat="server" Value='<%#Eval("FixedFlowID") %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="50px" />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="编号" DataField="FixedFlowID" Visible="false"
HeaderStyle-Width="80px" ItemStyle-Width="80px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="流程名称" DataField="FixdeFlowName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="类别" DataField="FixedFlowTypeFullName">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="true" />
<Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" />
</ClientSettings>
<PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
</div>
<div style="margin: 5px auto; width: 100%; text-align: center">
<input type="button" id="btnSave" value="保存" class="btn" />&nbsp;<input type="button"
value="关闭" class="btn" onclick="window.close()" />
</div>
<asp:HiddenField ID="hidFixedFlowID" runat="server" />
<asp:HiddenField ID="hidGroupId" runat="server" />
</form>
</body>
</html>

新增多项前台页面代码

 Foe._2B2C.Model.ModelTempTableFlow mode = new Foe._2B2C.Model.ModelTempTableFlow();

         protected void Page_Load(object sender, EventArgs e)
{
this.hidGroupId.Value = Request.QueryString["GroupID"];
if (!IsPostBack)
{
BindDataSource();
}
SetPager(this.dgManage);
} protected void dgManage_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
BindDataSource();
} protected void BindDataSource()
{
var pi = new Foe.Common.HelperClass.Pagination()
{
PageIndex = this.dgManage.CurrentPageIndex +
}; this.dgManage.DataSource = new Foe._2B2C.BLL.BLLTempTableFlow().GetList(mode, pi);
this.dgManage.VirtualItemCount = pi.TotalRecord;
}

新增后台代码

模板列传值到子窗体中,子窗体中多选gridview中checkbox保存数据多项到数据库中的更多相关文章

  1. 怎样把excel的数据导入到sqlserver2000数据库中

    在做程序的时候有时需要把excel数据导入到sqlserver2000中,以前没从外部导入过数据,今天刚做了一下导入数据,感觉还是蛮简单的,没做过之前还想着多么的复杂呢,下面就来分享一下我是如何把ex ...

  2. python 读取SQLServer数据插入到MongoDB数据库中

    # -*- coding: utf-8 -*-import pyodbcimport osimport csvimport pymongofrom pymongo import ASCENDING, ...

  3. 如何将MongoDB数据库的数据迁移到MySQL数据库中

    FAQ v2.0终于上线了,断断续续忙了有2个多月.这个项目是我实践的第一个全栈的项目,从需求(后期有产品经理介入)到架构,再到设计(有征询设计师的意见).构建(前端.后台.数据库.服务器部署),也是 ...

  4. 利用POI工具读取word文档并将数据存储到sqlserver数据库中

    今天实现了利用POI工具读取word文档,并将数据存储到sql数据库中,代码如下: package word; import java.io.File; import java.io.FileInpu ...

  5. Excel表数据导入Sql Server数据库中

    Excel表数据导入Sql Server数据库的方法很多,这里只是介绍了其中一种: 1.首先,我们要先在test数据库中新建一个my_test表,该表具有三个字段tid int类型, tname nv ...

  6. C#-WinForm-ListView-表格式展示数据、如何将数据库中的数据展示到ListView中、如何对选中的项进行修改

    在展示数据库中不知道数量的数据时怎么展示最好呢?--表格 ListView - 表格形式展示数据 ListView 常用属性 HeaderStyle - "详细信息"视图中列标头的 ...

  7. 快速将excel数据保存到Oracle数据库中【转】

    我们在工作中,也许会碰到以下情况,客户或者同事发来需要调查的数据,并不是dmp文件,而是excel文件,此时通常是一张表,少量几条记录.最近我恰好碰到了这种情况,所以做了些调查,不敢藏私,拿出来跟大家 ...

  8. 用JDBC把Excel中的数据导入到Mysql数据库中

    步骤:0.在Mysql数据库中先建好table 1.从Excel表格读数据 2.用JDBC连接Mysql数据库 3.把读出的数据导入到Mysql数据库的相应表中 其中,步骤0的table我是先在Mys ...

  9. logstash将redis中的队列中数据发送到influxdb数据库中

    通过elk获取到的java jvm中ygc的时间如下: 现在讲ygc字段的值,发送到influxdb中 首先安装logstash的插件 logstash-output-influxdb 安装完成后,查 ...

随机推荐

  1. Python之父新发文,将替换现有解析器

    花下猫语: Guido van Rossum 是 Python 的创造者,虽然他现在放弃了"终身仁慈独裁者"的职位,但却成为了指导委员会的五位成员之一,其一举一动依然备受瞩目.近日 ...

  2. 写这篇博客之前,我又忘了“==”和equals的区别。

    没错.嘟嘟又把==号和equals 的区别给忘掉了 ==号比较基本类型的时候比的是值,比较引用类型的时候比较的是地址.equals比较基本类型的时候.... 脑子里关于这道题的答案好模糊好没有安全感 ...

  3. 第二章 :初识MySQL

    一.MySQL 1. MySQL的版本 社区版 企业帮 2.MySQL的优势 1.运行速度快 2.使用成本低 3.容易使用 4.可移植性高 5.适用更多用户 二.默认字符集设置 1.Standard ...

  4. D3学习之画布制作

    最近大半个月都和d3斗争,学习艰辛(呜呜……)如果觉得作者写的对你有用,可以打赏作者哦!owo 起言:结合自己的学习之路,我认为要想使用d3画图搞清楚布局很重要,层次分明,就给了你很大的灵活性,写起代 ...

  5. 关于STM32F103+ESP8266+阿里云过程之环境搭建和阿里云数据格式设置及注意点(一)

    计划实现功能:将STM32F103采集到的温湿度,PM2.5等数值,通过UART与ESP8266通讯,使得ESP8266对外仅充当串口功能的黑盒.ESP8266通过MTQQ发布订阅数据,设备上传.接收 ...

  6. win10安装.NET Framework 3.5方法

    win10下默认没有.NET Framework 3.5,但是有时候我们运行一些网络相关的软件要用到它,下面是它的具体安装方法(绝对可以成功) 将系统镜像挂载到虚拟光驱 复制虚拟光驱下的\source ...

  7. .Net集合详解

    前言 前面几篇文章讲了泛型.讲了数组,都有提到集合,这一节重点对集合进行详细解说.本文主要使用各种集合类型.以至于评估其性能,针对不同的场景选择不同的集合使用. 集合分类详解 一.列表 列表的创建 v ...

  8. Js面向对象构造函数继承

    构造函数继承 <!-- 创建构造函数 --> function Animal(){ this.species= '动物'; } function Dog(name,color){ this ...

  9. java中System.out.println()打印输出结果

    疑点:syso()是打印输出语句,打印的是什么? syso()不同情况下打印输出的结果不一样: 1. package com.briup; public class Syso { public sta ...

  10. git和githup

    一:Git简介 1.1:VCS的历史 Git是一款代码管理工具(Version Control System),傲视群雄,是目前世界上最先进的免费开源的分布式版本控制系统,没有之一! VCS版本控制系 ...