private string GetItembyGroupIdList(string GroupIdList) { GroupIdList = GroupIdList.Trim(','); AdmUserGroup cont = new AdmUserGroup(); ArrayList al = new ArrayList(); GroupIdList = CFun.RegularIdlist(GroupIdList, true); string[] ss = GroupIdList.Trim().Split(new char[] { ',' }); //第一种方法 for (int j = 0; j < ss.Length; j++) { if (ss[j] == "0") { cont.Name = "系统超级管理员"; al.Add(cont.Name); } else { List <AdmUserGroup> contList = GetItem(" GroupId=" + ss[j]); if (contList != null && contList.Count > 0) { cont = contList[0]; al.Add(cont.Name); } } } //直接装换为String 类型。 cont.Name = string.Join(",", (string[])al.ToArray(typeof(string))); return(cont.Name); }
/// <summary> /// 删除一批数据 /// </summary> /// <param name="idList"></param> /// <returns></returns> public bool DeleteItem(string idList) { idList = CFun.RegularIdlist(idList, true); return((ExecSqlConn.SqlExecNoquery("delete from " + tableName + " where Ld in (" + idList + ")", sqlConn) > 0) ? true : false); }