public static DataSet GetDutyFun(string dutyid) { DataSet dsAllUser = new DataSet(); DataTable dt = new DataTable(); DBOperate db = new DBOperate("DADB"); try { SqlParameter[] sps = new SqlParameter[] { new SqlParameter("@dutyid", dutyid) }; string strSql = "select MENUID,Code,Name,Layer,IsDetail,InvokingConfig from DSPFUNC where MENUID in (select FunID as ID from DutyFun where DutyID =@dutyid)order by Code"; dsAllUser = db.RunSql(strSql, sps); strSql = "select MENUID,Code,Name,Layer,IsDetail,InvokingConfig from DSPFUNC where MENUID not in (select FunID as ID from DutyFun where DutyID =@dutyid and layer='3')order by Code"; dt = db.RunSql(strSql, sps).Tables[0].Copy(); dt.TableName = "dtDuty"; dsAllUser.Tables.Add(dt); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(dsAllUser); }
/// <summary> /// 根据用户编号得到用户职责信息 /// </summary> /// <param name="UserID">用户编号</param> /// <returns></returns> public static DataSet GetUserDutyByID(string UserID) { DataSet ds = new DataSet(); DataTable dt = new DataTable(); DBOperate db = new DBOperate("DADB"); try { string strSql = "select UserDutyID,Duty.DutyID,DutyCode,DutyName from Duty inner join UserDuty on Duty.DutyID=UserDuty.DutyID where UserID='" + UserID + "'"; ds = db.RunSql(strSql).Copy(); strSql = "select DutyID,DutyCode,DutyName from Duty where DutyID not in (select DutyID from UserDuty where UserID='" + UserID + "')"; dt = db.RunSql(strSql).Tables[0].Copy(); dt.TableName = "dtDuty"; ds.Tables.Add(dt); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
/// <summary> /// 根据条件得到用户列表 /// </summary> /// <param name="condation">条件字符串</param> /// <returns></returns> public static DataSet GetUserListByCondation(string condation) { DBOperate db = new DBOperate("CFDBPOOL"); string sql = @"select UserID,UserCode,UserName,Sex,OfficeTel,Email,case when Status='1' then '正常' when Status='0' then '停用' else null end Status,Birthday,DepartMent,UnitName from MN_User inner join MN_Units on MN_User.DepartMent = MN_Units.UnitID where 0=0 " ; if (condation != null || condation != "") { sql += condation; } DataSet ds = null; try { ds = db.RunSql(sql); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
//根据条件得到用户列表 public static DataSet GetUserListByReq(string unitID, string userCode, string userName) { DBOperate db = new DBOperate("CFDBPOOL"); string sql = @"select UserID,UserCode,UserName,Sex,OfficeTel,Email,case when Status='1' then '正常' when Status='0' then '停用' else null end Status,Birthday,DepartMent,UnitName from MN_User inner join MN_Units on MN_User.DepartMent = MN_Units.UnitID" ; if (unitID != "") { sql += string.Format(" and DepartMent='{0}'", unitID); } else if (userCode != "") { sql += string.Format(" and UserCode='{0}'", userCode); } else if (userName != "") { sql += string.Format(" and UserName='******'", userName); } DataSet ds = null; try { ds = db.RunSql(sql); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
/// <summary> /// 得到组织和模块信息 /// </summary> /// <returns></returns> public static DataSet GetUnitAndModel() { DBOperate db = new DBOperate("CFDBPOOL"); DataSet ds = null; string sql = @"SELECT UnitID,ZJM,UnitName FROM MN_Units; select ModelID,ModelName from MN_Model; select MN_ModelEx.ModelID,ModelExID,ModelExName from MN_ModelEx inner join MN_Model on MN_ModelEx.ModelID=MN_Model.ModelID; select MN_Business.ModelExID,ScreenID,ScreenName from MN_Business inner join MN_ModelEx on MN_ModelEx.ModelExID = MN_Business.ModelExID;"; try { ds = db.RunSql(sql); ds.Tables[1].TableName = "Model"; //模块信息 ds.Tables[2].TableName = "ModelEx"; //子模块信息 ds.Tables[3].TableName = "Business"; //窗体信息 } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
/// <summary> /// 取得用户的功能列表 /// </summary> /// <param name="userID"></param> /// <returns></returns> public static DataSet GetUserBusiness(string userID) { DBOperate db = new DBOperate("CFDBPOOL"); string sql = string.Format(@"select UserID,ScreenID from MN_UserBusiness where UserID='{0}';", userID); DataSet ds = null; try { ds = db.RunSql(sql); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
/// <summary> /// 得到所有的职责 /// </summary> /// <returns></returns> public static DataSet GetAllDuty() { DataSet ds = new DataSet(); DBOperate db = new DBOperate("DADB"); try { string strSql = "select * from Duty"; ds = db.RunSql(strSql); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
/// <summary> /// 获取所有可用网点 /// </summary> /// <returns></returns> public static DataSet GetJG_Branches() { DataSet ds = null; DBOperate db = new DBOperate("DADB"); string sql = " select BR_BranchCode,BR_BranchName from JG_Branches where BR_State='1' "; try { ds = db.RunSql(sql); } catch (Exception ex) { throw ex; } finally { db.Despose(); } return(ds); }
public static DataSet getFunData() { DataSet ds; DBOperate db = new DBOperate("DADB"); try { ds = db.RunSql("select * from DSPFUNC;"); ds.Tables[0].TableName = "UserFuc"; } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
/// <summary> /// 根据组织编号和组织类别的到相应用户信息 /// </summary> /// <returns></returns> public static DataSet GetData() { DBOperate db = new DBOperate("CFDBPOOL"); DataSet ds = null; try { string sql = @"SELECT UnitID,ZJM,UnitName FROM MN_Units where unittype='1'; select UserID,UserCode,UserName,Sex,OfficeTel,Email,case when Status='1' then '正常' when Status='0' then '停用' else null end Status,Birthday,DepartMent from MN_User inner join MN_Units on MN_User.DepartMent = MN_Units.UnitID where MN_Units.unittype='1'; select UserID,UserCode,UserName,Sex,OfficeTel,Email,case when Status='1' then '正常' when Status='0' then '停用' else null end Status,Birthday,DepartMent from MN_User inner join MN_Units on MN_User.DepartMent = MN_Units.UnitID where MN_Units.unittype='2'; select UserID,UserCode,UserName,Sex,OfficeTel,Email,case when Status='1' then '正常' when Status='0' then '停用' else null end Status,Birthday,DepartMent from MN_User inner join MN_Units on MN_User.DepartMent = MN_Units.UnitID where MN_Units.unittype='3'; select UserID,UserCode,UserName,Sex,OfficeTel,Email,case when Status='1' then '正常' when Status='0' then '停用' else null end Status,Birthday,DepartMent from MN_User inner join MN_Units on MN_User.DepartMent = MN_Units.UnitID where MN_Units.unittype='4'; select UserID,UserCode,UserName,Sex,OfficeTel,Email,case when Status='1' then '正常' when Status='0' then '停用' else null end Status,Birthday,DepartMent,UnitName from MN_User inner join MN_Units on MN_User.DepartMent = MN_Units.UnitID;" ; ds = db.RunSql(sql); ds.Tables[0].TableName = "Court"; //法院列表 ds.Tables[1].TableName = "CourtUser"; //法院用户 ds.Tables[2].TableName = "ArchieveUser"; //档案馆用户 ds.Tables[3].TableName = "CodeUser"; //法规科用户 ds.Tables[4].TableName = "InfoUser"; //信息中心用户 ds.Tables[5].TableName = "AllUser"; //系统所有用户 } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }
/// <summary> /// 获取各业务的流水号 /// </summary> /// <returns></returns> public static DataSet GetNumbers() { DataSet ds = null; string sql = string.Format(@";SELECT ISNULL (MAX(SerialNo),'000000000000') SerialNo From ArchiveIndex where SerialNo like '{0}%'; SELECT ISNULL (MAX(ListNumber),'000000000000') ListNumber From ArchiveIndex where substring(ListNumber,len(ListNumber)-11,8)='{0}'; SELECT ISNULL (MAX(BusiCode),'000000000000') ListNumber From UseBusiness where BusiCode like '{0}%';", DateTime.Now.ToString("yyyyMMdd")); DBOperate dbop = new DBOperate("DADB"); try { ds = dbop.RunSql(sql); } catch (Exception e) { throw e; } finally { dbop.Despose(); } return(ds); }
/// <summary> /// 得到所有现存用户信息 /// </summary> /// <returns></returns> public static DataSet GetAllUser() { DataSet dsAllUser = new DataSet(); DBOperate db = new DBOperate("DADB"); try { string strSql = @"select UserID,UserCode,UserPWD,UserName,UNITID,SEX,LINKTEL,EMAIL,State,DESCRIBE,LOGINIP, case when State='1' then '正常' when State='0' then '停用' end as UserState,SSQ,jb.BR_BranchName as SSQNAME from UserInfo u inner join dbo.JG_Branches jb on u.ssq=jb.BR_BranchCode"; dsAllUser = db.RunSql(strSql); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(dsAllUser); }
/// <summary> /// 根据参数编号活的参数值 /// </summary> /// <param name="ParmCode">参数编号</param> /// <returns></returns> public static string GetSysParaValue(string ParmCode) { string SysParaValue = ""; DBOperate db = new DBOperate("DADB"); try { string strSql = "select ParmValue from SysParameter where ParmCode='" + ParmCode + "'"; DataSet ds = db.RunSql(strSql); if (ds != null && ds.Tables[0].Rows.Count > 0) { SysParaValue = ds.Tables[0].Rows[0]["ParmValue"].ToString(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(SysParaValue); }
/// <summary> /// 根据编号获得相应子项 /// </summary> /// <param name="SetCode">编号</param> /// <returns></returns> public static DataSet GetItemsBySetCode(string[] SetCode) { DBOperate db = new DBOperate("DADB"); DataSet ds = null; try { StringBuilder sb = new StringBuilder(); for (int i = 0; i < SetCode.Length; i++) { sb.Append(string.Format(@"select PI_ItemCode,PI_ItemName from ParmItem where PI_SetCode='{0}' order by PI_ItemCode;", SetCode[i])); } ds = db.RunSql(sb.ToString()); } catch (Exception ex) { throw new Exception(ex.ToString()); } finally { db.Despose(); } return(ds); }