/// <summary> /// Programmer:liuxubang /// time:7-18 15:47 /// 通过子模块的编号获得相应的权限 /// </summary> /// <param name="moduleCode"></param> /// <returns></returns> public IList <System_module_right> GetModuleRightByCode(String moduleCode) { IList <System_module_right> list = new List <System_module_right>(); MySqlParameter[] param = new MySqlParameter[] { new MySqlParameter("?moduleCode", moduleCode) }; try { using (MySqlDataReader reader = MySqlHelper.ExecuteReader(SELECT_BYCODE, param)) { while (reader.Read()) { System_module sysModule = new System_module(); sysModule.Module_code = reader.GetString(1); System_module_operate sysModuleOperate = new System_module_operateService().GetModuleOperateByOperateId(reader.GetInt32(3)); //System_module_right sysModuleRight = new System_module_right(reader.GetInt32(0), sysModule, sysModuleOperate, reader.GetChar(2), reader.GetString(4)); System_module_right sysModuleRight = new System_module_right(); sysModuleRight.Module_right_id = reader.GetInt32("Module_right_id"); sysModuleRight.Module_code = reader.GetString("Module_code"); sysModuleRight.OperateID = reader.GetInt32("OperateID"); sysModuleRight.Status = reader.GetString("status"); sysModuleRight.Right_page = reader.GetString("right_page"); list.Add(sysModuleRight); } reader.Close(); } } catch (Exception e) { Console.WriteLine(e.Message); } return(list); }
///<summary> ///添加方法,返回Boolean类型,为true表示操作成功,否则操作失败 ///生成时间:2010-8-27 22:00:49 ///</summary> public Boolean AddSystem_module_right(System_module_right system_module_right) { MySqlParameter[] param = new MySqlParameter[] { new MySqlParameter("?Module_code", system_module_right.Module_code), new MySqlParameter("?OperateID", system_module_right.OperateID), new MySqlParameter("?status", system_module_right.Status), new MySqlParameter("?right_page", system_module_right.Right_page) }; return(MySqlHelper.ExecuteNonQuery(SQL_INSERT, param) > 0); }
///<sumary> ///修改信息 ///时间:2010-8-27 22:01:16 ///</sumary> public static Boolean UpdateSystem_module_right(System_module_right system_module_right) { try { return(system_module_rightService.UpdateSystem_module_right(system_module_right)); } catch (Exception ex) { //可以记录到异常日志 return(false); } }