public static int User_Role_Mapping_UpdateByu_r_id(User_Role_Mapping obj) { using (SystemDAL access = new SystemDAL()) { return(access.User_Role_Mapping_UpdateByu_r_id(obj)); } }
//用户角色设置 public ActionResult UserRoleOperation() { string ugid = Request["ugid"] ?? string.Empty; string rgid = Request["rgid"] ?? string.Empty; int oType = Request["oType"].ToInt32(-1); //1:新增;0:删除 int result = 0; if (oType == 1) { User_Role_Mapping obj = new User_Role_Mapping(); obj.u_gid = ugid; obj.r_gid = rgid; obj.u_r_CreateTime = DateTime.Now; obj.u_r_CreateUser = SiteHelp.CurrentUserName; obj.u_r_gid = Entity.GenerateGUID(); result = SystemSeviceClass.User_Role_Mapping_Insert(obj); } else if (oType == 0) { result = SystemSeviceClass.User_Role_Mapping_DeleteByr_gidAndu_gid(rgid, ugid); } if (result > 0) { return(Json(new { success = true, errors = new { text = "操作成功" } })); } else { return(Json(new { success = false, errors = new { text = "操作失败" } })); } }
public static int User_Role_Mapping_Insert(User_Role_Mapping obj) { using (SystemDAL access = new SystemDAL()) { return(access.User_Role_Mapping_Insert(obj)); } }
public List <User_Role_Mapping> User_Role_Mapping_SelectPage(string cloumns, int pageIndex, int pageSize, string orderBy, string where, out int rowCount) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_User_Role_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 <User_Role_Mapping> list = new List <User_Role_Mapping>(); try { using (IDataReader reader = db.ExecuteReader(dbCmd)) { while (reader.Read()) { User_Role_Mapping obj = Obj2Model <User_Role_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 User_Role_Mapping_UpdateByu_r_id(User_Role_Mapping obj) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_User_Role_Mapping_UpdateByu_r_id"); db.AddInParameter(dbCmd, "@u_r_id", DbType.Int32, obj.u_r_id); db.AddInParameter(dbCmd, "@u_r_gid", DbType.String, obj.u_r_gid); db.AddInParameter(dbCmd, "@u_gid", DbType.String, obj.u_gid); db.AddInParameter(dbCmd, "@r_gid", DbType.String, obj.r_gid); db.AddInParameter(dbCmd, "@u_r_CreateTime", DbType.String, obj.u_r_CreateTime); db.AddInParameter(dbCmd, "@u_r_CreateUser", DbType.String, obj.u_r_CreateUser); try { int returnValue = db.ExecuteNonQuery(dbCmd); return(returnValue); } catch (Exception e) { throw new Exception(e.Message); } }
public User_Role_Mapping User_Role_Mapping_SelectByu_r_id(int u_r_id) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_User_Role_Mapping_SelectByu_r_id"); db.AddInParameter(dbCmd, "@u_r_id", DbType.Int32, u_r_id); User_Role_Mapping obj = null; try { using (IDataReader reader = db.ExecuteReader(dbCmd)) { while (reader.Read()) { obj = Obj2Model <User_Role_Mapping>(reader); } } return(obj); } catch (Exception e) { throw new Exception(e.Message); } }
public List <User_Role_Mapping> User_Role_Mapping_SelectByu_gid(string u_gid) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_User_Role_Mapping_SelectByu_gid"); db.AddInParameter(dbCmd, "@u_gid", DbType.String, u_gid); List <User_Role_Mapping> list = new List <User_Role_Mapping>(); try { using (IDataReader reader = db.ExecuteReader(dbCmd)) { while (reader.Read()) { User_Role_Mapping obj = Obj2Model <User_Role_Mapping>(reader); list.Add(obj); } } return(list); } catch (Exception e) { throw new Exception(e.Message); } }