/// <summary> /// 修改代理系统角色 /// </summary> /// <param name="data">数据库连接</param> /// <param name="tsAgentRole">代理系统角色</param> public virtual void Edit(DataAccess data, TSAgentRole tsAgentRole) { string strSQL = "update TSAgentRole set roleName=@roleName,status=@status,type=@type where roleId=@roleId"; Param param = new Param(); param.Clear(); param.Add("@roleName", tsAgentRole.roleName); //角色名称 param.Add("@status", tsAgentRole.status); //使用状态 param.Add("@type", tsAgentRole.type); //类型 param.Add("@roleId", tsAgentRole.roleId); //角色编号 data.ExecuteNonQuery(CommandType.Text, strSQL, param); }
protected DataAccess db = new DataAccess(DataAccess.DBConn);//数据库连接 #region 代码生成器自动生成 /// <summary> /// 增加代理系统角色 /// </summary> /// <param name="data">数据库连接</param> /// <param name="tsAgentRole">代理系统角色</param> public virtual void Add(DataAccess data, TSAgentRole tsAgentRole) { string strSQL = "insert into TSAgentRole (roleId,roleName,status,type) values (@roleId,@roleName,@status,@type)"; Param param = new Param(); param.Clear(); param.Add("@roleId", tsAgentRole.roleId); //角色编号 param.Add("@roleName", tsAgentRole.roleName); //角色名称 param.Add("@status", tsAgentRole.status); //使用状态 param.Add("@type", tsAgentRole.type); //类型 data.ExecuteNonQuery(CommandType.Text, strSQL, param); }
/// <summary> /// 加载指定代理系统角色 /// <param name="roleId">角色编号</param> /// </summary> public void Load(string roleId) { try { TSAgentRole tsAgentRole = tsAgentRoleDAO.Get(roleId); WebJson.ToJson(context, tsAgentRole); } catch (Exception e) { Message.error(context, e.Message); } }
/// <summary> /// 增加代理系统角色 /// <param name="tsAgentRole">代理系统角色</param> /// </summary> public void Add(TSAgentRole tsAgentRole) { try { tsAgentRoleDAO.Add(tsAgentRole); Message.success(context, "代理系统角色增加成功"); loginSession.Log("XXXXXX代理系统角色增加成功"); } catch (Exception e) { Message.error(context, "代理系统角色增加失败"); loginSession.Log(e.Message); } }
/// <summary> /// 根据角色ID获取代理商角色类型 /// </summary> /// <param name="roleId"></param> /// <returns></returns> public string GetRoleType(string roleId) { string roleType = ""; try { TSAgentRole tsAgentRole = tsAgentRoleDAO.Get(roleId); roleType = tsAgentRole.type; } catch (Exception e) { Message.error(context, e.Message); } return(roleType); }
/// <summary> /// 修改代理系统角色 /// <param name="tsAgentRole">代理系统角色</param> /// </summary> public void Edit(TSAgentRole tsAgentRole) { try { db.Open(); Edit(db, tsAgentRole); } catch (Exception e) { throw e; } finally { db.Close(); } }
/// <summary> /// 增加代理系统角色 /// </summary> /// <param name="tsAgentRole">代理系统角色</param> public virtual void Add(TSAgentRole tsAgentRole) { try { db.Open(); Add(db, tsAgentRole); } catch (Exception e) { throw e; } finally { db.Close(); } }