public object GetData(string FileTypeId, string userid) { try { var tran = Utility.Database.BeginDbTransaction(); var data = new GetDataModel(); //条件 StringBuilder condition = new StringBuilder(); //判断权限 string priName = CommonFunctional.JudgeMan(userid, tran); //全局权限 if (priName == "all") { condition.AppendFormat(""); } else if (priName == "dep")//部门权限 { condition.AppendFormat(" and e.DPID = '{0}'", ComClass.GetUserInfo(userid).DPID); } else if (priName == "single")//个权限 { condition.AppendFormat(" and e.UserId = '{0}'", userid); } StringBuilder strSql = new StringBuilder(); strSql.AppendFormat(@" SELECT a.caseid, a.id, a.title, b.FileTypeName, a.fwrq, a.createMan, CASE WHEN a.sendCheckType = '1' THEN '桂环站' WHEN a.sendCheckType = '2' THEN '代厅拟文' WHEN a.sendCheckType = '3' THEN '内部事项' WHEN a.sendCheckType = '4' THEN '其他' ELSE '未知' END sendCheckType, CASE WHEN a.sendCheckType = '1' THEN guiHuanZhan WHEN a.sendCheckType = '2' THEN daiTingNiWen WHEN a.sendCheckType = '3' THEN neiBuShiXiang WHEN a.sendCheckType = '4' THEN qiTa ELSE '' END sendCheckTypeName FROM B_OA_SendDoc_QuZhan AS a LEFT JOIN B_OA_FileType AS b ON b.FileTypeId = a.sendType LEFT JOIN FX_WorkFlowCase as c on a.caseid = c.ID LEFT JOIN FX_UserInfo as e on e.UserID = a.createManId where 1=1 {0} and c.ID is not null ", condition.ToString()); if (FileTypeId != "") { strSql.AppendFormat(@" AND a.sendType = '{0}'", FileTypeId); } strSql.Append(@" ORDER BY caseid DESC"); DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); DataTable dataList = ds.Tables[0]; Utility.Database.Commit(tran); return new { dataList = dataList }; } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }
public object GetData(string FileTypeId, string userid) { try { var tran = Utility.Database.BeginDbTransaction(); var data = new GetDataModel(); StringBuilder strSql = new StringBuilder(); strSql.AppendFormat(@" SELECT a.caseid, a.id, a.title, b.FileTypeName, a.fwrq, a.createMan, CASE WHEN a.sendCheckType = '1' THEN '桂环站' WHEN a.sendCheckType = '2' THEN '代厅拟文' WHEN a.sendCheckType = '3' THEN '内部事项' WHEN a.sendCheckType = '4' THEN '其他' ELSE '未知' END sendCheckType, CASE WHEN a.sendCheckType = '1' THEN guiHuanZhan WHEN a.sendCheckType = '2' THEN daiTingNiWen WHEN a.sendCheckType = '3' THEN neiBuShiXiang WHEN a.sendCheckType = '4' THEN qiTa ELSE '' END sendCheckTypeName FROM B_OA_SendDoc_QuZhan AS a LEFT JOIN B_OA_FileType AS b ON b.FileTypeId = a.sendType LEFT JOIN FX_WorkFlowCase as c on a.caseid = c.ID where 1=1 and c.ID is not null "); if (FileTypeId != "") { strSql.AppendFormat(@" AND a.sendType = '{0}'", FileTypeId); } strSql.Append(@" ORDER BY caseid DESC"); DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); DataTable dataList = ds.Tables[0]; Utility.Database.Commit(tran); return new { dataList = dataList }; } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }