/// <summary> /// 获取最大编号 /// </summary> /// <returns></returns> public object GetMaxCode() { return(DataFactory.DbUtils().GetMax("BPMS_User", "SortCode")); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public BPMS_User GetEntity(string KeyValue) { return(DataFactory.DbUtils().GetModelById <BPMS_User>("UserId", KeyValue)); }
/// <summary> /// 登录验证 /// </summary> /// <param name="Account">登录账户</param> /// <returns></returns> public BPMS_User GetEntityByAccount(string Account) { return(DataFactory.DbUtils().GetModelById <BPMS_User>("Account", Account)); }
/// <summary> /// 删除一条数据 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public int Delete(string KeyValue) { return(DataFactory.DbUtils().Delete("BPMS_ItemDetails", "ItemDetailsId", KeyValue)); }
/// <summary> /// 批量删除数据 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public int BatchDelete(string[] KeyValue) { return(DataFactory.DbUtils().BatchDelete("BPMS_User", "UserId", KeyValue)); }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public int UpdateNotLog(BPMS_User entity) { return(DataFactory.DbUtils().Update(entity, "UserId")); }
/// <summary> /// 批量删除数据 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public int BatchDelete(string[] KeyValue) { return(DataFactory.DbUtils().BatchDelete("BPMS_SysMenu", "MenuId", KeyValue)); }
/// <summary> /// 批量删除数据 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public int BatchDelete(string[] KeyValue) { return(DataFactory.DbUtils().BatchDelete("BASE_News", "NewsId", KeyValue)); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public BASE_News GetEntity(string KeyValue) { return(DataFactory.DbUtils().GetModelById <BASE_News>("NewsId", KeyValue)); }
/// <summary> /// 增加一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public int Insert(BASE_News entity) { entity.SortCode = CommonHelper.GetInt(this.GetMaxCode()); return(DataFactory.DbUtils().Insert(entity)); }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public int Update(BASE_News entity) { return(DataFactory.DbUtils().Update(entity, "NewsId")); }
/// <summary> /// 获取最大编号 /// </summary> /// <returns></returns> public object GetMaxCode() { return(DataFactory.DbUtils().GetMax("BASE_News", "SortCode")); }
/// <summary> /// 获取记录总数 /// </summary> /// <param name="KeyValue">主键值</param> /// <returns></returns> public int GetRecordCount(string KeyValue) { return(DataFactory.DbUtils().RecordCount("BPMS_SysMenu", "MenuId", KeyValue)); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public BPMS_SysMenu GetEntity(string KeyValue) { return(DataFactory.DbUtils().GetModelById <BPMS_SysMenu>("MenuId", KeyValue)); }
/// <summary> /// 获取记录总数 /// </summary> /// <param name="KeyValue">主键值</param> /// <returns></returns> public int GetRecordCount(string KeyValue) { return(DataFactory.DbUtils().RecordCount("BPMS_User", "UserId", KeyValue)); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public BPMS_ItemDetails GetEntity(string KeyValue) { return(DataFactory.DbUtils().GetModelById <BPMS_ItemDetails>("ItemDetailsId", KeyValue)); }
/// <summary> /// 获取记录总数(带条件) /// </summary> /// <param name="where">条件</param> /// <param name="param">参数化</param> /// <returns></returns> public int GetRecordCount(StringBuilder where, SqlParam[] param) { return(DataFactory.DbUtils().RecordCount("BPMS_User", where, param)); }
/// <summary> /// 获取记录总数 /// </summary> /// <param name="KeyValue">主键值</param> /// <returns></returns> public int GetRecordCount(string KeyValue) { return(DataFactory.DbUtils().RecordCount("BPMS_ItemDetails", "ItemDetailsId", KeyValue)); }
/// <summary> /// 获取 角色,用户 按钮权限 /// </summary> /// <param name="UserId">用户主键</param> /// <returns></returns> public IList GetButtonPermission(string UserId) { StringBuilder strSql = new StringBuilder(); strSql.Append(@"SELECT BID.UserId , BID.MenuId , BID.ButtonId , B.FullName , B.Img , B.Event , B.Control_ID , B.Category , B.Split , B.Description, MB.SortCode FROM BPMS_Button B INNER JOIN ( SELECT UR.UserId AS UserId , RMB.MenuId AS MenuId , RMB.ButtonId AS ButtonId FROM BPMS_UserRole UR INNER JOIN BPMS_RoleMenuButton RMB ON UR.RoleId = RMB.RoleId GROUP BY RMB.MenuId , RMB.ButtonId , UR.UserId UNION SELECT UM.UserId AS UserId , UM.MenuId AS MenuId , UMB.ButtonId AS ButtonId FROM BPMS_UserMenu UM INNER JOIN BPMS_UserMenuButton UMB ON UM.MenuId = UMB.MenuId GROUP BY UM.UserId , UM.MenuId , UMB.ButtonId UNION SELECT U.UserId , RMB.MenuId , RMB.ButtonId FROM BPMS_User u INNER JOIN BPMS_RoleMenuButton RMB ON u.RoleId = RMB.RoleId WHERE U.UserId = @UserId ) BID ON B.ButtonId = BID.ButtonId INNER JOIN BPMS_SysMenuButton MB ON BID.MenuId = MB.MenuId AND BID.ButtonId = MB.ButtonId WHERE BID.UserId = @UserId AND B.Enabled = 1 GROUP BY BID.UserId , BID.MenuId , BID.ButtonId , B.FullName , B.Img , B.Event , B.Control_ID , B.Category , B.Split , B.Description , MB.SortCode ORDER BY MB.SortCode"); SqlParam[] param = { new SqlParam("@UserId", UserId) }; return(DataFactory.SqlHelper().GetDataListBySQL <BPMS_ButtonPermission>(strSql, param)); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="KeyValue">主键</param> /// <returns></returns> public BPMS_Shortcut GetEntity(string KeyValue) { return(DataFactory.DbUtils().GetModelById <BPMS_Shortcut>("ShortcutId", KeyValue)); }