public int Add(string Name, string PermissionsIds, string PermissionsNames, int IsUse) { Roles t = new Roles { Name = Name, PermissionsIds = PermissionsIds, PermissionsNames = PermissionsNames, IsUse = IsUse }; var result = bll.Add(t); return(result); }
public int AddRoles(int id, string roleName, string description, int orderID) { Roles roleInfo = new Roles(); roleInfo.ID = id; roleInfo.RoleName = roleName; roleInfo.Description = description; roleInfo.AddDate = DateTime.Now; roleInfo.OrderID = orderID; try { return(roleBll.Add(roleInfo)); } catch { return(-1); } }
/// <summary> /// 添加角色 /// </summary> /// <param name="r"></param> /// <returns></returns> public ActionResult AddRole(Roles r) { try { if (RolesBLL.Add(r) > 0) { return(Content("add_yes")); } else { return(Content("add_no")); } } catch (Exception ex) { return(Content(ex.Message)); } }