//权限操作 public ActionResult PerOperation() { string rgid = Request["rgid"] ?? string.Empty; string pgid = Request["pgid"] ?? string.Empty; int oType = Request["oType"].ToInt32(-1); //1:新增;0:删除 int result = 0; if (oType == 1) { Role_ModualPermission_Mapping obj = new Role_ModualPermission_Mapping(); obj.p_gid = pgid; obj.r_gid = rgid; obj.r_p_CreateTime = DateTime.Now; obj.r_p_CreateUser = SiteHelp.CurrentUserName; obj.r_p_gid = Entity.GenerateGUID(); result = SystemSeviceClass.Role_ModualPermission_Mapping_Insert(obj); } else if (oType == 0) { result = SystemSeviceClass.Role_ModualPermission_Mapping_DeleteByr_gidAndp_gid(rgid, pgid); } if (result > 0) { return(Json(new { success = true, errors = new { text = "操作成功" } })); } else { return(Json(new { success = false, errors = new { text = "操作失败" } })); } }
/// <summary> /// 更新角色权限 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static int Role_ModualPermission_Mapping_UpdateByr_p_id(Role_ModualPermission_Mapping obj) { using (SystemDAL access = new SystemDAL()) { return(access.Role_ModualPermission_Mapping_UpdateByr_p_id(obj)); } }
/// <summary> /// 插入角色权限 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static int Role_ModualPermission_Mapping_Insert(Role_ModualPermission_Mapping obj) { using (SystemDAL access = new SystemDAL()) { return(access.Role_ModualPermission_Mapping_Insert(obj)); } }
public List <Role_ModualPermission_Mapping> Role_ModualPermission_Mapping_SelectPage(string cloumns, int pageIndex, int pageSize, string orderBy, string where, out int rowCount) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_Role_ModualPermission_Mapping_SelectPage"); db.AddOutParameter(dbCmd, "@rowCount", DbType.Int32, 4); db.AddInParameter(dbCmd, "@cloumns", DbType.String, cloumns); db.AddInParameter(dbCmd, "@pageIndex", DbType.Int32, pageIndex); db.AddInParameter(dbCmd, "@pageSize", DbType.Int32, pageSize); db.AddInParameter(dbCmd, "@orderBy", DbType.String, orderBy); db.AddInParameter(dbCmd, "@where", DbType.String, where); List <Role_ModualPermission_Mapping> list = new List <Role_ModualPermission_Mapping>(); try { using (IDataReader reader = db.ExecuteReader(dbCmd)) { while (reader.Read()) { //属性赋值 Role_ModualPermission_Mapping obj = this.Obj2Model <Role_ModualPermission_Mapping>(reader); list.Add(obj); } reader.NextResult(); } rowCount = (int)dbCmd.Parameters["@rowCount"].Value; return(list); } catch (Exception e) { throw new Exception(e.Message); } }
public int Role_ModualPermission_Mapping_UpdateByr_p_id(Role_ModualPermission_Mapping obj) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_Role_ModualPermission_Mapping_UpdateByr_p_id"); db.AddInParameter(dbCmd, "@r_p_id", DbType.Int32, obj.r_p_id); db.AddInParameter(dbCmd, "@r_p_gid", DbType.String, obj.r_p_gid); db.AddInParameter(dbCmd, "@r_gid", DbType.String, obj.r_gid); db.AddInParameter(dbCmd, "@p_gid", DbType.String, obj.p_gid); db.AddInParameter(dbCmd, "@r_p_CreateTime", DbType.String, obj.r_p_CreateTime); db.AddInParameter(dbCmd, "@r_p_CreateUser", DbType.String, obj.r_p_CreateUser); try { int returnValue = db.ExecuteNonQuery(dbCmd); return(returnValue); } catch (Exception e) { throw new Exception(e.Message); } }
public Role_ModualPermission_Mapping Role_ModualPermission_Mapping_SelectByr_p_id(int r_p_id) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_Role_ModualPermission_Mapping_SelectByr_p_id"); db.AddInParameter(dbCmd, "@r_p_id", DbType.Int32, r_p_id); Role_ModualPermission_Mapping obj = null; try { using (IDataReader reader = db.ExecuteReader(dbCmd)) { while (reader.Read()) { //属性赋值 obj = this.Obj2Model <Role_ModualPermission_Mapping>(reader); } } return(obj); } catch (Exception e) { throw new Exception(e.Message); } }