Esempio n. 1
0
        /// <summary>
        /// 根据ID修改模版文件字段
        /// </summary>
        /// <param name="newFileName"></param>
        public void UpdateFilePath(string id, string newFileName)
        {
            ISession session = NHelper.GetCurrentSession();
            IQuery   query   = session.CreateQuery(string.Format("update WEB_REPORT_INFO set FILEPATH='{0}' where ID={1}", newFileName, id));

            query.ExecuteUpdate();
        }
Esempio n. 2
0
        /// <summary>
        /// 根据用户ID,获取所有报表功能模块权限ID
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public IList GetReportFuncsByUserID(string userID)
        {
            string    strSql = string.Format(@"select distinct FUNC_ID from (select * from Web_Login_Role  where LOGIN_ID={0}) LR join Web_Sys_Rolefuncs RF on LR.ROLE_ID=RF.ROLE_ID  where FTYPE!=1", userID);
            ISQLQuery query  = NHelper.GetCurrentSession().CreateSQLQuery(strSql);

            return(query.List());
        }
Esempio n. 3
0
        public void Delete(int id)
        {
            //control.Delete(new WEB_REPORT_PARAMETER() { ID = id });
            ISession session = NHelper.GetCurrentSession();
            IQuery   query   = session.CreateQuery(string.Format("update WEB_REPORT_PARAMETER set DELETED = 1 where ID={0}", id));

            query.ExecuteUpdate();
        }
Esempio n. 4
0
        /// <summary>
        /// 更改坐标
        /// </summary>
        /// <param name="id"></param>
        /// <param name="newCoor"></param>
        public void EditCoordinateData(string id, string newCoor)
        {
            string strSql  = string.Format("update WEB_PARK_LOCATION set COORDINATEDATA='{0}' where ID={1}", newCoor, id);
            var    session = NHelper.GetCurrentSession();

            session.CreateQuery(strSql).ExecuteUpdate();
            session.Close();
        }
Esempio n. 5
0
        /// <summary>
        /// 根据用户ID,获取用户对应的Web报表权限列表
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public IList GetWebReportListByUserID(string userID)
        {
            string strSql = string.Format(@"select ID,CATEGORYID,NAME,ISONLINE,FILEPATH from WEB_REPORT_INFO where ID in(
 select distinct FUNC_ID from (select * from Web_Login_Role  where LOGIN_ID={0}) LR 
 join Web_Sys_Rolefuncs RF on LR.ROLE_ID=RF.ROLE_ID  where FTYPE = 5) and status=1  and DELETED=0 order by SORT", userID);

            return(NHelper.GetCurrentSession().CreateSQLQuery(strSql).List());
        }
Esempio n. 6
0
        /// <summary>
        /// 根据用户ID,获取所有常规功能模块权限列表
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <returns></returns>
        public IList GetFunsListByID(string id)
        {
            string    strSql = string.Format(@"select F.* from WEB_SYS_FUNCTIONS F join(select distinct FUNC_ID from  
(select ROLE_ID from Web_Login_Role  where LOGIN_ID={0}) LR 
join Web_Sys_Rolefuncs RF on LR.ROLE_ID=RF.ROLE_ID)A on F.ID = A.FUNC_ID order by FUN_SORT", id);
            ISQLQuery query  = NHelper.GetCurrentSession().CreateSQLQuery(strSql);

            return(query.List());
        }
Esempio n. 7
0
        /// <summary>
        /// 获取所有叶子节点ID,和名称路径
        /// </summary>
        /// <returns></returns>
        public IList GetLeafNamePath()
        {
            string strSql = @" select ID,NAME_PATH from(
 select T.ID,T.DELETED,CONNECT_BY_ISLEAF as ISLEAF,
 SUBSTR(SYS_CONNECT_BY_PATH(NAME,'->'),3) as NAME_PATH
 from WEB_REPORT_CATEGORY  T where DELETED=0
 start with PARENTID is null
 connect by prior ID=PARENTID)R 
 where ISLEAF=1  order by NAME_PATH";

            return(NHelper.GetCurrentSession().CreateSQLQuery(strSql).List());
        }
Esempio n. 8
0
        public void DeleteByRoleIDAndUserID(string roleID, string userID)
        {
            //string strSql = string.Format("from WEB_LOGIN_ROLE where ROLE_ID={0} and LOGIN_ID={1}", roleID, userID);
            //var session = NHelper.GetCurrentSession();
            //session.Delete(strSql);
            //session.Close();

            string strSql  = string.Format("delete WEB_LOGIN_ROLE where ROLE_ID={0} and LOGIN_ID={1}", roleID, userID);
            var    session = NHelper.GetCurrentSession();

            session.CreateQuery(strSql).ExecuteUpdate();
            session.Close();
        }
Esempio n. 9
0
        public void DeleteByRoleIDAndFuncID(string roleID, string funcID, string ftype)
        {
            //string strSql = string.Format("from WEB_SYS_ROLEFUNCS where ROLE_ID='{0}' and FUNC_ID='{1}'", roleID, funcID);
            //var session = NHelper.GetCurrentSession();
            //session.Delete(strSql);
            //session.Close();

            string strSql  = string.Format("delete WEB_SYS_ROLEFUNCS where ROLE_ID='{0}' and FUNC_ID='{1}' and FTYPE='{2}'", roleID, funcID, ftype);
            var    session = NHelper.GetCurrentSession();

            session.CreateQuery(strSql).ExecuteUpdate();
            session.Close();
        }
Esempio n. 10
0
        /// <summary>
        /// 用户名重复判断
        /// </summary>
        /// <param name="name">用户名</param>
        /// <returns></returns>
        public bool ExistName(string name, string id = "0")
        {
            string strSql = string.Format("select ID from WEB_LOGIN_INFO where LOGIN_NAME='{0}'", name);

            if (id == "0" || string.IsNullOrEmpty(id)) //新增
            {
            }
            else  //编辑
            {
                strSql += string.Format(" and ID !={0}", id);
            }
            int count = NHelper.GetCurrentSession().CreateQuery(strSql).List().Count;

            return(count > 0 ? true : false);
        }
Esempio n. 11
0
        /// <summary>
        /// 修改默认
        /// </summary>
        /// <param name="id"></param>
        public void SetDefaultMap(int id)
        {
            ISession     session     = NHelper.GetCurrentSession();
            ITransaction transaction = session.BeginTransaction();

            try
            {
                string strSql  = "update WEB_PARK_MAP set ISDEFAULT = 0";
                string strSql2 = string.Format("update WEB_PARK_MAP set ISDEFAULT = 1 where ID={0}", id);
                session.CreateSQLQuery(strSql).ExecuteUpdate();
                session.CreateSQLQuery(strSql2).ExecuteUpdate();
                transaction.Commit();
            }
            catch (Exception ex)
            {
                transaction.Rollback();
                throw ex;
            }
            finally
            {
                session.Close();
            }
        }