<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. dubbo同步调用、异步调用和是否返回结果源码分析和实例

    0. dubbo同步调用.异步调用和是否返回结果配置 (1)dubbo默认为同步调用,并且有返回结果. (2)dubbo异步调用配置,设置 async="true",异步调用可以提 ...

  2. django第二次 (转自刘江)

    除了我们前面说过的普通类型字段,Django还定义了一组关系类型字段,用来表示模型与模型之间的关系. 一.多对一(ForeignKey) 多对一的关系,通常被称为外键.外键字段类的定义如下: clas ...

  3. spring @Required注解

    以下内容引用自http://wiki.jikexueyuan.com/project/spring/annotation-based-configuration/spring-required-ann ...

  4. http协议(一):http协议基础知识

    1    协议类型 l  HTTP  超文本传输协议 通过浏览器和服务器进行数据交互,进行超文本(文本.图片.视频等)传输的规定 l  HTTPS 安全超文本传输协议 l  FTP 文本传输协议 l  ...

  5. hdoj 3555 BOMB(数位dp)

    //hdoj 3555 //2013-06-27-16.53 #include <stdio.h> #include <string.h> __int64 dp[21][3], ...

  6. HashMap常见面试题整理

    花了三天时间来仔细阅读hashMap的源码,期间补了下不少数据结构的知识,刷了不少相关的面试题并进行了整理 1.谈一下HashMap的特性? 1.HashMap存储键值对实现快速存取,允许为null. ...

  7. 放出一批学生管理系统jsp源码,部分有框架

    基于jsp+struts 2的学生管理系统eclipse - 源码码头   https://www.icodedock.com/article/25.html 基于jsp+mysql的JSP学生成绩管 ...

  8. Java内存模型的基础

    Java内存模型的基础 并发编程模型的两个关键问题 在并发编程中,需要处理两个关键问题:线程之间如何通信及线程之间如何同步(这里的线程是指并发执行的活动实体).通信是指线程之间以何种机制来交换信息.在 ...

  9. Python学习系列(四)Python 入门语法规则2

    Python学习系列(四)Python 入门语法规则2 2017-4-3 09:18:04 编码和解码 Unicode.gbk,utf8之间的关系 2.对于py2.7, 如果utf8>gbk, ...

  10. 伪分布式Spark + Hive on Spark搭建

    Spark大数据平台有使用一段时间了,但大部分都是用于实验而搭建起来用的,搭建过Spark完全分布式,也搭建过用于测试的伪分布式.现在是写一遍随笔,记录一下曾经搭建过的环境,免得以后自己忘记了.也给和 ...