/// <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(); }
/// <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()); }
/// <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(); }
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(); }
/// <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()); }
public void CreateByLuaTable(LuaTable luaTable) { this.name = NHelper.ParseObjectToString(luaTable["name"]); this.brief = NHelper.ParseObjectToString(luaTable["brief"]); this.bg_effect = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["bg_effect"])); this.weapon_id = NHelper.ParseObjectToString(luaTable["weapon_id"]); this.GMweapon_id = NHelper.ParseObjectToString(luaTable["GMweapon_id"]); }
public void CreateByLuaTable(LuaTable luaTable) { this.name = NHelper.ParseObjectToString(luaTable["name"]); this.brief = NHelper.ParseObjectToString(luaTable["brief"]); this.theme_id = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["theme_id"])); this.group_id = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["group_id"])); this.prefab_name = NHelper.ParseObjectToString(luaTable["prefab_name"]); //this.desc = NHelper.ParseObjectToString(luaTable["desc"]); }
/// <summary> /// 根据用户ID,获取用户对应的手机报表权限列表 /// </summary> /// <param name="userID"></param> /// <returns></returns> public DataTable GetPhoneReportListByUserID(string userID) { string strSql = string.Format(@"select F.* from WEB_REPORT_INFO 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 where FTYPE=6 )A on F.ID = A.FUNC_ID where status=1 and DELETED=0 order by SORT", userID); return(NHelper.ExecuteDataSet(strSql).Tables[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()); }
/// <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()); }
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(); }
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(); }
/// <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); }
public void CreateByLuaTable(LuaTable luaTable) { this.name = NHelper.ParseObjectToString(luaTable["name"]); this.brief = NHelper.ParseObjectToString(luaTable["brief"]); this.theme_id = NHelper.ParseObjectToString(luaTable["theme_id"]); this.group_id = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["group_id"])); this.game_mode = NHelper.ParseObjectToString(luaTable["game_mode"]); this.prefab_name = NHelper.ParseObjectToString(luaTable["prefab_name"]); this.icon = NHelper.ParseObjectToString(luaTable["icon"]); this.copy_allow = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["copy_allow"])); this.delete_allow = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["delete_allow"])); this.rotate_zoom_allow = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["rotate_zoom_allow"])); this.finger_allow = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["finger_allow"])); this.GM_only = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["GM_only"])); }
/// <summary> /// 获取所有标注点详细信息 /// </summary> /// <returns></returns> public DataTable GetDetailInfo() { //暂时取固定的数据,一般取实时的日期时间 //string fdate = "2013-03-18";// DateTime.Now.ToString("yyyy-MM-dd"); //string ftime = "09:10:00";// DateTime.Now.ToString("HH:mm:ss"); string fdate = DateTime.Now.ToString("yyyy-MM-dd"); string ftime = DateTime.Now.ToString("HH:mm:ss"); string strSql = string.Format(@"select A.*, CHECKEDINNUM,CHECKEDOUTNUM,D.PARKFULLNAME from Web_Park_Location A left join (select PARKCODE,CHECKEDNUM as CHECKEDINNUM from WEB_PARK_IN where FDATE='{0}' and BEGINTIME<='{1}' and ENDTIME> '{1}')B on A.PARKCODE = B.PARKCODE left join (select PARKCODE,CHECKEDNUM as CHECKEDOUTNUM from WEB_PARK_OUT where FDATE='{0}' and BEGINTIME<='{1}' and ENDTIME> '{1}')C on A.PARKCODE = C.PARKCODE left join SYS_PARK D on A.PARKCODE = D.PARKCODE", fdate, ftime); return(NHelper.ExecuteDataSet(strSql).Tables[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(); } }
public AddNoteWindow(NHelper helper) { InitializeComponent(); _helper = helper; }
public DataTable GetAll() { string strSql = "select * from WEB_REPORT_PARAMETER"; return(NHelper.ExecuteDataSet(strSql).Tables[0]); }
public DataTable GetAll() { string strSql = "select * from WEB_LOGIN_ROLE where DELETED !=1"; return(NHelper.ExecuteDataSet(strSql).Tables[0]); }
public void CreateByLuaTable(LuaTable luaTable) { this.prefab_name = NHelper.ParseObjectToString(luaTable["prefab_name"]); this.index_id = NHelper.ParseInt(NHelper.ParseObjectToString(luaTable["index_id"])); }
/// <summary> /// 获取总记录数 /// </summary> /// <param name="tableName"></param> /// <param name="where"></param> /// <returns></returns> public static int GetTotalCount(string tableName, string where = null) { return(NHelper.GetTotalCount(tableName, where)); }
/// <summary> /// 获取第一行第一列数据 /// </summary> /// <param name="sql"></param> /// <returns></returns> public static int GetScalar(string sql) { return(NHelper.GetScalar(sql)); }
/// <summary> /// 执行SQL返回DataSet /// </summary> /// <param name="sql"></param> /// <returns></returns> public static DataSet ExecuteDataSet(string sql) { return(NHelper.ExecuteDataSet(sql)); }
public DataTable GetAll() { string strSql = "select * from SYS_PARK where DELETED !=1"; return(NHelper.ExecuteDataSet(strSql).Tables[0]); }
public DataTable GetAll() { string strSql = "select * from WEB_PARK_LOCATION "; return(NHelper.ExecuteDataSet(strSql).Tables[0]); }
public DataTable GetAll() { string strSql = "select * from SYS_ROLE"; return(NHelper.ExecuteDataSet(strSql).Tables[0]); }
public DataTable GetAll() { string strSql = "select * from WEB_REPORT_CATEGORY where DELETED !=1"; return(NHelper.ExecuteDataSet(strSql).Tables[0]); }