Example #1
0
 /// <summary>
 /// 获取最大编号
 /// </summary>
 /// <returns></returns>
 public object GetMaxCode()
 {
     return(DataFactory.DbUtils().GetMax("BPMS_User", "SortCode"));
 }
Example #2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public BPMS_User GetEntity(string KeyValue)
 {
     return(DataFactory.DbUtils().GetModelById <BPMS_User>("UserId", KeyValue));
 }
Example #3
0
 /// <summary>
 /// 登录验证
 /// </summary>
 /// <param name="Account">登录账户</param>
 /// <returns></returns>
 public BPMS_User GetEntityByAccount(string Account)
 {
     return(DataFactory.DbUtils().GetModelById <BPMS_User>("Account", Account));
 }
Example #4
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public int Delete(string KeyValue)
 {
     return(DataFactory.DbUtils().Delete("BPMS_ItemDetails", "ItemDetailsId", KeyValue));
 }
Example #5
0
 /// <summary>
 /// 批量删除数据
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public int BatchDelete(string[] KeyValue)
 {
     return(DataFactory.DbUtils().BatchDelete("BPMS_User", "UserId", KeyValue));
 }
Example #6
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public int UpdateNotLog(BPMS_User entity)
 {
     return(DataFactory.DbUtils().Update(entity, "UserId"));
 }
Example #7
0
 /// <summary>
 /// 批量删除数据
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public int BatchDelete(string[] KeyValue)
 {
     return(DataFactory.DbUtils().BatchDelete("BPMS_SysMenu", "MenuId", KeyValue));
 }
Example #8
0
 /// <summary>
 /// 批量删除数据
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public int BatchDelete(string[] KeyValue)
 {
     return(DataFactory.DbUtils().BatchDelete("BASE_News", "NewsId", KeyValue));
 }
Example #9
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public BASE_News GetEntity(string KeyValue)
 {
     return(DataFactory.DbUtils().GetModelById <BASE_News>("NewsId", KeyValue));
 }
Example #10
0
 /// <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));
 }
Example #11
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public int Update(BASE_News entity)
 {
     return(DataFactory.DbUtils().Update(entity, "NewsId"));
 }
Example #12
0
 /// <summary>
 /// 获取最大编号
 /// </summary>
 /// <returns></returns>
 public object GetMaxCode()
 {
     return(DataFactory.DbUtils().GetMax("BASE_News", "SortCode"));
 }
Example #13
0
 /// <summary>
 /// 获取记录总数
 /// </summary>
 /// <param name="KeyValue">主键值</param>
 /// <returns></returns>
 public int GetRecordCount(string KeyValue)
 {
     return(DataFactory.DbUtils().RecordCount("BPMS_SysMenu", "MenuId", KeyValue));
 }
Example #14
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public BPMS_SysMenu GetEntity(string KeyValue)
 {
     return(DataFactory.DbUtils().GetModelById <BPMS_SysMenu>("MenuId", KeyValue));
 }
Example #15
0
 /// <summary>
 /// 获取记录总数
 /// </summary>
 /// <param name="KeyValue">主键值</param>
 /// <returns></returns>
 public int GetRecordCount(string KeyValue)
 {
     return(DataFactory.DbUtils().RecordCount("BPMS_User", "UserId", KeyValue));
 }
Example #16
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public BPMS_ItemDetails GetEntity(string KeyValue)
 {
     return(DataFactory.DbUtils().GetModelById <BPMS_ItemDetails>("ItemDetailsId", KeyValue));
 }
Example #17
0
 /// <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));
 }
Example #18
0
 /// <summary>
 /// 获取记录总数
 /// </summary>
 /// <param name="KeyValue">主键值</param>
 /// <returns></returns>
 public int GetRecordCount(string KeyValue)
 {
     return(DataFactory.DbUtils().RecordCount("BPMS_ItemDetails", "ItemDetailsId", KeyValue));
 }
Example #19
0
        /// <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));
        }
Example #20
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 /// <param name="KeyValue">主键</param>
 /// <returns></returns>
 public BPMS_Shortcut GetEntity(string KeyValue)
 {
     return(DataFactory.DbUtils().GetModelById <BPMS_Shortcut>("ShortcutId", KeyValue));
 }