deletegroups.aspx.cs
资源名称:OASystem.rar [点击查看]
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:1k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using COM.OA.BLL;
- using COM.OA.Entity;
- using System.Collections.Generic;
- public partial class deletegroups : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- //接收要删除的群ID
- string qunid = this.Request["deletequnid"];
- //判断群ID是否为空
- if (qunid != null)
- {
- //格式化成INT类型
- int id = Int32.Parse(qunid);
- string where = "u_g_id='{0}'";
- where = string.Format(where, id);
- //先查出群里所有人员
- IList<users> ulist = usersBLL.Select(where);
- //循环用实体接收,将其群组更改为NULL
- foreach (users uu in ulist)
- {
- uu.u_g_id = 1;
- usersBLL.Update(uu);
- }
- //删除群组
- groupsBLL.Delete(id);
- this.Response.Write(string.Format(GetRedirect.WINALERT, "删除成功"));
- }
- //如果群ID为空跳回qunzu.aspx页
- else
- {
- this.Response.Write(string.Format(GetRedirect.REDIRECT, "qunzu.aspx"));
- }
- }
- }