/// <summary> /// 新增父级活动类别 /// </summary> /// <param name="action">类别名称</param> /// <param name="description">类别描述</param> /// <returns>新增的父级类别ID</returns> public static long AddParentType(string action, string description) { LAActivityEntities db = new LAActivityEntities(); LADLL.ActivityType at = new LADLL.ActivityType(); at.Action = action; at.Description = description; at.ParentID = 0; db.ActivityType.Add(at); db.SaveChanges(); return(at.ActivityTypeID); }
/// <summary> /// 新增活动类别 /// </summary> /// <param name="action">类别名称</param> /// <param name="description">类别描述</param> /// <param name="userId">创建者ID</param> /// <param name="isShare">其他人可见</param> /// <param name="parentId">父级类别ID</param> /// <returns>新增的类别ID</returns> public static long AddActivityType(string action, string description, long userId, int isShare, long parentId) { LAActivityEntities db = new LAActivityEntities(); LADLL.ActivityType at = new LADLL.ActivityType(); at.Action = action; at.Description = description; at.ParentID = parentId; at.IsShare = isShare; at.CreatBy = userId; db.ActivityType.Add(at); db.SaveChanges(); return(at.ActivityTypeID); }